DSSSB TGT / PGT · Topic-wise previous year questions

Computer Science Previous Year Questions (page 9)

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

Q401From DSSSB TGT Computer Science Practice Set 1
______ memory is intended to give memory speed approaching that of the fastest memories available, and at the same time provide a large memory size at the price of less expensive types of semiconductor memories.
  1. ARegister
  2. BCounter
  3. CFlip flop
  4. DCache
Show answerHide answer

Correct answer: (D) Cache

Explanation

Cache is a small, fast memory between the CPU and main memory. It gives near-register speed for frequently used data, while the large cheaper main memory provides the size.

Q402From DSSSB TGT Computer Science Practice Set 1
The maximum number of comparisons for a particular record among 32 sorted records through Binary Search method will be :
  1. A2
  2. B16
  3. C8
  4. D5
Show answerHide answer

Correct answer: (D) 5

Explanation

Binary search halves the list at each step, and 32 = 2⁵, so it takes about log₂32 = 5 comparisons. Strictly, the worst case is ⌊log₂32⌋ + 1 = 6, but 6 is not an option, so the intended answer is 5.

Q403From DSSSB TGT Computer Science Practice Set 1
What is the octal equivalent of the hexadecimal number 132A?
  1. A46252
  2. B11450
  3. C11452
  4. D46250
Show answerHide answer

Correct answer: (C) 11452

Explanation

132A in hex = 0001 0011 0010 1010 in binary. Regrouping in 3s from the right gives 1 001 100 101 010 = 11452 in octal.

Q404From DSSSB TGT Computer Science Practice Set 1
The complexity of linear search algorithm is :
  1. AO (n log n)
  2. BO (n)
  3. CO (log n)
  4. DO (n*n)
Show answerHide answer

Correct answer: (B) O (n)

Explanation

Linear search may have to check every one of the n elements in the worst case, so it takes O(n) time.

Q405From DSSSB TGT Computer Science Practice Set 1
In relational databases, the natural join of two tables is :
  1. ACartesian Product always.
  2. BCombination of Union and filtered Cartesian Product.
  3. CCombination of Selection and filtered Cartesian Product.
  4. DCombination of Projection and filtered Cartesian Product.
Show answerHide answer

Correct answer: (D) Combination of Projection and filtered Cartesian Product.

Explanation

A natural join takes the Cartesian product, keeps the rows where common attributes are equal (selection), then projects away the duplicate columns. So it is a projection of a filtered Cartesian product.

Q406From DSSSB TGT Computer Science Practice Set 1
Which of the following techniques allows execution of programs larger than the size of physical memory ?
  1. AThrashing
  2. BDMA
  3. CBuffering
  4. DDemand paging
Show answerHide answer

Correct answer: (D) Demand paging

Explanation

Demand paging (virtual memory) loads pages only when they are needed, so a program larger than physical memory can still run. Thrashing is a performance problem, not a technique.

Q407From DSSSB TGT Computer Science Practice Set 1
For the following binary tree inorder traversal yields the expression : Binary tree: root is '−'; its left child is '+' and its right child is '/'. '+' has left child 'a' and right child '*'; '*' has children 'b' (left) and 'd' (right). '/' has children 'e' (left) and 'f' (right).
  1. A− + * / abdef
  2. Ba + bd * − ef /
  3. Cabdef* / + −
  4. Da + b * d − e/f
Show answerHide answer

Correct answer: (D) a + b * d − e/f

Explanation

Inorder traversal visits left subtree, root, then right subtree. Left subtree gives a + b * d, then the root −, then the right subtree e / f, giving a + b * d − e/f.

Q408From DSSSB TGT Computer Science Practice Set 1
In structured programming, a program is decomposed into modules. Coupling and cohesion describe the characteristics of modules. A good decomposition should attempt to :
  1. AMinimize coupling and minimize cohesion.
  2. BMaximize coupling and minimize cohesion.
  3. CMinimize coupling and maximize cohesion.
  4. DMaximize coupling and maximize cohesion.
Show answerHide answer

Correct answer: (C) Minimize coupling and maximize cohesion.

Explanation

Good modular design aims for low coupling (little dependence between modules) and high cohesion (each module focuses on one task).

Q409From DSSSB TGT Computer Science Practice Set 1
Consider the database table "Persons" having persons_ID as the primary key: person_ID | Name | Age 1000 | Rajan | 40 - | Jatin | -45 1001 | Rajesh | 35 What are the constraints violated by the above table ?
  1. ARelationship integrity
  2. BReferential integrity only
  3. CEntity and domain integrities
  4. DReferential and domain integrities
Show answerHide answer

Correct answer: (C) Entity and domain integrities

Explanation

A missing person_ID breaks entity integrity, because a primary key cannot be null. An age of −45 is outside the valid domain, so domain integrity is also broken.

Q410From DSSSB TGT Computer Science Practice Set 1
Assume the C++ definition : class circle : public point Which of the following is false?
  1. A'Point' is the base class and 'circle' is the derived class.
  2. BThe colon (:) in the header of class definition indicates inheritance.
  3. CThe keyword 'public' indicates type of inheritance.
  4. DAll the public and protected members of class 'circle' are inherited as public and protected members, respectively, into class 'point'.
Show answerHide answer

Correct answer: (D) All the public and protected members of class 'circle' are inherited as public and protected members, respectively, into class 'point'.

Explanation

Inheritance flows from the base class to the derived class. The public and protected members of point are inherited into circle, not the other way round, so statement D is false.

Q411From DSSSB TGT Computer Science Practice Set 1
Which of the following Java statements declare and allocate a 2-dimensional array of integers with four rows and five columns.
  1. Aint array [][] = new int [5][4];
  2. Bint array [4][5];
  3. Cint array [5][4];
  4. Dint array [][] = new int [4][5];
Show answerHide answer

Correct answer: (D) int array [][] = new int [4][5];

Explanation

In Java, new int[4][5] creates 4 rows and 5 columns. Declarations like int array[4][5] are not valid Java, and [5][4] has the dimensions reversed.

Q412From DSSSB TGT Computer Science Practice Set 1
Which of the following data structures is most suitable for evaluating postfix expressions?
  1. ATree
  2. BStack
  3. CLinked list
  4. DQueue
Show answerHide answer

Correct answer: (B) Stack

Explanation

Operands are pushed onto a stack. When an operator is read, the top two operands are popped, the operator is applied and the result is pushed back, so a stack is the natural structure for postfix evaluation.

Q413From DSSSB TGT Computer Science Practice Set 1
The major goal of object – oriented programming is :
  1. ATop-down program development
  2. BSpeed
  3. CUser – interface
  4. DReuse
Show answerHide answer

Correct answer: (D) Reuse

Explanation

The main goal of OOP is reusability: classes, inheritance and polymorphism let existing code be reused and extended.

Q414From DSSSB TGT Computer Science Practice Set 1
In a computer system, memory mapped access takes 100 nanoseconds when a page is found in TLB. In case the page is not TLB, it takes 400 nanoseconds to access. Assuming a hit ratio of 80%, the effective access time is:
  1. A120 nanoseconds
  2. B160 nanoseconds
  3. C200 nanoseconds
  4. D500 nanoseconds
Show answerHide answer

Correct answer: (B) 160 nanoseconds

Explanation

EAT = 0.8 × 100 + 0.2 × 400 = 80 + 80 = 160 ns.

Q415From DSSSB TGT Computer Science Practice Set 1
Consider the following code segment: int x = 22, y = 15; x = (x>y) ? (x+y) : (x−y); What will be the value of x after the code is executed?
  1. A22
  2. B37
  3. C7
  4. D37 and 7
Show answerHide answer

Correct answer: (B) 37

Explanation

Since 22 > 15 is true, the conditional operator picks x + y = 22 + 15 = 37, which is assigned to x.

Q416From DSSSB TGT Computer Science Practice Set 1
Consider the following code segment in C++. How many times the for loop will be repeated? int main ( ) { int f = 1; for (; f ;) cout <<"f = " <<f++<<"\n"; return 0; }
  1. A10 times
  2. BNot even once
  3. CRepeated forever
  4. DOnly once
Show answerHide answer

Correct answer: (C) Repeated forever

Explanation

for(; f ;) has no update expression of its own, and f starts at 1 and is incremented each time by f++. f never becomes 0 in normal counting, so the condition stays true and the loop runs forever.

Q417From DSSSB TGT Computer Science Practice Set 1
While making bulleted lists, which of the following options are available?
  1. ASquare, disc, triangle
  2. BTriangle, disc, circle
  3. CTriangle, square, circle
  4. DDisc, square, circle
Show answerHide answer

Correct answer: (D) Disc, square, circle

Explanation

Unordered list bullets in HTML (the type attribute) can be disc, square or circle. Triangle is not a standard bullet type.

Q418From DSSSB TGT Computer Science Practice Set 1
Machine that places the request to access the data, is generally called as ______.
  1. AServer machine
  2. BClient machine
  3. CRequest machine
  4. DIntelligent machine
Show answerHide answer

Correct answer: (B) Client machine

Explanation

In the client-server model, the client sends a request for data or a service, and the server processes the request and returns the result.

Q419From DSSSB TGT Computer Science Practice Set 1
In which case it is mandatory to provide a destructor in a class?
  1. AAlmost in every class
  2. BClass for which two or more than two objects will be created.
  3. CClass for which copy constructor is defined.
  4. DClass whose objects will be created dynamically.
Show answerHide answer

Correct answer: (D) Class whose objects will be created dynamically.

Explanation

A class whose objects are created dynamically, or that allocates memory with new, needs a destructor to free that memory. Otherwise the memory leaks.

Q420From DSSSB TGT Computer Science Practice Set 1
Von Neumann computer architecture is ______.
  1. ASISD
  2. BSIMD
  3. CMIMD
  4. DMISD
Show answerHide answer

Correct answer: (A) SISD

Explanation

A Von Neumann machine runs one instruction stream on one data stream at a time, which in Flynn's classification is SISD.

Q421From DSSSB TGT Computer Science Practice Set 1
Which of the following is/are wrong? (A) RAM and ROM are volatile memories, (B) ROMs, PROMs and EPROMs are non-volatile memories. (C) RAM and Dynamic RAM are same. (D) A Random Access Memory (RAM) is a read write memory.
  1. A(A) and (B)
  2. B(A) and (C)
  3. C(A) and (D)
  4. D(C) and (D)
Show answerHide answer

Correct answer: (B) (A) and (C)

Explanation

(A) is wrong because ROM is non-volatile. (C) is wrong because RAM includes both static and dynamic RAM. (B) and (D) are true.

Q422From DSSSB TGT Computer Science Practice Set 1
Which of the following techniques is used for transmitting digital signal?
  1. AAmplitude modulation
  2. BFrequency modulation
  3. CPulse code modulation
  4. DAmplitude shift keying
Show answerHide answer

Correct answer: (C) Pulse code modulation

Explanation

Pulse code modulation samples, quantises and encodes a signal into binary pulses, giving a digital signal. AM, FM and ASK modulate an analog carrier.

Q423From DSSSB TGT Computer Science Practice Set 1
Which of the following is an advantage of computer networks?
  1. AResource sharing
  2. BImproving reliability and availability
  3. CEnhancing performance
  4. DAll of the above
Show answerHide answer

Correct answer: (D) All of the above

Explanation

Networks allow resource sharing, improve reliability and availability through redundancy, and improve performance by spreading load. All three are advantages.

Q424From DSSSB TGT Computer Science Practice Set 1
A network spreading in different geographical locations is known as
  1. ALAN
  2. BWAN
  3. CBoth (a) and (b)
  4. DNone of the above
Show answerHide answer

Correct answer: (B) WAN

Explanation

A Wide Area Network covers large geographical areas such as cities or countries. A LAN covers a single building or campus.

Q425From DSSSB TGT Computer Science Practice Set 1
Which of the following is a token-based protocol?
  1. ACSMA/CD
  2. BSlotted ring
  3. CBoth (a) and (b)
  4. DNone of the above
Show answerHide answer

Correct answer: (B) Slotted ring

Explanation

In a slotted ring, a station may transmit only when it holds an empty slot or token circulating on the ring. CSMA/CD is a contention (random access) protocol.

Q426From DSSSB TGT Computer Science Practice Set 1
The best suited hidden surface algorithm to deal with non-polygonal, non-planar surface patches is
  1. AZ-buffer algorithm
  2. BRay tracing algorithm
  3. CPainter's algorithm
  4. DScan line algorithm
Show answerHide answer

Correct answer: (A) Z-buffer algorithm

Explanation

The z-buffer method stores a depth value for every pixel, so it can handle any surface for which depth can be computed at each pixel, including non-polygonal and non-planar patches, with no sorting needed.

Q427From DSSSB TGT Computer Science Practice Set 1
Raster images are commonly called
  1. APixmap
  2. BBitmap
  3. CBoth (a) and (b)
  4. DNone of the above
Show answerHide answer

Correct answer: (B) Bitmap

Explanation

Raster images are grids of pixels, commonly called bitmaps (a pixmap is the multi-bit-per-pixel form).

Q428From DSSSB TGT Computer Science Practice Set 1
A scaling transformation changes the
  1. ASize of an object
  2. BLocation of an object
  3. CShape of an object
  4. DBoth (a) and (b)
Show answerHide answer

Correct answer: (A) Size of an object

Explanation

Scaling multiplies coordinates by scale factors, which changes the size of the object. Translation changes the location.

Q429From DSSSB TGT Computer Science Practice Set 1
One of the disadvantages of pass by reference is that the called function may inadvertently corrupt the caller's data. This can be avoided by
  1. APassing pointers
  2. BDeclaring the formal parameters constant
  3. CDeclaring the actual parameters constant
  4. DAll of the above
Show answerHide answer

Correct answer: (B) Declaring the formal parameters constant

Explanation

Declaring the formal (reference) parameters as const lets the function read the caller's data without being able to modify it.

Q430From DSSSB TGT Computer Science Practice Set 1
In C language
  1. AParameters are always passed by values
  2. BParameter are always passed by reference
  3. CNon-pointer variables are passed by value and pointers are passed by reference
  4. DParameters are alsways passed by value result
Show answerHide answer

Correct answer: (A) Parameters are always passed by values

Explanation

C supports only call by value. Even a pointer is passed by value (a copy of the address); call by reference is only simulated by using that address.

Q431From DSSSB TGT Computer Science Practice Set 1
What does the following C statement mean? scanf ("%4s', str);
  1. ARead exactly 4 charaters from console
  2. BRead maximum 4 characters from console
  3. CRead a string in multiples of 4
  4. DNone of the above
Show answerHide answer

Correct answer: (B) Read maximum 4 characters from console

Explanation

A width in %4s limits input: scanf reads at most 4 non-whitespace characters into str. It may read fewer if whitespace comes first.

Q432From DSSSB TGT Computer Science Practice Set 1
Assume the following C variable declaration: int * A [10], B [10][10]; Among the following expressions, which will not give compile time errors if used as left-hand side of assignment statements in a C program? I. A[2] II. A[2][3] III. B[1] IV. B[2][3]
  1. AI, II and IV only
  2. BII, III and IV only
  3. CII and IV only
  4. DIV only
Show answerHide answer

Correct answer: (A) I, II and IV only

Explanation

A[2] is an int pointer, A[2][3] is an int reached through it, and B[2][3] is an int, so all three can be assigned. B[1] is an array (int[10]), and an array cannot be assigned, so only I, II and IV are valid.

Q433From DSSSB TGT Computer Science Practice Set 1
What is the output of the following C program? # include int main ( ) { int index; for (index = 1; index < = 5; index ++) { printf ("%d", index); if (index = = 3) continue; } }
  1. A1245
  2. B12345
  3. C12245
  4. D12354
Show answerHide answer

Correct answer: (B) 12345

Explanation

printf runs before the if statement, so continue only skips the (empty) rest of the loop body. Every value from 1 to 5 is printed: 12345.

Q434From DSSSB TGT Computer Science Practice Set 1
A multimedia project is said to be ______ and user-interactive when users are give navigational control.
  1. ASecure
  2. BHypertext
  3. CLinear
  4. DNon-linear
Show answerHide answer

Correct answer: (D) Non-linear

Explanation

When users get navigational control and can move through the content in any order, the multimedia project is non-linear and interactive.

Q435From DSSSB TGT Computer Science Practice Set 1
An analog signal carries 4 bits in each signal unit. If 1000 signal units are sent per second, then baud rate and bit rate of the signal are ______ and ______.
  1. A1000 bauds/sec, 4000 bps
  2. B1000 bauds/ sec, 500 bps
  3. C4000 bauds/ sec, 1000 bps
  4. D2000 bauds/sec, 1000 bps
Show answerHide answer

Correct answer: (A) 1000 bauds/sec, 4000 bps

Explanation

Baud rate = 1000 signal units per second. Bit rate = baud × bits per unit = 1000 × 4 = 4000 bps.

Q436From DSSSB TGT Computer Science Practice Set 1
When an ASP.NET file is placed on a an IIS server and viewed through a browser, the resulting HTML page contains?
  1. AA mix of ASP.NET and HTML code
  2. BAll ASP.NET code
  3. CAll HTML code
  4. DAs much ASP.NET code as is in the ASP.NET file
Show answerHide answer

Correct answer: (C) All HTML code

Explanation

ASP.NET code runs on the IIS server, and only the resulting HTML is sent to the browser. Viewing the page source shows pure HTML.

Q437From DSSSB TGT Computer Science Practice Set 1
In C++, which of the following statements correctly returns the memory from the dynamic array pointer pp to the free store?
  1. Adelete pp;
  2. Bdelete pp [];
  3. Cdelete [] pp;
  4. Ddelete *pp;
Show answerHide answer

Correct answer: (C) delete [] pp;

Explanation

Memory allocated with new[] for an array must be freed with delete [] pp, so that the whole array is released and destructors run for every element.

Q438From DSSSB TGT Computer Science Practice Set 1
An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlock will ever occur is :
  1. A5
  2. B2
  3. C3
  4. D4
Show answerHide answer

Correct answer: (D) 4

Explanation

With n processes each needing k units, n(k−1) + 1 units guarantee no deadlock: 3 × (2−1) + 1 = 4.

Q439From DSSSB TGT Computer Science Practice Set 1
The number of bits require to represent decimal number 4096 in binary from is ______.
  1. A16
  2. B10
  3. C12
  4. D13
Show answerHide answer

Correct answer: (D) 13

Explanation

4096 = 2¹², which in binary is 1 followed by twelve 0s. That needs 13 bits (12 bits can go only up to 4095).

Q440From DSSSB TGT Computer Science Practice Set 1
What is garbage collection in the context of Java?
  1. AThe Java Virtual Machine (JVM) checks the output of any Java program and deletes anything that does not make sense at all.
  2. BThe Operating System periodically deletes all of the Java files available on the system.
  3. CAny Java package imported in a program and not being used, is automatically deleted.
  4. DWhen all references to an object are gone, then the memory used by the object is automatically reclaimed.
Show answerHide answer

Correct answer: (D) When all references to an object are gone, then the memory used by the object is automatically reclaimed.

Explanation

Java's garbage collector automatically reclaims the memory of objects that are no longer referenced by any part of the program.

Q441From DSSSB TGT Computer Science Practice Set 1
What is the full form of DTD that is used to describe content in an XHTML document?
  1. ADocument To Definition
  2. BDocument Type Definition
  3. CDocument Towards Definition
  4. DDocument Text Definition
Show answerHide answer

Correct answer: (B) Document Type Definition

Explanation

DTD stands for Document Type Definition. It defines the legal elements and attributes of an XML or XHTML document.

Q442From DSSSB TGT Computer Science Practice Set 1
Which of the following protocol is used for transferring electronic mail messages from one machine to another?
  1. AHTTP
  2. BFTP
  3. CSMTP
  4. DSNMP
Show answerHide answer

Correct answer: (C) SMTP

Explanation

SMTP (Simple Mail Transfer Protocol) transfers e-mail between mail servers. HTTP is for web pages, FTP for files and SNMP for network management.

Q443From DSSSB TGT Computer Science Practice Set 1
OLE, A Microsoft's component document technology, means :
  1. AOverlay Linking and Exchange
  2. BOnline Linking and Embedding
  3. COpen Learning Exchange
  4. DObject Linking and Embedding
Show answerHide answer

Correct answer: (D) Object Linking and Embedding

Explanation

OLE is Object Linking and Embedding, Microsoft's technology for linking or embedding objects from one application in a document of another.

Q444From DSSSB TGT Computer Science Practice Set 1
If ⊕ represents XOR Gate in (Boolean algebra) and A ⊕ B = C, then B ⊕ C equals to:
  1. A1
  2. BA
  3. CA'
  4. D0
Show answerHide answer

Correct answer: (B) A

Explanation

B ⊕ C = B ⊕ (A ⊕ B) = A ⊕ (B ⊕ B) = A ⊕ 0 = A.

Q445From DSSSB TGT Computer Science Practice Set 1
Identify the Boolean expression from the given options, which is equivalent to the Logic Circuit Diagram. Circuit: A and B' (B through a NOT gate) feed an OR gate; the OR output and C' (C through a NOT gate) feed an AND gate; the AND output and D feed a second OR gate, whose output is the circuit output.
  1. A(A + B').C' + D
  2. BA.B' + C'.D
  3. CA+B'.C'+D
  4. D(A.B' + C').D
Show answerHide answer

Correct answer: (A) (A + B').C' + D

Explanation

The first OR gate gives A + B', which is ANDed with C' to give (A + B')·C'. This result is ORed with D, so the output is (A + B')·C' + D.

Q446From DSSSB TGT Computer Science Practice Set 1
Which of the following is an invalid method/function in a Python dictionary?
  1. Apopitem ()
  2. Bremove ()
  3. Cget ()
  4. Dpop ()
Show answerHide answer

Correct answer: (B) remove ()

Explanation

Python dictionaries have pop(), popitem() and get(), but no remove() method. remove() belongs to lists and sets.

Q447From DSSSB TGT Computer Science Practice Set 1
On 31st March 2024, the cash balance of a company is ₹4,00,000. During April, cash receipts are ₹3,20,000 and cash payments are ₹2,80,000. Outstanding salary is ₹20,000. What is the cash balance on 30th April?
  1. A₹4,20,000
  2. B₹4,40,000
  3. C₹4,60,000
  4. D₹4,00,000
Show answerHide answer

Correct answer: (B) ₹4,40,000

Explanation

Closing cash = 4,00,000 + 3,20,000 − 2,80,000 = ₹4,40,000. Outstanding salary has not been paid in cash, so it does not reduce the cash balance.

Q448From DSSSB TGT Computer Science Practice Set 1
Opening cash balance is ₹6,00,000. Cash receipts are ₹2,50,000 and cash payments are ₹3,20,000. Calculate the closing cash balance.
  1. A₹5,30,000
  2. B₹5,50,000
  3. C₹4,80,000
  4. D₹6,70,000
Show answerHide answer

Correct answer: (A) ₹5,30,000

Explanation

Closing balance = opening + receipts − payments = 6,00,000 + 2,50,000 − 3,20,000 = ₹5,30,000.

Q449From DSSSB TGT Computer Science Practice Set 1
Which course will be discontinued as per National Education Policy 2020?
  1. AM.Ed.
  2. BM.Phil.
  3. CPh.D.
  4. DEd.D
Show answerHide answer

Correct answer: (B) M.Phil.

Explanation

NEP 2020 states that the M.Phil. programme shall be discontinued.

Q450From DSSSB TGT Computer Science Practice Set 1
Which stage of child development refers to the period of stress and storm?
  1. AInfant
  2. BAdolescence
  3. CAdulthood
  4. DChildhood
Show answerHide answer

Correct answer: (B) Adolescence

Explanation

Adolescence is called the period of "stress and storm" (G. Stanley Hall), because of rapid physical, emotional and social changes.

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