DSSSB TGT / PGT · Topic-wise previous year questions
Computer Science Previous Year Questions (page 3)
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.
Q101From DSSSB TGT Computer Science Practice Set 4
A thread is also called :
AA scheduler
BA virtual process
CA heavyweight process
DA lightweight process
Show answerHide answer
Correct answer: (D) A lightweight process
Explanation
A thread is called a lightweight process. Threads of the same process share its code, data and files, so creating and switching between them costs little.
Q102From DSSSB TGT Computer Science Practice Set 4
Consider the following dictionary:
Num = {10 : 'Ten', 100 : 'Hundred', 10: 'Decimal'}
What shall be the output of print (Num)?
Dictionary keys must be unique. The second 10 overwrites the first value but keeps the key's original position, giving {10: 'Decimal', 100: 'Hundred'}.
Q103From DSSSB TGT Computer Science Practice Set 4
Identify the term, which is an unauthorized real-time interception or monitoring of private communication between two entities over a network.
AEavesdropping
BPhishing
CSnooping
DCyberstalking
Show answerHide answer
Correct answer: (A) Eavesdropping
Explanation
Eavesdropping is secretly intercepting or listening to private communication in real time over a network without permission.
Q104From DSSSB TGT Computer Science Practice Set 4
Which of the following method is used to move the file pointer to read the content from a specific position in a text file inside a Python program?
AMove
BTell
CFind
DSeek
Show answerHide answer
Correct answer: (D) Seek
Explanation
seek(offset) moves the file pointer to a given position. tell() only reports the current position.
Q105From DSSSB TGT Computer Science Practice Set 4
Which out of the following mode is required to be used while opening a binary file to allow read as well as write operations in a Python program?
Aab
Bwb
Cr+
Drb+
Show answerHide answer
Correct answer: (D) rb+
Explanation
'rb+' opens an existing binary file for both reading and writing. 'r+' is the text-mode version, and 'wb'/'ab' only write or append.
Q106From DSSSB TGT Computer Science Practice Set 4
What is the purpose of the legend() function in Matplotlib?
ATo add a title to a plot
BTo add annotations to a plot
CTo label different lines or markers on a plot
DTo label the x and y axes of a plot
Show answerHide answer
Correct answer: (C) To label different lines or markers on a plot
Explanation
legend() adds a legend box that labels each line or marker on the plot, using the label= values given when plotting.
Q107From DSSSB TGT Computer Science Practice Set 4
Which command in MySQL is used to list all (non-temporary) tables in a given database?
ADESCRIBE TABLES
BDISPLAY TABALES
CVIEW TABLES
DSHOW TABLES
Show answerHide answer
Correct answer: (D) SHOW TABLES
Explanation
SHOW TABLES lists all the non-temporary tables in the current MySQL database.
Q108From DSSSB TGT Computer Science Practice Set 4
As per NEP 2020, from which class will vocational education be introduced?
AClass 7
BClass 8
CClass 9
DClass 6
Show answerHide answer
Correct answer: (D) Class 6
Explanation
NEP 2020 introduces vocational education from Class 6, including internships, so every student learns at least one vocation.
Q109From DSSSB TGT Computer Science Practice Set 4
Which approach of learning out of the following, engages participants in activity, leads them to reflect on their activity critically and obtain useful insight and learning?
ACollaboration
BPassive learning
CObservation
DExperiential learing
Show answerHide answer
Correct answer: (D) Experiential learing
Explanation
Experiential learning (Kolb) is learning by doing: learners take part in an activity, reflect on it critically, and draw insights they can apply.
Q110From DSSSB TGT Computer Science Practice Set 4
Which of the following is not a valid variable name in JavaScript ?
ANumber10
B_myNumber
C10Number
Dmy_Number
Show answerHide answer
Correct answer: (C) 10Number
Explanation
JavaScript identifiers cannot start with a digit, so 10Number is invalid. Names can start with a letter, _ or $.
Q111From DSSSB TGT Computer Science Practice Set 4
The style definitions are normally saved in external files that have the extension as :
A.html
B.css
C.js
D.stl
Show answerHide answer
Correct answer: (B) .css
Explanation
External style sheets are saved with the .css extension and linked to HTML pages with the <link> tag.
Q112From DSSSB TGT Computer Science Practice Set 4
A binary search tree with N integers may have height ______ in the best case, and ______ in the worst case.
AO(N), O(N)
BO(N²), N
CO(log₂N), O(N²)
DO(log₂N), N−1
Show answerHide answer
Correct answer: (D) O(log₂N), N−1
Explanation
A balanced BST has height O(log₂N). If keys are inserted in sorted order the tree becomes a chain with height N−1.
Q113From DSSSB TGT Computer Science Practice Set 4
Intellectual Property Rights (IPR) protect the use of information and ideas that are of:
ATraditional value
BHistorical value
CCommercial value
DEthical value
Show answerHide answer
Correct answer: (C) Commercial value
Explanation
IPR protects creations of the mind, such as inventions, designs and brands, that have commercial value, giving the creators exclusive rights to use them.
Q114From DSSSB TGT Computer Science Practice Set 4
What will be the result of the following expression?
3−(−3−3)−3
A6
B0
C−3
D3
Show answerHide answer
Correct answer: (A) 6
Explanation
3 − (−3 − 3) − 3 = 3 − (−6) − 3 = 3 + 6 − 3 = 6.
Q115From DSSSB TGT Computer Science Practice Set 4
Which of the following operations have the highest level of precedence?
A( )
B+ −
C* /
D^ (exponentiation)
Show answerHide answer
Correct answer: (D) ^ (exponentiation)
Explanation
Among the arithmetic operators, exponentiation (^) has the highest precedence, above * and /, which are above + and −. Parentheses are grouping symbols, not operations.
Q116From DSSSB TGT Computer Science Practice Set 4
Which topologies of networks is represented in the following diagram ?
Diagram: a main cable with two computers attached to it branches out into three separate cables (lines); each branch cable has several computers attached to it (4 on the upper branch, 5 on the middle branch, 3 on the lower branch).
ABUS
BRING
CSTAR
DTREE
Show answerHide answer
Correct answer: (D) TREE
Explanation
Several bus segments branch out from a main backbone cable, making a hierarchy of buses. This is a tree topology.
Q117From DSSSB TGT Computer Science Practice Set 4
Identify the error in the following HTML code:
<HTML>
<BODY>
<FORM ID = "FORM1" METHOD = POST>
<BR> SELECT YOUR FAVOURITE CHANNEL :
NETFLIX <INPUT TYPE = CHECKSELECT>
AMAZON PRIME <INPUT TYPE = CHECKSELECT>
</FORM>
</BODY>
</HTML>
(a) NAME instead of ID and CHECKBOX instead of CHECKSELECT.
(b) METHOD = GET instead of POST.
AOnly (a) is correct
BBoth (a) and (b) are correct
COnly (b) is correct
DThe code is correct and has no errors
Show answerHide answer
Correct answer: (A) Only (a) is correct
Explanation
Form controls need a NAME attribute to be submitted, and the input type for tick boxes is CHECKBOX. CHECKSELECT does not exist. METHOD = POST is valid, so only (a) is correct.
Q118From DSSSB TGT Computer Science Practice Set 4
The ______ attribute of the <A> tag is used to specify the Section names while creating an internal link.
AHREF
BID
CACTION
DNAME
Show answerHide answer
Correct answer: (D) NAME
Explanation
In older HTML an internal link target is made with <A NAME="section">, and you link to it with <A HREF="#section">.
Q119From DSSSB TGT Computer Science Practice Set 4
Select the correct output of the following C++ program segment assuming all necessary header files are correctly included.
void main ()
{
char *S = "Inheritance";
S +=6 ;
cout<<S<< endl;
}
Aitence
Btance
CTence
DInheri
Show answerHide answer
Correct answer: (B) tance
Explanation
S points to "Inheritance". S += 6 moves it to index 6 (I0 n1 h2 e3 r4 i5 t6), so cout prints "tance".
Q120From DSSSB TGT Computer Science Practice Set 4
This question is based on the following C++ code segment and class FUN : class FUN
class FUN
{
int CODE ;
public :
FUN ( ); //Function1
FUN (int C); //Function2
FUN (FUN & F); //Function3
void DISP ( ); //Function4
~FUN ( ); //Function5
};
void main ( )
{
FUN F1 ;
______ // BLANK
______
______}
Which of the following is an example of default constructor?
AFunction 1
BFunction 2
CFunction 3
DFunction 5
Show answerHide answer
Correct answer: (A) Function 1
Explanation
A default constructor takes no arguments, so FUN() (Function 1) is the default constructor. FUN(int) is parameterized, FUN(FUN&) is the copy constructor, and ~FUN() is the destructor.
Q121From DSSSB TGT Computer Science Practice Set 4
Which of the following is depicted from the flowchart shown below?
Flowchart (top to bottom, one straight path): P=1000 → R=10 → T=2 → SI=P*R*T/100 → PRINT SI
ASequencing
BBranching
CLooping
DOverloading
Show answerHide answer
Correct answer: (A) Sequencing
Explanation
The flowchart runs straight from top to bottom with no decisions or loops, which is sequencing (sequential control flow).
Q122From DSSSB TGT Computer Science Practice Set 4
Assume the values of X, Y and Z variables are assigned with values as −10, 20 and −30 respectively find out, which of following expression will evaluate to true ?
AX > Z and Y >= Z
BX > Y and X <= Z
CX >= Z and Z <= Y
DY <= X and Z <= Y
Show answerHide answer
Correct answer: (A) X > Z and Y >= Z
Explanation
Answer as per the book's key (a). Note that option (c) also evaluates to true for these values.
Q123From DSSSB TGT Computer Science Practice Set 4
In order to add a new column to an existing table in SQL, we can use the command
AMODIFY TABLE
BEDIT TABLE
CALTER TABLE
DALTER COLUMNS
Show answerHide answer
Correct answer: (C) ALTER TABLE
Explanation
ALTER TABLE ... ADD column_name datatype adds a new column to an existing table. MODIFY TABLE and EDIT TABLE are not SQL commands.
Q124From DSSSB TGT Computer Science Practice Set 4
Which of the following search algorithm requires a sorted array ?
ALinear search
BHash search
CBinary search
DAll of these
Show answerHide answer
Correct answer: (C) Binary search
Explanation
Binary search repeatedly halves the search range by comparing with the middle element, which only works if the array is sorted. Linear search works on unsorted data.
Q125From DSSSB TGT Computer Science Practice Set 4
With an IP address of 100, you currently have 80 subnets. What subnet mask should you use to maximize the number of available hosts ?
A192
B224
C248
D252
Show answerHide answer
Correct answer: (D) 252
Explanation
Note: the answer key gives (D) 252, but 252 adds only 6 subnet bits (64 subnets). 80 subnets need 7 bits (2⁷ = 128), which makes the octet 254 (255.254.0.0 for network 100). The question is garbled.
Q126From DSSSB TGT Computer Science Practice Set 4
The ______ houses the switches in token ring.
ATransceiver
BNine-pin connector
CMAU
DNIC
Show answerHide answer
Correct answer: (C) MAU
Explanation
In Token Ring, the MAU (Multistation Access Unit) is the hub-like device that houses the switches and connects the stations into a logical ring.
Q127From DSSSB TGT Computer Science Practice Set 4
A program is a/an ______ entity.
AActive
BPassive
CDormant
DHyperactive
Show answerHide answer
Correct answer: (B) Passive
Explanation
A program is a passive entity, just code stored on disk. A process is an active entity, a program in execution.
Q128From DSSSB TGT Computer Science Practice Set 4
The diagram given below represents
Diagram: Processes enter a 'ready queue' which feeds the 'CPU'; an arrow leaves the CPU (exit). From the CPU, four paths lead back to the ready queue:
1. I/O request → I/O queue → I/O → back to ready queue
2. time slice expired → back to ready queue
3. fork a child → child executes → back to ready queue
4. wait for an interrupt → interrupt occurs → back to ready queue
AProcess creation
BProcess state
CQueuing diagram
DCommunication model
Show answerHide answer
Correct answer: (C) Queuing diagram
Explanation
The diagram shows the ready queue, the I/O queues and the events that move a process between them. This is the queueing diagram of process scheduling.
Q129From DSSSB TGT Computer Science Practice Set 4
The figure below represents a
Figure: an arrow points to a root node R; R has two arrows going down, one to a triangle (subtree) labelled A on the left and one to a triangle (subtree) labelled B on the right.
ABinary tree
BRecursive tree
CInsert sort
DUnitary tree
Show answerHide answer
Correct answer: (A) Binary tree
Explanation
The figure shows a root with a left subtree A and a right subtree B. This is the recursive definition of a binary tree.
Q130From DSSSB TGT Computer Science Practice Set 4
The command used to see the fields of the table alongwith their datatypes in SQL is
ASelect fields from dual where table = "MANAGER";
BSelect field_names, datatype from dual where table_ name = "MANAGER";
CDesc MANAGER;
DSelect description from dual where table_ name = "MANAGER";
Show answerHide answer
Correct answer: (C) Desc MANAGER;
Explanation
DESC (DESCRIBE) table_name shows the table's columns with their data types and constraints.
Q131From DSSSB TGT Computer Science Practice Set 4
Consider an arbitrary number system with the independent digits as 0, 1 and X. What is the radix of this number system ?
A1
B2
C3
D4
Show answerHide answer
Correct answer: (C) 3
Explanation
The radix (base) of a number system equals its number of distinct digits. 0, 1 and X are three digits, so the radix is 3.
Q132From DSSSB TGT Computer Science Practice Set 4
The following diagram shows a
Diagram: inputs A and B enter an XOR-shaped gate that has an inversion bubble at its output; output Y = (A⊕B)'.
AExclusive-Nor gate
BNAND gate
CAND gate
DOR gate
Show answerHide answer
Correct answer: (A) Exclusive-Nor gate
Explanation
An XOR gate with an inverting bubble at the output computes (A⊕B)', which is the Exclusive-NOR gate.
Q133From DSSSB TGT Computer Science Practice Set 4
Consider the following statements :
S1 : a small page size causes large page tables,
S2 : internal fragmentation is increaseked with small pages.
S3 : I/O transfers are more efficient with large pages.
Which of the following is true?
AS1 is true and S3 is false
BS1 and S2 are true
CS2 and S3 are true
DS1 is true and S2 is false
Show answerHide answer
Correct answer: (D) S1 is true and S2 is false
Explanation
S1 is true, because small pages mean more pages and so bigger page tables. S2 is false, because small pages reduce internal fragmentation. S3 is true, because large pages make I/O more efficient. So the statement "S1 is true and S2 is false" holds.
Q134From DSSSB TGT Computer Science Practice Set 4
The addressing mode used in an instruction of the form ADD X, Y is :
AIndex
BAbsolute
CImmediate
DIndirect
Show answerHide answer
Correct answer: (B) Absolute
Explanation
In ADD X, Y the operands are given by their memory addresses directly in the instruction. This is absolute (direct) addressing.
Q135From DSSSB TGT Computer Science Practice Set 4
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
Subtracting the smaller number from the larger until both are equal is Euclid's subtraction method, so the final X is the GCD.
Q136From DSSSB TGT Computer Science Practice Set 4
Which of the following is the correct declaration of linked list?
A self-referential structure has a pointer to its own type: struct node { int data; struct node *link; };. A member of type node itself would be infinitely recursive.
Q137From DSSSB TGT Computer Science Practice Set 4
Consider the relation Emp-Dept with SSn as key.
Ename | SSn (key) | EAddr | Dept. No. | Dept. Name | Dept. Manager | SSn
Which of the following is (are) invalid operations (s)?
(i) Inserting an employee without name and address.
(ii) Inserting an employee with only SSn.
(iii) Inserting a department with no employee.
(iv) Inserting an employee without SSn.
A(i)
B(iv)
C(iii) and (iv)
D(ii) and (iii)
Show answerHide answer
Correct answer: (B) (iv)
Explanation
SSn is the primary key, and by entity integrity a key cannot be null. So inserting an employee without an SSn is invalid. Name and address may be null.
Q138From DSSSB TGT Computer Science Practice Set 4
Which of the following is a special effect in motion pictures and animations that changes one image/picture into another through a seamless transition?
AModeling
BMorphing
CAnimating
DWrapping
Show answerHide answer
Correct answer: (B) Morphing
Explanation
Morphing smoothly transforms one image into another through a seamless series of in-between frames.
Q139From DSSSB TGT Computer Science Practice Set 4
Consider the following Java code segment:
public class while /* line 1*/
{
public void loop ( )
{
int x = 0;
While (1)/* line-6*/
{
system. out. println("x plus one is" + (x+1)):
}
}
}
Which of the following is true ?
AThere is a syntax error in line-1
BThere are syntax errors in line- 1 and line- 6
CThere is a syntax error in line- 6
DNo syntax error
Show answerHide answer
Correct answer: (A) There is a syntax error in line-1
Explanation
while is a reserved keyword in Java, so it cannot be used as a class name. "public class while" is a syntax error on line 1.
Q140From DSSSB TGT Computer Science Practice Set 4
In the context of while loop and do-while loop in C++, which of the following is not true?
ABoth the loops are repetitive in nature
BBoth are conditional loops
CBoth will be executed at least once
DBoth are terminated when the condition becomes false.
Show answerHide answer
Correct answer: (C) Both will be executed at least once
Explanation
A do-while loop always runs at least once because it checks the condition after the body. A while loop may run zero times, so (C) is not true.
Q141From DSSSB TGT Computer Science Practice Set 4
Which of the following is not correct in C++?
Ax−=2; is the same as x = x−2;
Bx*= 2; is the same as x = x*2;
Cx% =2; is the same as x = x/2;
Dx/=2; is the same as x = x/2;
Show answerHide answer
Correct answer: (C) x% =2; is the same as x = x/2;
Explanation
x %= 2 means x = x % 2 (remainder), not x = x / 2 (division). So (C) is incorrect.
Q142From DSSSB TGT Computer Science Practice Set 4
Run-time polymorphism is achieved by ______.
AFriend function
BVirtual function
COperator overloading
DFunction overloading
Show answerHide answer
Correct answer: (B) Virtual function
Explanation
Virtual functions give run-time (dynamic) polymorphism: the function called is chosen at run time from the object's actual type. Overloading is resolved at compile time.
Q143From DSSSB TGT Computer Science Practice Set 4
Hardware mechanism that enables a device to notify the CPU is called:
ABusy-waiting
BInterrupt
CPolling
DDMA
Show answerHide answer
Correct answer: (B) Interrupt
Explanation
An interrupt is a hardware signal that a device sends to the CPU to request attention. Polling and busy-waiting are software checks made by the CPU.
Q144From DSSSB TGT Computer Science Practice Set 4
The address resolution protocol (ARP) is used for
AFinding the IP address from DNS
BFinding the IP address of the default gateway
CFinding the IP address that corresponds to a MAC address
DFinding the MAC address that corresponds to an IP address
Show answerHide answer
Correct answer: (D) Finding the MAC address that corresponds to an IP address
Explanation
ARP maps a known IP address to the matching MAC (hardware) address on a local network. RARP does the reverse.
Q145From DSSSB TGT Computer Science Practice Set 4
The number of crosspoints needed for 10 lines in a crosspoint switch, which is full duplex in nature and there is no self-connection, is
A100
B45
C50
D90
Show answerHide answer
Correct answer: (B) 45
Explanation
With full-duplex lines and no self-connection, each pair of lines needs one crosspoint. So the count is n(n−1)/2 = 10 × 9 / 2 = 45.
Q146From DSSSB TGT Computer Science Practice Set 4
In Huffman's coding, if the symbol A has probability 0.3, B has probability 0.15, C has probability 0.1, D has probability 0.25 and E has probability 0.2, then the minimum number of bits required to represent all the symbols together is
A14
B11
C12
D15
Show answerHide answer
Correct answer: (C) 12
Explanation
Huffman merges: 0.1 + 0.15 = 0.25, then 0.2 + 0.25 = 0.45, then 0.25 + 0.3 = 0.55, then 1. The code lengths are A 2, D 2, E 2, B 3, C 3, totalling 2 + 2 + 2 + 3 + 3 = 12 bits.
Q147From DSSSB TGT Computer Science Practice Set 4
X.21 is
AA method of determining which device has access to the transmission medium at any time
BA method access control technique or multiple access transmission media
CVery common but oriented at linked protocol issued to ISO
DA network access standard for connecting stations to a circuit switch network
Show answerHide answer
Correct answer: (D) A network access standard for connecting stations to a circuit switch network
Explanation
X.21 is an ITU-T standard interface for connecting stations (DTE) to circuit-switched digital networks.
Q148From DSSSB TGT Computer Science Practice Set 4
Which of the following activities does not belong to implementation phase of SDLC?
AProgram testing
BFile conversion
CUser training
DNew changes to the system
Show answerHide answer
Correct answer: (D) New changes to the system
Explanation
New changes to the system belong to maintenance. Testing, file conversion and user training are done in the implementation phase.
Q149From DSSSB TGT Computer Science Practice Set 4
Project risk factor is considered in
AWaterfall model
BPrototyping model
CSpiral model
DIterative enhancement model
Show answerHide answer
Correct answer: (C) Spiral model
Explanation
Boehm's spiral model explicitly analyses project risks in every cycle (a risk analysis quadrant), unlike the waterfall or prototyping models.
Q150From DSSSB TGT Computer Science Practice Set 4
According to PUTNAM, the project effort is inversely proportional to the fourth power of the development time. Doubling the development schedule for a 100 Person-Month (PM) project would reduce the project effort to
A50 PM
B7.16 PM
C25 PM
D6.25 PM
Show answerHide answer
Correct answer: (D) 6.25 PM
Explanation
Effort ∝ 1/t⁴, so doubling the time divides effort by 2⁴ = 16: 100 ÷ 16 = 6.25 PM.
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.