DSSSB TGT / PGT · Topic-wise previous year questions
Computer Science Previous Year Questions (page 47)
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.
What is the main difference between a depth-first search (DFS) and a breadth-tint search (BFS) algorithm?
ABFS is used for traversing a tree, while DFS is used for traversing a graph.
BDFS is used for traversing a tree, while BFS is used for traversing a graph.
CDFS explores as far as possible along each branch before backtracking, while BFS visits all the vertices at the current depth before moving on to the next level.
DBFS explores as far as possible along each branch before backtracking, while DFS visits all the vertices at the current depth before moving on to the next level.
Show answerHide answer
Correct answer: (C) DFS explores as far as possible along each branch before backtracking, while BFS visits all the vertices at the current depth before moving on to the next level.
Explanation
DFS goes as deep as possible along one branch before backtracking (using a stack). BFS visits all vertices at the current level before the next level (using a queue).
Note: the answer key gives (C), but Einstein had nothing to do with it. The classical definition of probability (favourable cases ÷ total equally likely cases) was given by Pierre-Simon Laplace.
Which of the following is an example of a combinational circuit?
ACounter
BShift Register
CClock
DEncoder
Show answerHide answer
Correct answer: (D) Encoder
Explanation
An encoder's output depends only on its present inputs, so it is a combinational circuit. Counters and shift registers have memory, which makes them sequential.
The Principle of ______ examines the energy of a rigid body at two different states (positions), and the work done on the body to move between those two states.
AWork And Energy
BNone of the given options
CMovement
DStatic
Show answerHide answer
Correct answer: (A) Work And Energy
Explanation
The principle of work and energy states that a body's kinetic energy in state 1 plus the work done on it equals its kinetic energy in state 2 (T1 + ΣU1→2 = T2).
What is the difference between a join and a subque1Y in a database?
AA join is used to retrieve data from a single table based on a condition, while a subquery is used to combine data from multiple tables based on a common column.
BA join is used to sort data in a table, while a subquery is used to filter data in a table.
CA join is used to combine data from multiple tables based on a common column, while a subquery is used to retrieve data from a single table based on a condition.
DThere is no difference between a join and a subquery.
Show answerHide answer
Correct answer: (C) A join is used to combine data from multiple tables based on a common column, while a subquery is used to retrieve data from a single table based on a condition.
Explanation
A join combines rows from several tables on a related (common) column. A subquery is a query nested inside another query, often used to filter on a condition.
What is the difference between symmetric and asymmetric encryption?
ASymmetric encryption uses the same key for encryption and decryption, while asymmetric encryption uses different keys for encryption and decryption.
BAsymmetric encryption uses the same key for encryption and decryption, while symmetric encryption uses different keys for encryption and decryption.
CSymmetric encryption uses a single key for encryption, while asymmetric encryption uses multiple keys for encryption.
DAsymmetric encryption uses a single key for encryption, while symmetric encryption uses multiple keys for encryption.
Show answerHide answer
Correct answer: (A) Symmetric encryption uses the same key for encryption and decryption, while asymmetric encryption uses different keys for encryption and decryption.
Explanation
Symmetric encryption, such as AES, uses one shared key to both encrypt and decrypt. Asymmetric encryption, such as RSA, uses a public key and a private key.
An algorithm that always runs in polynomial time but possibly returns erroneous answers is called a/an ______.
Aapproximation algorithm
BMonte Carlo algorithm
CAtlantic City algorithm
DLas Vegas algorithm
Show answerHide answer
Correct answer: (B) Monte Carlo algorithm
Explanation
A Monte Carlo algorithm has a fixed (polynomial) running time but may give a wrong answer with small probability. A Las Vegas algorithm is always correct, but its running time varies.
If C is the coefficient of mean square contingency and 'r' and 's' are the numbers of rows and columns, respectively, then the maximum value of C is:
A
B
C
D
Show answerHide answer
Correct answer: (D)
Explanation
For an r × s table, the contingency coefficient C has a maximum of √((k − 1)/k), where k = min(r, s). With rows as the smaller dimension this is √((r − 1)/r).
Which of the following fields in the IPV4 header ensures that datagrams do NOT circulate forever (due to, for example, a long-lived routing loop) in the network?
AService time
BTime-to-live
CType of service
DHeader checksum
Show answerHide answer
Correct answer: (B) Time-to-live
Explanation
TTL is decremented at each router, and the datagram is discarded when it reaches 0. This stops packets from looping forever.
The architecture of ______ file system is based on Andrew File System.
ACODA
BNone of the given options
CFicus
DROVER
Show answerHide answer
Correct answer: (A) CODA
Explanation
Coda, developed at Carnegie Mellon, is a distributed file system descended from the Andrew File System (AFS). It adds support for disconnected operation.
In which of the following does the JDBC type represent a 'single precision' floating point number that supports seven digits of mantissa?
ADOUBLE
BREAL
CFLOAT
DINTEGER
Show answerHide answer
Correct answer: (B) REAL
Explanation
The JDBC type REAL is a single-precision floating-point number with 7 digits of mantissa (Java float). FLOAT and DOUBLE are double precision with 15 digits.
What would be the 2's complement representation of the —15 decimal value?
A1001
B1111111
C1111
D10001
Show answerHide answer
Correct answer: (C) 1111
Explanation
Note: the answer key gives (C), but 1111 is −1 in 4-bit two's complement, and −15 cannot fit in 4 bits. With 5 bits, 15 = 01111, so −15 = 10001 (option D).
What is the difference between a B-tree and a Hash index in a database?
AA B-tree index is used to sort data in a table, while a Hash index is used to filter data in a table.
BA B-tree index is used for exact match queries and sorts data using a hash function, while a Hash index is used for range queries and sorts data in a hierarchical structure.
CA B-tree index is used for range queries and sorts data in a hierarchical structure, while a Hash index is used for exact match queries and sorts data using a hash function.
DThere is no difference between a B-tree and a Hash index.
Show answerHide answer
Correct answer: (C) A B-tree index is used for range queries and sorts data in a hierarchical structure, while a Hash index is used for exact match queries and sorts data using a hash function.
Explanation
B-tree indexes keep keys in sorted, hierarchical order, so they handle range queries well. Hash indexes use a hash function, which is good for exact-match lookups but not ranges.
Which of the given options best describes the truthfulness of the following statements?
i) In the scope of business economics, demand analysis and forecasting is the process of finding values for demand in the future period.
ii) In the scope of business economics, inventory management mentions the stock of raw materials that a firm keeps. If the level of inventory is high, then it will show blockage of funds.
iii) In the scope of business economics, price is the origin of a company's profit. So, its success depends on how the pricing decisions are made.
Ai-True, ii-True, in-True
Bi-True, ii-False, in-True
Ci-False, ii-False, in-True
Di-False, ii-True, in-True
Show answerHide answer
Correct answer: (A) i-True, ii-True, in-True
Explanation
All three are correct points from the scope of business economics: demand forecasting predicts future demand, high inventory ties up funds, and pricing decisions decide profit.
AA type of memory that provides a secure storage area for data that is larger than the physical memory of a computer
BA type of memory that provides a storage area for data that is the same size as the physical memory of a computer
CA type of memory that provides a temporarily storage area for data that is larger than the physical memory of a computer
DA type of memory that provides a permanent storage area for data that is larger than the physical memory of a computer
Show answerHide answer
Correct answer: (C) A type of memory that provides a temporarily storage area for data that is larger than the physical memory of a computer
Explanation
Virtual memory uses disk space as a temporary extension of RAM. This lets programs larger than physical memory run, with pages swapped in and out as needed.
Which one of the following is NOT a prerequisite for a good MIS?
ADatabase
BControl and maintenance of MIS
CMIS executives
DSupport from staff
Show answerHide answer
Correct answer: (D) Support from staff
Explanation
Per the key, a database, MIS executives and control and maintenance of the MIS are the core prerequisites of a good MIS, while staff support is not counted as one.
While working on a JavaScript project, in your JavaScript application, which function would you use to send messages to users requesting for text input?
ADisplay()
BAlert()
CPrompt()
DGet input()
Show answerHide answer
Correct answer: (C) Prompt()
Explanation
prompt() shows a dialog box with a text field and returns what the user types. alert() only displays a message.
What is the purpose of using a CSS pre-processor in front-end development?
ATo simplify and extend the capabilities of CSS
BTo add interactivity to a web page using JavaScript
CTo add style and layout to a web page using CSS
DTo improve the performance of a web page using optimised code
Show answerHide answer
Correct answer: (A) To simplify and extend the capabilities of CSS
Explanation
A CSS pre-processor such as Sass or LESS adds variables, nesting, mixins and functions to CSS. It simplifies and extends CSS, then compiles to plain CSS.
What is the difference between a CSS grid and a CSS flexbox in front-end development?
AA CSS grid is used for desktop websites, while a CSS flexbox is used for mobile websites.
BThere is no difference between a CSS grid and a CSS flexbox.
CA CSS grid is a one-dimensional layout system for arranging elements in a single line, while a CSS flexbox is a two-dimensional layout system for arranging elements in rows and columns.
DA CSS grid is a two-dimensional layout system for arranging elements in rows and columns, while a CSS flexbox is a one-dimensional layout system for arranging elements in a single line.
Show answerHide answer
Correct answer: (D) A CSS grid is a two-dimensional layout system for arranging elements in rows and columns, while a CSS flexbox is a one-dimensional layout system for arranging elements in a single line.
Explanation
CSS Grid is a two-dimensional layout system (rows and columns). Flexbox is one-dimensional, arranging items along a single row or column.
DThe smallest individual units of C program and the basic element recognised by the compiler both
Show answerHide answer
Correct answer: (D) The smallest individual units of C program and the basic element recognised by the compiler both
Explanation
Tokens such as keywords, identifiers, constants, strings, operators and punctuators are the smallest individual units of a C program and the basic elements the compiler recognises.
ATo update the user interface of a software program
BTo fix bugs or security vulnerabilities in a software program
CTo add new features to a software program
DTo improve the performance of a software program
Show answerHide answer
Correct answer: (B) To fix bugs or security vulnerabilities in a software program
Explanation
A software patch is an update that fixes bugs or security vulnerabilities in an existing program.
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.