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.
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.
ARegister
BCounter
CFlip flop
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 :
A2
B16
C8
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?
A46252
B11450
C11452
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 :
AO (n log n)
BO (n)
CO (log n)
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 :
ACartesian Product always.
BCombination of Union and filtered Cartesian Product.
CCombination of Selection and filtered Cartesian Product.
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 ?
AThrashing
BDMA
CBuffering
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).
A− + * / abdef
Ba + bd * − ef /
Cabdef* / + −
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 :
AMinimize coupling and minimize cohesion.
BMaximize coupling and minimize cohesion.
CMinimize coupling and maximize cohesion.
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 ?
ARelationship integrity
BReferential integrity only
CEntity and domain integrities
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?
A'Point' is the base class and 'circle' is the derived class.
BThe colon (:) in the header of class definition indicates inheritance.
CThe keyword 'public' indicates type of inheritance.
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.
Aint array [][] = new int [5][4];
Bint array [4][5];
Cint array [5][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?
ATree
BStack
CLinked list
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 :
ATop-down program development
BSpeed
CUser – interface
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:
A120 nanoseconds
B160 nanoseconds
C200 nanoseconds
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?
A22
B37
C7
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;
}
A10 times
BNot even once
CRepeated forever
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?
ASquare, disc, triangle
BTriangle, disc, circle
CTriangle, square, circle
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 ______.
AServer machine
BClient machine
CRequest machine
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?
AAlmost in every class
BClass for which two or more than two objects will be created.
CClass for which copy constructor is defined.
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 ______.
ASISD
BSIMD
CMIMD
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.
A(A) and (B)
B(A) and (C)
C(A) and (D)
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?
AAmplitude modulation
BFrequency modulation
CPulse code modulation
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?
AResource sharing
BImproving reliability and availability
CEnhancing performance
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
ALAN
BWAN
CBoth (a) and (b)
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?
ACSMA/CD
BSlotted ring
CBoth (a) and (b)
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
AZ-buffer algorithm
BRay tracing algorithm
CPainter's algorithm
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
APixmap
BBitmap
CBoth (a) and (b)
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
ASize of an object
BLocation of an object
CShape of an object
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
APassing pointers
BDeclaring the formal parameters constant
CDeclaring the actual parameters constant
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
AParameters are always passed by values
BParameter are always passed by reference
CNon-pointer variables are passed by value and pointers are passed by reference
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);
ARead exactly 4 charaters from console
BRead maximum 4 characters from console
CRead a string in multiples of 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]
AI, II and IV only
BII, III and IV only
CII and IV only
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;
}
}
A1245
B12345
C12245
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.
ASecure
BHypertext
CLinear
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 ______.
A1000 bauds/sec, 4000 bps
B1000 bauds/ sec, 500 bps
C4000 bauds/ sec, 1000 bps
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?
AA mix of ASP.NET and HTML code
BAll ASP.NET code
CAll HTML code
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?
Adelete pp;
Bdelete pp [];
Cdelete [] pp;
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 :
A5
B2
C3
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 ______.
A16
B10
C12
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?
AThe Java Virtual Machine (JVM) checks the output of any Java program and deletes anything that does not make sense at all.
BThe Operating System periodically deletes all of the Java files available on the system.
CAny Java package imported in a program and not being used, is automatically deleted.
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?
ADocument To Definition
BDocument Type Definition
CDocument Towards Definition
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?
AHTTP
BFTP
CSMTP
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 :
AOverlay Linking and Exchange
BOnline Linking and Embedding
COpen Learning Exchange
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:
A1
BA
CA'
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.
A(A + B').C' + D
BA.B' + C'.D
CA+B'.C'+D
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?
Apopitem ()
Bremove ()
Cget ()
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?
A₹4,20,000
B₹4,40,000
C₹4,60,000
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.
Q449From DSSSB TGT Computer Science Practice Set 1
Which course will be discontinued as per National Education Policy 2020?
AM.Ed.
BM.Phil.
CPh.D.
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?
AInfant
BAdolescence
CAdulthood
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.