DSSSB TGT / PGT · Topic-wise previous year questions
Computer Science Previous Year Questions (page 7)
1995 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.
Q301From DSSSB TGT Computer Science Practice Set 2
What shall be the 2's complement representation of 24 in a 16 bit computer?
A1111 1111 1110 1011
B1111 1111 1110 1001
C1111 1111 1110 0111
D1111 1111 1110 1000
Show answerHide answer
Correct answer: (D) 1111 1111 1110 1000
Explanation
24 = 0000 0000 0001 1000. Invert the bits (1111 1111 1110 0111) and add 1 to get 1111 1111 1110 1000, which is −24 in 2's complement.
Q302From DSSSB TGT Computer Science Practice Set 2
The worst case complexity for searching an element in binary search tree is:
AO(lgn)
BO(nlgn)
CO(n²)
DO(n)
Show answerHide answer
Correct answer: (D) O(n)
Explanation
A skewed (degenerate) BST is like a linked list, so a search may have to visit all n nodes: O(n) in the worst case.
Q303From DSSSB TGT Computer Science Practice Set 2
Which of the following expression results in zero?
A(0+0+1)(0+0+1)
B(0+0+0)(0+1+1)
C(1+0+0)(1+1+1)
D(0+1+0)(1+0+1)
Show answerHide answer
Correct answer: (B) (0+0+0)(0+1+1)
Explanation
In Boolean algebra, + is OR and · is AND. (0+0+0) = 0, so 0 · (0+1+1) = 0. Every other option has both factors equal to 1.
Q304From DSSSB TGT Computer Science Practice Set 2
How many page faults occur in LRU page replacement algorithm for the given reference string, with four page frames.
7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1
A6
B8
C7
D9
Show answerHide answer
Correct answer: (C) 7
Explanation
With LRU and 4 frames: 7, 0, 1, 2 are 4 faults; 3 replaces 7; 4 replaces 1; then 1 replaces 4. All other references are hits, so there are 7 page faults.
Q305From DSSSB TGT Computer Science Practice Set 2
In VB, to change the size of a dynamic array, ______ is used at the point in the code where you want it to change.
ADim
BRedim
CChdim
DBydim
Show answerHide answer
Correct answer: (B) Redim
Explanation
ReDim resizes a dynamic array in VB (ReDim Preserve also keeps its existing contents). Dim only declares the array.
Q306From DSSSB TGT Computer Science Practice Set 2
The producer and Consumer processes share the following Variables:
int n,
Semaphore M = 1
Semaphore E = n
Semaphore F = 0
The consumer process must execute ______ and ______ before removing an item from buffer.
ASignal (M), Signal (F)
BSignal (M), Wait (F)
CSignal (F), Wait (M)
DWait (F), Wait (M)
Show answerHide answer
Correct answer: (D) Wait (F), Wait (M)
Explanation
A consumer first does wait(F) to make sure a full slot exists, then wait(M) for mutual exclusion on the buffer, and only then removes the item.
Q307From DSSSB TGT Computer Science Practice Set 2
Which of the following is correct?
AIn asymmetric multiprocessing, the processors are peers.
BIn symmetric multiprocessing, the processors are placed symmetrically on the mother board.
CClustered systems are used for high performance computing.
DAll multiprocessor systems are multicore systems.
Show answerHide answer
Correct answer: (C) Clustered systems are used for high performance computing.
Explanation
Clustered systems join several computers to provide high availability and high-performance computing. In asymmetric multiprocessing the processors are not peers, and multiprocessor does not always mean multicore.
Q308From DSSSB TGT Computer Science Practice Set 2
How many characters per second (7 bits + 1 parity) can be transmitted over a 2400 bps line if the transfer is asynchronous (1 start and 1 stop bit)?
A240
B250
C275
D300
Show answerHide answer
Correct answer: (A) 240
Explanation
Each character takes 1 start + 7 data + 1 parity + 1 stop = 10 bits, so 2400 / 10 = 240 characters per second.
Q309From DSSSB TGT Computer Science Practice Set 2
Which of the following is not a record-based data model?
ARelational model
BHierarchical model
CE-R model
DNetwork model
Show answerHide answer
Correct answer: (C) E-R model
Explanation
The relational, hierarchical and network models are record-based logical models. The E-R model is an object-based conceptual model.
Q310From DSSSB TGT Computer Science Practice Set 2
If transaction A holds a shared lock R and if transaction B also requests for a shared lock on R, it will
AResult in a deadlock situation
BImmediately be granted
CImmediately be rejected
DBe granted as soon as it is released by A
Show answerHide answer
Correct answer: (B) Immediately be granted
Explanation
Shared (read) locks are compatible with each other, so B's shared-lock request on R is granted immediately.
Q311From DSSSB TGT Computer Science Practice Set 2
A data model is a collection of conceptual tools for describing
AData and data relationship
BData semantics and consistency constraints
CData, data relationship, data semantics and consistency constraints
DNone of the above
Show answerHide answer
Correct answer: (C) Data, data relationship, data semantics and consistency constraints
Explanation
A data model is a collection of conceptual tools for describing data, data relationships, data semantics and consistency constraints (Korth).
Q312From DSSSB TGT Computer Science Practice Set 2
The difference (−) operation removes common tuples from the first relation. This operation is
ACommutative and associative
BNon-commutative and associative
CCommutative and non-associative
DNon-commutative and non-associative
Show answerHide answer
Correct answer: (D) Non-commutative and non-associative
Explanation
Corrected: the book's key says (b). Set difference is neither commutative (R − S ≠ S − R) nor associative.
Q313From DSSSB TGT Computer Science Practice Set 2
The number of equivalence relations of the set {1, 2, 3, 4} is
A4
B24
C25
D15
Show answerHide answer
Correct answer: (D) 15
Explanation
The number of equivalence relations on a 4-element set equals the number of its partitions, which is the Bell number B₄ = 15.
Q314From DSSSB TGT Computer Science Practice Set 2
What is the range of the following function?
{(4, 8), (9, 2), (−3, −4)}
A{4, 9, −3}
B{8}
C{(4, 8), (9, 2), (−3, −4)}
D{8, 2, −4}
Show answerHide answer
Correct answer: (D) {8, 2, −4}
Explanation
The range is the set of second elements (outputs) of the ordered pairs: {8, 2, −4}.
Q315From DSSSB TGT Computer Science Practice Set 2
In the given graph identify the cut vertices :
Graph: vertices A, B, C, D, E; edges A-B, A-D, D-B, B-C, C-E.
AB and E
BC and D
CA and E
DC and B
Show answerHide answer
Correct answer: (D) C and B
Explanation
Removing B separates {A, D} from {C, E}, and removing C cuts off E. Removing A, D or E leaves the graph connected, so the cut vertices are B and C.
Q316From DSSSB TGT Computer Science Practice Set 2
______ monitors user's activity on Internet and transmits that information in the backgroud to someone else.
AMalware
BSpyware
CAdware
DNone of the above
Show answerHide answer
Correct answer: (B) Spyware
Explanation
Spyware secretly monitors a user's activity, such as browsing and keystrokes, and sends that information to a third party in the background. Adware mainly shows unwanted advertisements.
Q317From DSSSB TGT Computer Science Practice Set 2
Which one of the following is prefix representation of the infix expression A*(B+C)/D?
A/*A+BCD
BA+B/CD
C+*AB/CD
DNone of the above
Show answerHide answer
Correct answer: (A) /*A+BCD
Explanation
A*(B+C)/D is evaluated as (A*(B+C))/D. In prefix form this is / * A + B C D.
Q318From DSSSB TGT Computer Science Practice Set 2
A B-Tree is of order p and consists of n keys. Its maximum height is
Alog_(p/2) (n+1)/2
Blog_p n
Clog_(p/2) (n+1)
DNone of the above
Show answerHide answer
Correct answer: (A) log_(p/2) (n+1)/2
Explanation
In a B-tree of order p, every non-root node has at least ⌈p/2⌉ children. So the maximum height is log base ⌈p/2⌉ of (n+1)/2.
Q319From DSSSB TGT Computer Science Practice Set 2
The following postfix expression with single-digit operands is evaluated using a stack:
823^/23*+51*-
(Note that ^ is the exponentiation operator.) The top two elements of the stack after the first * is evaluated, are
A6, 1
B5, 7
C3, 2
D1, 5
Show answerHide answer
Correct answer: (A) 6, 1
Explanation
8 2 3 ^ gives 2³ = 8, then 8 / 8 = 1. Next 2 and 3 are pushed and * gives 6. The stack now holds 1, 6, so the top two elements are 6 and 1.
Q320From DSSSB TGT Computer Science Practice Set 2
A hash function defined as f(key) = key mod 7 with linear probing is used to insert the keys 37, 38, 72, 48, 98, 11, 56 into a table indexed from 0 to 6. What will be the location of 11?
A3
B4
C5
D6
Show answerHide answer
Correct answer: (C) 5
Explanation
37→2, 38→3, 72→2 (taken, goes to 3, then 4), 48→6, 98→0. 11 mod 7 = 4 is taken, so linear probing places 11 at slot 5.
Q321From DSSSB TGT Computer Science Practice Set 2
Which of the following transmission media works on the principle of total internal reflection ?
AOptical fiber cable
BShielded twisted pair cable
CUnshielded twisted pair cable
DCoaxial cable
Show answerHide answer
Correct answer: (A) Optical fiber cable
Explanation
In optical fibre, light stays inside the glass core by total internal reflection at the core-cladding boundary.
Q322From DSSSB TGT Computer Science Practice Set 2
The mechanism that brings a page into memory only when it is needed is called ______.
APage replacement
BSegmentation
CFragmentation
DDemand paging
Show answerHide answer
Correct answer: (D) Demand paging
Explanation
Demand paging loads a page into memory only when it is referenced, which triggers a page fault.
Q323From DSSSB TGT Computer Science Practice Set 2
Assume X and Y are non-zero positive integers. Consider the following pseudo-code fragment:
while X<>Y do
if X>Y then
X ← X−Y
else
Y ← Y−X
endif
end while
print (X)
What is the code doing?
AIt computes the GCD of two numbers.
BIt computes the LCM of two numbers.
CIt finds the smallest of two numbers.
DIt divides the largest number by the smaller.
Show answerHide answer
Correct answer: (A) It computes the GCD of two numbers.
Explanation
This is the subtraction form of Euclid's algorithm: repeatedly subtracting the smaller number from the larger one until both are equal leaves their GCD.
Q324From DSSSB TGT Computer Science Practice Set 2
The Boolean expression
(A + C) (AB' + AC) ((AC)' + B')
can be simplified as :
AA'B + BC
BAB'
CAB + BC
DAB + A'C
Show answerHide answer
Correct answer: (B) AB'
Explanation
(A+C)(AB'+AC) = AB' + AC by absorption. Multiplying by (A' + B' + C') gives AB' + AB'C = AB'.
Q325From DSSSB TGT Computer Science Practice Set 2
Which of the following is not a program control instruction ?
ACMP
BMOV
CJMP
DCALL
Show answerHide answer
Correct answer: (B) MOV
Explanation
MOV is a data transfer instruction. JMP and CALL change the flow of control, and CMP is used with jumps to make decisions, so these are program control instructions.
Q326From DSSSB TGT Computer Science Practice Set 2
Based on the current technology, ______ is the fastest logic family.
ACMOS
BTTL
CMOS
DECL
Show answerHide answer
Correct answer: (D) ECL
Explanation
Emitter-Coupled Logic (ECL) is the fastest logic family, because its transistors never saturate, but it uses a lot of power.
Q327From DSSSB TGT Computer Science Practice Set 2
Recursive procedures is implement using:
AString
BQueue
CStack
DLinked List
Show answerHide answer
Correct answer: (C) Stack
Explanation
Each recursive call pushes its return address and local variables onto a stack, so recursion is implemented with a stack.
Q328From DSSSB TGT Computer Science Practice Set 2
For a tree with just one node, the root node is the height of a binary tree is defined to zero; if there are 2 levels of nodes, the height is 1 and so on.
A Binary Search Tree is built according to the usual rules with the following six key inserted one at a time as given :
B, I, N, A, R, Y. What is the height of the tree?
A5
B2
C3
D4
Show answerHide answer
Correct answer: (D) 4
Explanation
Inserting B, I, N, A, R, Y gives root B with A on the left and the chain I → N → R → Y to the right. The longest path B-I-N-R-Y has 4 edges, so the height is 4.
Q329From DSSSB TGT Computer Science Practice Set 2
Which of the following methods in Java Script will display a window having a dialog box with a specified message, along with an OK and CANCEL button as options?
Aprompt ()
Balert ()
Cconfirm ()
Drequest ()
Show answerHide answer
Correct answer: (C) confirm ()
Explanation
confirm() shows a dialog with a message and OK and Cancel buttons and returns true or false. alert() has only OK, and prompt() also asks for text input.
Q330From DSSSB TGT Computer Science Practice Set 2
To declare the version of XML. the correct syntax is :
A</xml version = '1.0'/>
B<?xml version = "1.0"/>
C<*xml version = '1.0'/>
D<?xml version = 1.0"/>
Show answerHide answer
Correct answer: (B) <?xml version = "1.0"/>
Explanation
The XML declaration is a processing instruction: <?xml version="1.0"?>. It begins with <?xml and the version value is quoted. Option B is the closest to this form.
Q331From DSSSB TGT Computer Science Practice Set 2
Identify the Logical Operator used in Python out of the following.
Aand
Bin
C<=
D+=
Show answerHide answer
Correct answer: (A) and
Explanation
and is a logical operator in Python (as are or and not). in is a membership operator, <= is relational and += is assignment.
Q332From DSSSB TGT Computer Science Practice Set 2
Which of the following cannot be used as a valid identifier in Python?
A1st Name
BName1
CName_1
DFirstName
Show answerHide answer
Correct answer: (A) 1st Name
Explanation
Python identifiers cannot start with a digit or contain spaces, so "1st Name" is invalid.
Q333From DSSSB TGT Computer Science Practice Set 2
Which of the following Function Headers in a Python code will result in error?
A parameter without a default value cannot follow parameters that have default values. def Compu(X=100, Y=10, Z): raises a SyntaxError.
Q334From DSSSB TGT Computer Science Practice Set 2
Which method out of the following is used to write a line of content in a CSV file in a Phython program?
AWriter
BWriterow
CWrite
DWriteline
Show answerHide answer
Correct answer: (B) Writerow
Explanation
The csv writer object's writerow() method writes one row (line) to a CSV file. writerows() writes several rows.
Q335From DSSSB TGT Computer Science Practice Set 2
Observe the following flowchart and find the output.
Flowchart: START → A = 100, S = 0 → decision "IS A >= 20 ?": if YES → S += A → A −= 40 → back to the decision; otherwise → OUTPUT S → STOP.
A180
B120
C100
D160
Show answerHide answer
Correct answer: (A) 180
Explanation
A=100: S=100, A=60. A=60: S=160, A=20. A=20 (still ≥ 20): S=180, A=−20. The condition is now false, so the output is 180.
Q336From DSSSB TGT Computer Science Practice Set 2
Observe the following graph and find the missing statement in the Python code.
import matplotlib.pyplot as pl
______
pl. show()
Graph: a single line joining the points (0.0, 5), (1.0, 2), (2.0, 3), (3.0, 1); x-axis 0.0 to 3.0, y-axis 1.0 to 5.0.
Apl.bar ([5, 2, 3, 1])
Bpl.scatter ([5, 2, 3, 1])
Cpl.plot ([5, 2, 3, 1])
Dpl.line ([5, 2, 3, 1])
Show answerHide answer
Correct answer: (C) pl.plot ([5, 2, 3, 1])
Explanation
pl.plot([5, 2, 3, 1]) draws a line graph, using the indexes 0-3 as x values. bar and scatter give different charts, and pl.line does not exist.
Q337From DSSSB TGT Computer Science Practice Set 2
The number of attributes in a relation is called the ______ of the relation.
ADegree
BDomain
CCardinality
DTuyples
Show answerHide answer
Correct answer: (A) Degree
Explanation
The degree of a relation is its number of attributes (columns). Cardinality is the number of tuples (rows).
Q338From DSSSB TGT Computer Science Practice Set 2
A school organizes an educational trip for middle school students to the Jim Corbett National Park. What would be the teachers' advisory to the children during the visit?
AObserve everything without asking questions about it.
BNote down their doubts and ask the questions after reaching back.
CObserve keenly, make note and share observations with other fellow students and teacher.
DEnjoy the trip along with fellow students.
Show answerHide answer
Correct answer: (C) Observe keenly, make note and share observations with other fellow students and teacher.
Explanation
Observing keenly, making notes and sharing observations encourages active, inquiry-based and collaborative learning.
Q339From DSSSB TGT Computer Science Practice Set 2
The best method to teach the concept of the 'germination of a seed' is to:
AProvide detailed explanations
BDraw pictures on the board and givn descriptions
CMake students plant seeds and observe germination
DShow pictures of seed growth
Show answerHide answer
Correct answer: (C) Make students plant seeds and observe germination
Explanation
Learning by doing (planting seeds and watching them germinate) gives direct experience, which is the most effective way to teach this concept.
Q340From DSSSB TGT Computer Science Practice Set 2
Rasleen is adding links to her company website. She wants to change the link colour as soon as the visitor's mouse hoven over the link and wants it should retain the original colour when visitor's mouse moves to any other location away from the link. Which of the following two event handless will be required to write a JavaScript code to achieve the same.
AOnMouseOver and OnMouseExit
BOnMouseOver and OnMouseOut
COnMouseIn and OnMouseOut
DOnMouseIn and OnMouseExit
Show answerHide answer
Correct answer: (B) OnMouseOver and OnMouseOut
Explanation
onmouseover fires when the pointer enters the link, and onmouseout fires when it leaves. There are no OnMouseIn or OnMouseExit events.
Q341From DSSSB TGT Computer Science Practice Set 2
Which of the following is not a method of the window object in JavaScript ?
Aopen( )
Bclose( )
Cname( )
Dprompt( )
Show answerHide answer
Correct answer: (C) name( )
Explanation
open(), close() and prompt() are methods of the window object. name is a property (window.name), not a method.
Q342From DSSSB TGT Computer Science Practice Set 2
The number of pointer changes required for inserting a node between two given nodes in the linked implementation of a doubly linked list is ______.
AOne
BTwo
CThree
DFour
Show answerHide answer
Correct answer: (D) Four
Explanation
The new node's next and prev pointers are set, and the next pointer of the previous node and the prev pointer of the following node are updated. That makes 4 pointer changes.
Q343From DSSSB TGT Computer Science Practice Set 2
Which of the following options is the correct code for traversing a link list staring at pointer P, upto element X ?
AWhile (P == NULL || P → Element ! = X)
P = P → Next ;
BWhile (P == NULL && P → Element ! = X)
P = P → Next ;
CWhile (P ! = NULL || P → Element ! = X)
P = P → Next ;
DWhile (P ! = NULL && P → Element ! = X)
P = P → Next ;
Show answerHide answer
Correct answer: (D) While (P ! = NULL && P → Element ! = X)
P = P → Next ;
Explanation
The loop must stop at the end of the list or when X is found, so it continues only while P != NULL && P→Element != X. Checking for NULL first also avoids dereferencing a null pointer.
Q344From DSSSB TGT Computer Science Practice Set 2
Which of the following Boolean expression correctly represents the logic circuit diagram ?
Circuit: A and B feed a NOR gate; C and D feed a second NOR gate; the outputs of both NOR gates feed an AND gate, whose output is the circuit output.
A(A+B) . (C+D)
B(A . B)' + (C . D)'
CA . B + C . D
D(A+B)' . (C+D)'
Show answerHide answer
Correct answer: (D) (A+B)' . (C+D)'
Explanation
The NOR gates give (A+B)' and (C+D)', and the AND gate combines them, so the output is (A+B)' · (C+D)'.
Q345From DSSSB TGT Computer Science Practice Set 2
In Boolean Algebra, the expression a + a . b is equivalent to:
Aa
Bb
Ca . b
Da + b
Show answerHide answer
Correct answer: (A) a
Explanation
By the absorption law, a + a·b = a(1 + b) = a·1 = a.
Q346From DSSSB TGT Computer Science Practice Set 2
Ms. Rabda is a CEO of a multinational company and she is planning to connect 3 offices of nearby cities with the help of wired media. Out of the following which wired media you would suggest for the same.
ACAT6 CABLE
BCOAXIAL CABLE
CTWO PAIR TELEPHONE CABLE
DOPTIC FIBER CABLE
Show answerHide answer
Correct answer: (D) OPTIC FIBER CABLE
Explanation
Optical fibre gives high bandwidth over long distances with little loss and no electromagnetic interference, so it is best for linking offices in different cities.
Q347From DSSSB TGT Computer Science Practice Set 2
What is the full form for GSM ?
AGeneral System for Mobile Communication
BGlobal Synchronization for Mobile Communication
CGlobal System for Mobile Communication
DGlobal System for Mobile Community
Show answerHide answer
Correct answer: (C) Global System for Mobile Communication
Explanation
GSM stands for Global System for Mobile Communication, the 2G digital cellular standard.
Q348From DSSSB TGT Computer Science Practice Set 2
A Trial Balance is prepared mainly to:
ACalculate depreciation
BFind the profit of the business
CCheck the arithmetical accuracy of ledger accounts
DPrepare invoices
Show answerHide answer
Correct answer: (C) Check the arithmetical accuracy of ledger accounts
Explanation
A Trial Balance lists all ledger balances to check that total debits equal total credits, which tests the arithmetical accuracy of the ledger accounts.
Q349From DSSSB TGT Computer Science Practice Set 2
Which book is maintained to record only credit sales of goods?
ACash Book
BPurchase Book
CSales Book
DJournal Proper
Show answerHide answer
Correct answer: (C) Sales Book
Explanation
The Sales Book (Sales Journal) records only credit sales of goods. Cash sales go to the Cash Book.
Q350From DSSSB TGT Computer Science Practice Set 2
A child has a schema for a dog based on his experience with his pet, then when he sees another dog in the garden, he is able to recognize the animal. Which process of cognitive development is highlighted in the statement?
AAssimilation
BAccommodation
COperation
DEquilibrium
Show answerHide answer
Correct answer: (A) Assimilation
Explanation
Fitting a new experience (another dog) into an existing schema is assimilation in Piaget's theory. Accommodation means changing the schema itself.
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.