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.

  • 1995 questions
  • 19 topics
  • Official answer key
  • Free

Practise by topic

Q301From DSSSB TGT Computer Science Practice Set 2
What shall be the 2's complement representation of 24 in a 16 bit computer?
  1. A1111 1111 1110 1011
  2. B1111 1111 1110 1001
  3. C1111 1111 1110 0111
  4. 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:
  1. AO(lgn)
  2. BO(nlgn)
  3. CO(n²)
  4. 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?
  1. A(0+0+1)(0+0+1)
  2. B(0+0+0)(0+1+1)
  3. C(1+0+0)(1+1+1)
  4. 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
  1. A6
  2. B8
  3. C7
  4. 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.
  1. ADim
  2. BRedim
  3. CChdim
  4. 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.
  1. ASignal (M), Signal (F)
  2. BSignal (M), Wait (F)
  3. CSignal (F), Wait (M)
  4. 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?
  1. AIn asymmetric multiprocessing, the processors are peers.
  2. BIn symmetric multiprocessing, the processors are placed symmetrically on the mother board.
  3. CClustered systems are used for high performance computing.
  4. 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)?
  1. A240
  2. B250
  3. C275
  4. 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?
  1. ARelational model
  2. BHierarchical model
  3. CE-R model
  4. 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
  1. AResult in a deadlock situation
  2. BImmediately be granted
  3. CImmediately be rejected
  4. 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
  1. AData and data relationship
  2. BData semantics and consistency constraints
  3. CData, data relationship, data semantics and consistency constraints
  4. 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
  1. ACommutative and associative
  2. BNon-commutative and associative
  3. CCommutative and non-associative
  4. 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
  1. A4
  2. B24
  3. C25
  4. 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)}
  1. A{4, 9, −3}
  2. B{8}
  3. C{(4, 8), (9, 2), (−3, −4)}
  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.
  1. AB and E
  2. BC and D
  3. CA and E
  4. 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.
  1. AMalware
  2. BSpyware
  3. CAdware
  4. 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?
  1. A/*A+BCD
  2. BA+B/CD
  3. C+*AB/CD
  4. 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
  1. Alog_(p/2) (n+1)/2
  2. Blog_p n
  3. Clog_(p/2) (n+1)
  4. 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
  1. A6, 1
  2. B5, 7
  3. C3, 2
  4. 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?
  1. A3
  2. B4
  3. C5
  4. 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 ?
  1. AOptical fiber cable
  2. BShielded twisted pair cable
  3. CUnshielded twisted pair cable
  4. 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 ______.
  1. APage replacement
  2. BSegmentation
  3. CFragmentation
  4. 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?
  1. AIt computes the GCD of two numbers.
  2. BIt computes the LCM of two numbers.
  3. CIt finds the smallest of two numbers.
  4. 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 :
  1. AA'B + BC
  2. BAB'
  3. CAB + BC
  4. 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 ?
  1. ACMP
  2. BMOV
  3. CJMP
  4. 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.
  1. ACMOS
  2. BTTL
  3. CMOS
  4. 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:
  1. AString
  2. BQueue
  3. CStack
  4. 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?
  1. A5
  2. B2
  3. C3
  4. 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?
  1. Aprompt ()
  2. Balert ()
  3. Cconfirm ()
  4. 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 :
  1. A</xml version = '1.0'/>
  2. B<?xml version = "1.0"/>
  3. C<*xml version = '1.0'/>
  4. 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.
  1. Aand
  2. Bin
  3. C<=
  4. 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?
  1. A1st Name
  2. BName1
  3. CName_1
  4. 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?
  1. Adef Compu (X = 100, Y = 10, Z):
  2. Bdef Compu (X, Y, Z = 1):
  3. Cdef Compu (X=100, Y =10, Z=1):
  4. Ddef Compu (X, Y = 10, Z = 1):
Show answerHide answer

Correct answer: (A) def Compu (X = 100, Y = 10, Z):

Explanation

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?
  1. AWriter
  2. BWriterow
  3. CWrite
  4. 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.
  1. A180
  2. B120
  3. C100
  4. 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.
  1. Apl.bar ([5, 2, 3, 1])
  2. Bpl.scatter ([5, 2, 3, 1])
  3. Cpl.plot ([5, 2, 3, 1])
  4. 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.
  1. ADegree
  2. BDomain
  3. CCardinality
  4. 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?
  1. AObserve everything without asking questions about it.
  2. BNote down their doubts and ask the questions after reaching back.
  3. CObserve keenly, make note and share observations with other fellow students and teacher.
  4. 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:
  1. AProvide detailed explanations
  2. BDraw pictures on the board and givn descriptions
  3. CMake students plant seeds and observe germination
  4. 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.
  1. AOnMouseOver and OnMouseExit
  2. BOnMouseOver and OnMouseOut
  3. COnMouseIn and OnMouseOut
  4. 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 ?
  1. Aopen( )
  2. Bclose( )
  3. Cname( )
  4. 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 ______.
  1. AOne
  2. BTwo
  3. CThree
  4. 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 ?
  1. AWhile (P == NULL || P → Element ! = X) P = P → Next ;
  2. BWhile (P == NULL && P → Element ! = X) P = P → Next ;
  3. CWhile (P ! = NULL || P → Element ! = X) P = P → Next ;
  4. 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.
  1. A(A+B) . (C+D)
  2. B(A . B)' + (C . D)'
  3. CA . B + C . D
  4. 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:
  1. Aa
  2. Bb
  3. Ca . b
  4. 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.
  1. ACAT6 CABLE
  2. BCOAXIAL CABLE
  3. CTWO PAIR TELEPHONE CABLE
  4. 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 ?
  1. AGeneral System for Mobile Communication
  2. BGlobal Synchronization for Mobile Communication
  3. CGlobal System for Mobile Communication
  4. 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:
  1. ACalculate depreciation
  2. BFind the profit of the business
  3. CCheck the arithmetical accuracy of ledger accounts
  4. 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?
  1. ACash Book
  2. BPurchase Book
  3. CSales Book
  4. 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?
  1. AAssimilation
  2. BAccommodation
  3. COperation
  4. 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.

More DSSSB TGT / PGT subjects