DSSSB TGT / PGT · Topic-wise previous year questions

Computer Science Previous Year Questions (page 35)

2444 Computer Science questions asked in DSSSB TGT / PGT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 2444 questions
  • 20 topics
  • Official answer key
  • Free

Practise by topic

Q1701DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In FCFS scheduling, the average waiting time is affected most by:
  1. Aprocess priority
  2. Bpreemption
  3. Cthe arrival order of processes
  4. DCPU clock speed
Show answerHide answer

Correct answer: (C) the arrival order of processes

Explanation

FCFS runs processes strictly in arrival order, so if a long process arrives first, every later process waits behind it (the convoy effect). The order of arrival therefore decides the average waiting time.

Q1702DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following SQL statements will retrieve the lowest value from a column named 'Price' in a table named 'Products'?
  1. ASELECT MIN(Price) FROM Products;
  2. BSELECT LOWEST(Price) FROM Products;
  3. CSELECT TOP 1 Price FROM Products ORDER BY Price ASC;
  4. DSELECT Price FROM Products WHERE Price = MIN(Price);
Show answerHide answer

Correct answer: (A) SELECT MIN(Price) FROM Products;

Explanation

The aggregate function MIN() returns the smallest value in a column. LOWEST() does not exist, and an aggregate cannot be used directly in a WHERE clause.

Q1703DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following scenarios indicates successful connection establishment in TCP?
  1. AOnly the SYN is sent and received
  2. BData packets are transmitted without SYN packets
  3. CSYN, SYN-ACK and ACK packets are exchanged
  4. DOnly the SYN-ACK is sent
Show answerHide answer

Correct answer: (C) SYN, SYN-ACK and ACK packets are exchanged

Explanation

TCP sets up a connection with a three-way handshake: the client sends SYN, the server replies SYN-ACK and the client answers ACK. Only after this exchange is the connection established.

Q1704DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Select the correct SQL query that returns all students whose results are greater than the average result of their respective departments.
  1. ASELECT stu_id             FROM student             WHERE result > (SELECT AVG(result) FROM student GROUP BY dept_id);
  2. BSELECT stu_id             FROM student             WHERE result > AVG(result) GROUP BY dept_id;
  3. CSELECT stu_id             FROM student s             WHERE result > (SELECT AVG(s.result) FROM student);
  4. DSELECT stu_id              FROM student s              WHERE result > (SELECT AVG(result) FROM student WHERE dept_id = s.dept_id);
Show answerHide answer

Correct answer: (D) SELECT stu_id              FROM student s              WHERE result > (SELECT AVG(result) FROM student WHERE dept_id = s.dept_id);

Explanation

To compare each student with their own department's average, the subquery must be correlated: WHERE dept_id = s.dept_id links it to the outer row. Option A's subquery returns several averages, and B uses an aggregate in WHERE, which is not allowed.

Q1705DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In which logic gate, if any input is low, then the output will be high?
  1. AXNOR Logic Gate
  2. BAND Logic gate
  3. CNOR Logic gate
  4. DNAND Logic Gate
Show answerHide answer

Correct answer: (D) NAND Logic Gate

Explanation

A NAND gate outputs 0 only when all inputs are 1, so if any input is 0 (low) the output is 1 (high). An AND gate would give 0 in that case.

Q1706DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following is true about the page table?
  1. AThe page table contains the data of each process.
  2. BThe page table maps virtual addresses to physical addresses.
  3. CThe page table is used only in non-paging systems.
  4. DThe page table stores the instructions for memory management.
Show answerHide answer

Correct answer: (B) The page table maps virtual addresses to physical addresses.

Explanation

A page table holds, for each page of a process, the frame number in physical memory, so it translates virtual (logical) addresses into physical addresses. It holds no process data or instructions.

Q1707DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which attribute determines who can read, write or execute a file?
  1. AFile location
  2. BFile permissions
  3. CFile type
  4. DFile size
Show answerHide answer

Correct answer: (B) File permissions

Explanation

File permissions (for example read, write and execute for owner, group and others in Unix) control who may access a file and in what way.

Q1708DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which firewall type acts as an intermediary for requests between a client and a server?
  1. AProxy firewall
  2. BStateful
  3. CPacket-filtering
  4. DCircuit-level gateway
Show answerHide answer

Correct answer: (A) Proxy firewall

Explanation

A proxy firewall (application-level gateway) sits between client and server: it receives the client's request and makes its own request to the server, so the two never connect directly.

Q1709DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the role of the 'resource-allocation graph' in deadlock avoidance?
  1. AScheduling I/O operations
  2. BDetecting existing deadlocks
  3. CRepresenting the state of system resources and processes
  4. DTracking CPU usage
Show answerHide answer

Correct answer: (C) Representing the state of system resources and processes

Explanation

A resource-allocation graph shows processes, resources, and request and assignment edges. Using it (with claim edges), the system can check whether granting a request could create a cycle, and so avoid deadlock.

Q1710DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following protocols supports multiplexing in transport layer?
  1. AHTTP
  2. BFTP
  3. CUDP
  4. DSMTP
Show answerHide answer

Correct answer: (C) UDP

Explanation

Transport-layer protocols such as UDP and TCP multiplex several application streams over one network connection using port numbers. HTTP, FTP and SMTP are application-layer protocols.

Q1711DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
How does TCP ensure a clean termination of both sides during a normal connection release?
  1. ABy resending SYN packets
  2. BBy encrypting all termination packets
  3. CBy entering the LISTEN state after termination
  4. DBy sending FIN and ACK packets sequentially
Show answerHide answer

Correct answer: (D) By sending FIN and ACK packets sequentially

Explanation

In a normal TCP release, each side sends a FIN and the other side acknowledges it with an ACK (usually four segments). This closes both directions of the connection cleanly.

Q1712DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the purpose of the COMMIT command in SQL?
  1. ATo create a new table
  2. BTo assign privileges
  3. CTo rollback the changes
  4. DTo permanently save changes made in a transaction
Show answerHide answer

Correct answer: (D) To permanently save changes made in a transaction

Explanation

COMMIT ends a transaction and makes all its changes permanent in the database. ROLLBACK is the command that undoes them.

Q1713DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In a message queue, how are messages stored?
  1. AIn a queue structure
  2. BIn a circular buffer
  3. CIn a stack structure
  4. DIn a linked list
Show answerHide answer

Correct answer: (A) In a queue structure

Explanation

A message queue stores messages in FIFO order: messages are added at the rear and the receiver takes them from the front.

Q1714DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In order to grant a user named 'Deepak' the ability to read data from a table called 'Customers', which SQL statement should be used?
  1. AGRANT SELECT ON Customers TO Deepak;
  2. BGRANT READ ON Customers TO Deepak;
  3. CGRANT ACCESS ON Customers TO Deepak;
  4. DGIVE SELECT ON Customers TO Deepak;
Show answerHide answer

Correct answer: (A) GRANT SELECT ON Customers TO Deepak;

Explanation

SELECT is the privilege that allows reading rows from a table, so GRANT SELECT ON Customers TO Deepak; is correct. READ and ACCESS are not SQL privileges, and GIVE is not an SQL command.

Q1715DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
int a = 4, b = 8, c = 6; if (a > b) { if (a > c) { System.out.println("a is the largest"); } else if (b > c) { System.out.println("b is the largest"); } else { System.out.println("c is the largest"); } } else { if (b > c) { System.out.println("b is the largest"); } else { System.out.println("c is the largest"); } } What is the output of the above code snippet( Assume that it is written inside main() function )?
  1. Ac is the largest
  2. Bb is the largest
  3. Ca is the largest
  4. DCompilation error
Show answerHide answer

Correct answer: (B) b is the largest

Explanation

a > b (4 > 8) is false, so the outer else block runs. There b > c (8 > 6) is true, so "b is the largest" is printed.

Q1716DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which method binding is associated with method overriding in Java?
  1. AStatic binding
  2. BDynamic binding
  3. CEarly binding
  4. DCompile-time binding
Show answerHide answer

Correct answer: (B) Dynamic binding

Explanation

Method overriding is resolved at run time from the actual object type. This is dynamic (late) binding, the basis of runtime polymorphism. Static or early binding is used for overloading, private, static and final methods.

Q1717DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
A 2D array B[4][5] is stored in row-major order. The base address of the array is 5000, and each element occupies 2 bytes. What is the address of B[2][3]?
  1. A5054
  2. B5039
  3. C5048
  4. D5026
Show answerHide answer

Correct answer: (D) 5026

Explanation

Row-major address = Base + (i × columns + j) × size = 5000 + (2 × 5 + 3) × 2 = 5000 + 26 = 5026.

Q1718DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
class Person { private String name; public Person(String name) { this.name = name; } private void displayName() { System.out.println("Name: " + name); } } public class Test { public static void main(String[] args) { Person p = new Person("John"); p.displayName(); } } What will happen when the above code is compiled and executed?
  1. ACompilation Error: The method displayName is not visible in Test.
  2. BRuntime Error: The method displayName cannot be called.
  3. CThe code will compile and display Name: John.
  4. DCompilation Error: The field name is not visible in Test.
Show answerHide answer

Correct answer: (A) Compilation Error: The method displayName is not visible in Test.

Explanation

displayName() is private in Person, so it cannot be called from class Test. The compiler reports that displayName() has private access in Person.

Q1719DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following code? #include<stdio.h> int main() { int x=5,y; y=x++ + ++x; printf("%d",y); return 0; }
  1. A11
  2. Bcompile time error
  3. C12
  4. D10
Show answerHide answer

Correct answer: (C) 12

Explanation

x++ gives 5 (x becomes 6), then ++x makes x 7, so y = 5 + 7 = 12 on common compilers. Strictly, modifying x twice in one expression is undefined behaviour in C.

Q1720DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following Java code? public class DoWhileExample { public static void main(String[] args) { int x = 10; do { System.out.println("x = " + x); x++; } while (x < 13); } }
  1. Ax = 10 x = 11 x = 12
  2. Bx = 10
  3. Cx = 10 x = 11
  4. DNo output
Show answerHide answer

Correct answer: (A) x = 10 x = 11 x = 12

Explanation

A do-while body runs before the test: it prints x = 10, 11 and 12, and stops when x becomes 13 because 13 < 13 is false.

Q1721DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following code when the input is HelloWorld? #include <stdio.h> int main() { char str[5]; // Buffer for input int result = scanf("%4s", str); if (result == 1) { printf("Input: %s\n", str); } else { printf("Input error or no input.\n"); } return 0; }
  1. AInput: Hell
  2. BInput: Hello
  3. CInput error or no input
  4. DInput: HelloWorld
Show answerHide answer

Correct answer: (A) Input: Hell

Explanation

The width %4s makes scanf read at most 4 characters, so str gets "Hell" plus '\0' (fits in 5 bytes). scanf returns 1, so "Input: Hell" is printed.

Q1722DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following code? #include <stdio.h> int main() { char str[20] = "Hello, World!"; printf("%s\n", str + 7); return 0; }
  1. AWorld!
  2. B, World!
  3. CCompilation error
  4. DHello, World!
Show answerHide answer

Correct answer: (A) World!

Explanation

str + 7 points to index 7 of "Hello, World!". Index 5 is ',' and 6 is the space, so printing starts at 'W' and gives "World!".

Q1723DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following is the correct syntax of an if-else statement in C?
  1. Aif (condition) { statements } else { statements }
  2. Bif (condition) then { statements } else { statements }
  3. Cif [condition] then { statements } else { statements }
  4. Dif condition: statements else: statements
Show answerHide answer

Correct answer: (A) if (condition) { statements } else { statements }

Explanation

C syntax is if (condition) { ... } else { ... }. The condition must be in parentheses, and C has no "then" keyword or colon syntax (that is Python).

Q1724DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
If a, b are the inputs and y is the output of a two input AND logic gate, then which of the following is the correct expression for the output of the AND logic gate?
  1. Ay = a'.b'
  2. By = a.b'
  3. Cy = a'.b
  4. Dy = a.b
Show answerHide answer

Correct answer: (D) y = a.b

Explanation

An AND gate gives 1 only when both inputs are 1, so y = a·b. The options with complemented inputs describe other functions.

Q1725DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Convert the hexadecimal number (A5) 16 to its decimal equivalent.
  1. A165
  2. B160
  3. C175
  4. D170
Show answerHide answer

Correct answer: (A) 165

Explanation

(A5)₁₆ = 10 × 16 + 5 = 160 + 5 = 165.

Q1726DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Consider the below Code snippet: class Calculator { void calculate(int a, int b) { class Multiply { int product() { return a * b; } } Multiply multiply = new Multiply(); System.out.println("Product: " + multiply.product()); } } public class Main { public static void main(String[] args) { Calculator calculator = new Calculator(); calculator.calculate(5, 3); } } What will be the output?
  1. AProduct: 15
  2. BProduct: 0
  3. CRuntime Error.
  4. DCompilation Error: Multiply cannot be defined inside calculate.
Show answerHide answer

Correct answer: (A) Product: 15

Explanation

Java allows a local class inside a method, and it can use the method's effectively final parameters a and b. product() returns 5 × 3 = 15, so "Product: 15" is printed.

Q1727DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following code? #include <stdio.h> int main() { if (5 > 10) printf("5 is greater than 10"); else printf("5 is not greater than 10"); return 0; }
  1. ANo output
  2. BSyntax error
  3. C5 is greater than 10
  4. D5 is not greater than 10
Show answerHide answer

Correct answer: (D) 5 is not greater than 10

Explanation

5 > 10 is false, so the else branch runs and prints "5 is not greater than 10".

Q1728DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
#include <stdio.h> int main() { FILE *file = fopen("input.txt", "r"); int value; fscanf(file, "%d", &value); fseek(file, 0, SEEK_SET); fscanf(file, "%d", &value); fclose(file); printf("%d\n", value); return 0; } What will be the output of the code if input.txt contains 42?
  1. AUndefined behavior
  2. B42
  3. CEOF
  4. DIt depends on the system
Show answerHide answer

Correct answer: (B) 42

Explanation

The first fscanf reads 42. fseek(file, 0, SEEK_SET) moves back to the start, so the second fscanf reads 42 again, and 42 is printed.

Q1729DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following is a correct way to declare a char type variable x in C?
  1. Achar x;
  2. Bchar = 'x';
  3. Cch x;
  4. Dcharacter x;
Show answerHide answer

Correct answer: (A) char x;

Explanation

A C variable is declared as type followed by name, so char x; declares a char variable x. "ch" and "character" are not C types.

Q1730DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the output of the following code? #include <stdio.h> int main() { for (int i = 1; i <= 3; i++) { for (int j = 1; j <= i; j++) { printf("*"); } printf("\n"); } return 0; }
  1. A* ** ***
  2. B*** ** *
  3. C*** *** ***
  4. DCompilation Error
Show answerHide answer

Correct answer: (A) * ** ***

Explanation

The outer loop runs i = 1 to 3, and the inner loop prints i stars each time, so the rows are *, ** and ***.

Q1731DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What does the += operator do in C?
  1. AAdds the right operand to the left operand and assigns the result to the left operand.
  2. BIt is used to concatenate two strings.
  3. CIt is an invalid operator.
  4. DAssigns the value of the right operand to the left operand.
Show answerHide answer

Correct answer: (A) Adds the right operand to the left operand and assigns the result to the left operand.

Explanation

a += b is shorthand for a = a + b: the right operand is added to the left one and the result is stored in the left operand.

Q1732DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In an if-else ladder, if a condition evaluates to true, what happens to the subsequent conditions?
  1. AOnly the next condition is evaluated.
  2. BOnly the last condition of the ladder is evaluated
  3. CAll subsequent conditions are evaluated.
  4. DNone of the subsequent conditions are evaluated.
Show answerHide answer

Correct answer: (D) None of the subsequent conditions are evaluated.

Explanation

In an if-else ladder, once a condition is true its block runs and control skips the rest of the ladder, so later conditions are not checked.

Q1733DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the output of the following code? #include <stdio.h> void func(void); int main() { func(10); return 0; } void func(void) { printf("Function called\n"); }
  1. ACompilation error
  2. BCompiles successfully but no output displayed
  3. CPrints 'Function called'
  4. DPrints 'Function not called'
Show answerHide answer

Correct answer: (A) Compilation error

Explanation

func is declared as void func(void), so it takes no arguments. Calling func(10) passes an argument, which the compiler rejects as too many arguments.

Q1734DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following Java code? public class IfExample { public static void main(String[] args) { int number = 10; if (number > 5) { System.out.println("Number is greater than 5"); } } }
  1. ANumber is less than 5
  2. BCompilation error
  3. CNumber is greater than 5
  4. DNo output
Show answerHide answer

Correct answer: (C) Number is greater than 5

Explanation

number = 10, so number > 5 is true and the if block prints "Number is greater than 5".

Q1735DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In C, which of the following file opening modes allow both reading and appending data in a file?
  1. A"w+"
  2. B"a"
  3. C"r"
  4. D"a+"
Show answerHide answer

Correct answer: (D) "a+"

Explanation

Mode "a+" opens a file for reading and appending: you can read anywhere, and every write goes to the end. "a" only appends, and "w+" truncates the file first.

Q1736DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Consider the following pseudo code. exponentiate(int x, int n) { int m=n; power= 1; z= x; while(m>0) { while(m%2 ==0) { m= m/2; z= z*z ; } m=m-1; power = power*z; } return power; } What will the time complexity of function exponentiate() be?
  1. AΘ(n²)
  2. BΘ(log n)
  3. CΘ(n log n)
  4. DΘ(n)
Show answerHide answer

Correct answer: (B) Θ(log n)

Explanation

This is exponentiation by squaring: each inner step halves m, and each outer step subtracts 1 from an odd m, making it even. So m reaches 0 in about 2 log₂ n steps, giving Θ(log n).

Q1737DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following statements about the DOM (Document Object Model) in JavaScript is true regarding its interaction with HTML and JavaScript?
  1. AThe DOM only allows reading the HTML document but does not permit any changes or updates.
  2. BThe DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.
  3. CThe DOM is a static representation of the page and does not update dynamically when changes occur in the document.
  4. DThe DOM can only interact with text-based HTML documents and cannot modify styles or events.
Show answerHide answer

Correct answer: (B) The DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.

Explanation

The DOM is a live tree of the page. JavaScript can use it to add, remove or change elements, attributes, content, styles and events, and the page updates immediately.

Q1738DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following is a correct way of declaring an array of 15 integer elements in C?
  1. Aarray int[15];
  2. Barray int(15);
  3. Cint array[15];
  4. Dint array(15);
Show answerHide answer

Correct answer: (C) int array[15];

Explanation

In C an array is declared as type name[size], so int array[15]; declares 15 integers. The other forms are not valid C syntax.

Q1739DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Consider the given memory representation of the singly linked list where start points to the address of first node of the linked list, which is memory location 0. Memory representation of the singly linked list Memory location | Item value | Pointer to next element 0 | A | 4 1 | E | 2 2 | B | NULL 3 | | 4 | C | 1 If a new node whose data value is X is inserted after the node whose data value is E in any free location available in the memory, then what will the memory representation be after inserting the new node?
  1. AMemory representation of the linked list after inserting node X Memory location | Item value | Pointer to next element 0 | A | 4 1 | E | 2 2 | B | NULL 3 | X | 1 4 | C | 3
  2. BMemory representation of the linked list after inserting node X Memory location | Item value | Pointer to next element 0 | A | 4 1 | E | 3 2 | B | NULL 3 | X | 2 4 | C | 1
  3. CMemory representation of the linked list after inserting node X Memory location | Item value | Pointer to next element 0 | A | 3 1 | E | 2 2 | B | NULL 3 | X | 4 4 | C | 1
  4. DMemory representation of the linked list after inserting node X Memory location | Item value | Pointer to next element 0 | A | 4 1 | E | 2 2 | B | 3 3 | X | NULL 4 | C | 1
Show answerHide answer

Correct answer: (B) Memory representation of the linked list after inserting node X Memory location | Item value | Pointer to next element 0 | A | 4 1 | E | 3 2 | B | NULL 3 | X | 2 4 | C | 1

Explanation

The list is A(0) → C(4) → E(1) → B(2). X goes into free location 3. E's pointer changes to 3, and X points to B at 2, giving A → C → E → X → B as in option B.

Q1740DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
A measure of amount of memory required to execute an algorithm is known as:
  1. ASpace complexity of an algorithm
  2. BTime complexity of an algorithm
  3. CTime efficiency of an algorithm
  4. DAccuracy of an algorithm
Show answerHide answer

Correct answer: (A) Space complexity of an algorithm

Explanation

Space complexity measures how much memory an algorithm needs to run, as a function of input size. Time complexity measures running time.

Q1741DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What device is primarily used to capture video in multimedia applications?
  1. AMouse
  2. BWebcam
  3. CJoystick
  4. DKeyboard
Show answerHide answer

Correct answer: (B) Webcam

Explanation

A webcam is a video camera connected to a computer and is used to capture live video. A mouse, joystick and keyboard are input devices for control or text.

Q1742DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the main purpose of client-side scripting in JavaScript?
  1. ATo execute code on the server
  2. BTo store data on the server
  3. CTo run code on the user's web browser
  4. DTo interact with the database directly
Show answerHide answer

Correct answer: (C) To run code on the user's web browser

Explanation

Client-side JavaScript runs inside the user's web browser, where it handles events, checks forms and updates the page without going to the server.

Q1743DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What happens if the condition in a while loop is false at the start?
  1. AThe loop runs once and then terminates.
  2. BThe loop does not run at all.
  3. CThe loop throws an error.
  4. DThe loop runs infinitely.
Show answerHide answer

Correct answer: (B) The loop does not run at all.

Explanation

A while loop checks its condition before every pass, so if the condition is false at the start, the body never runs. A do-while loop would run once.

Q1744DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Suppose the two dimensional array is declared as int arr[2][2] = {{1,2},{3,4}}; Then which of the following will not give the output 4?
  1. A*(*arr + 1)
  2. Barr[1][1]
  3. C*(arr[1] + 1)
  4. D*(*(arr + 1) + 1)
Show answerHide answer

Correct answer: (A) *(*arr + 1)

Explanation

*arr is arr[0], so *(*arr + 1) is arr[0][1] = 2, not 4. The other three expressions all mean arr[1][1] = 4.

Q1745DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
In the switch control statement of the C program, the control falls through all the cases unless the _______ statement is given or the end of the switch block is reached.
  1. Acontinue
  2. Bbreak
  3. Cfor
  4. Dreturn
Show answerHide answer

Correct answer: (B) break

Explanation

Without break, control falls through into the following cases until a break or the end of the switch. continue applies only to loops.

Q1746DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following JavaScript code? const email = "example@domain"; const regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; console.log(regex.test(email));
  1. AError: Invalid regex
  2. Bundefined
  3. CFALSE
  4. DTRUE
Show answerHide answer

Correct answer: (C) FALSE

Explanation

The regex needs a dot and a 2-4 letter top-level domain after the @ part. "example@domain" has no ".com"-style ending, so test() returns false.

Q1747DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following is the correct way to define a function in Java?
  1. Apublic void myFunction() {}
  2. Bfunction myFunction() {}
  3. Cdef myFunction() {}
  4. DPublic myFunction() {}
Show answerHide answer

Correct answer: (A) public void myFunction() {}

Explanation

In Java a method needs a return type, as in public void myFunction() {}. "function" is JavaScript syntax, "def" is Python, and "Public" (capital P) with no return type is invalid.

Q1748DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What is the main purpose of a multimedia communication system?
  1. ATo create 3D graphics
  2. BTo store files
  3. CTo edit multimedia content
  4. DTo facilitate the transmission of audio, video, and data
Show answerHide answer

Correct answer: (D) To facilitate the transmission of audio, video, and data

Explanation

A multimedia communication system carries audio, video and data between users, as in video conferencing and streaming.

Q1749DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
What will be the output of the following C program? #include <stdio.h> int main() { int i = 1; do { printf("%d ", i); i++; } while (i <= 5); return 0; }
  1. AInfinite Loop
  2. B1 2 3 4 5 6
  3. C1 2 3 4 5
  4. D2 3 4 5 6
Show answerHide answer

Correct answer: (C) 1 2 3 4 5

Explanation

The do-while prints i and then increments it while i <= 5, so it prints 1 2 3 4 5 and stops when i becomes 6.

Q1750DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following options is INCORRECT about randomised algorithms?
  1. ARandomised algorithms that always produce the same(correct)output for the same input is known as Las Vegas Algorithms.
  2. BRandomised algorithms whose output differs from run to run for the same inputs is known as Monte Carlo Algorithms.
  3. CThe execution time of Las Vegas Algorithm does not depend on the output of the randomiser.
  4. DA randomised algorithm is an algorithm in which some of the decisions made in the algorithm depend on the output of the randomiser.
Show answerHide answer

Correct answer: (C) The execution time of Las Vegas Algorithm does not depend on the output of the randomiser.

Explanation

Statement C is incorrect: a Las Vegas algorithm always gives the correct answer, but its running time depends on the random choices. A Monte Carlo algorithm has bounded time, but its output may vary or be wrong.

How to use these DSSSB TGT / PGT Computer Science questions

Every question here was asked in a real DSSSB TGT / PGT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.

More DSSSB TGT / PGT subjects