DSSSB TGT / PGT · Topic-wise previous year questions
Computer Science Previous Year Questions (page 2)
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.
The five items P,Q,R,S and T are pushed in a stack, one after the other starting from P. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack, The popped item is :
AS
BP
CQ
DR
Show answerHide answer
Correct answer: (A) S
Explanation
After pushing P to T, popping four times sends T, S, R, Q to the queue, leaving P on the stack. Dequeuing two gives T and S, which are pushed back (stack P, T, S). The next pop returns S.
The unit receiving the data item responds with another control signal to acknowledge receipt of the data. This type of agreement between two independent units is known as ______.
AStrobe control
BMultitasking
CHandshaking
DPiggybacking
Show answerHide answer
Correct answer: (C) Handshaking
Explanation
In handshaking, the sender signals that data is ready and the receiver replies with an acknowledgement signal. Strobe control uses only one control signal.
What correction is required for following Java code snippet to compile?
int [] X = new int [10];
for (int P = 0; P<= X.length(); P++)
X [P] = 5;
AX [P] = 5 should be X (P) = 5
BP<= X.length() should be P< X.length()
CX.length() should be X.length
DP++ should be P+1
Show answerHide answer
Correct answer: (C) X.length() should be X.length
Explanation
In Java, length is a field of an array, not a method, so X.length() will not compile and must be X.length. The <= would only cause a runtime exception, not a compile error.
Which of the following MySQL query will display all the NAME from the table STUDENT, which are having maximum five characters and starting with the alphabet 'A'?
ASELECT NAME FROM STUDENT WHERE NAME LIKE 'A____';
BSELECT NAME FROM STUDENT WHERE NAME = 'A____';
CSELECT NAME FROM STUDENT WHERE NAME = 'A%%%%;
DSELECT NAME FROM STUDENT WHERE NAME LIKE 'A%%%%'
Show answerHide answer
Correct answer: (A) SELECT NAME FROM STUDENT WHERE NAME LIKE 'A____';
Explanation
LIKE with the wildcard _ matches exactly one character, so 'A____' matches names that start with A and have five characters. The = operator does not treat wildcards specially.
Which of the following components of pre-service teacher education program has greater scope for experiential learning?
APedagogy courses through use of critical thinking
BFoundation courses through critical exposure
CCritical reading based on great thinkiers' work
DInternship through school attachment
Show answerHide answer
Correct answer: (D) Internship through school attachment
Explanation
Internship through school attachment puts student-teachers into real classrooms, so it offers the most scope for experiential (learning by doing) learning.
Under NEP 2020, ABC stands for Academic Bank of Credit, a digital store of the credits a student earns so they can be transferred and counted toward a degree.
Select the correct output of the following C++ program segment assuming all necessary header files are correctly included:
void main( )
{
char *S = "MySQL";
S += 2;
cout << S <<endl;
}
ASQL
BQL
CMy
DMyS
Show answerHide answer
Correct answer: (A) SQL
Explanation
S points to "MySQL". S += 2 moves it past 'M' and 'y' to 'S', so cout prints the string from there: SQL.
How many times loop will be executed in the following flow chart ?
Flowchart: Start → U=70 → decision 'IS U>=0?' — NO: exit; YES: PRINT U → U=U−35 → back to the decision.
A1
B2
C3
D70
Show answerHide answer
Correct answer: (C) 3
Explanation
Corrected: the book's key says (b). U takes the values 70, 35 and 0 (all >= 0), so the loop body runs 3 times.
Which of the following flow charts will be most appropriate for finding sum of first 10 multiples of 5?
AS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
BS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: I=I+5 → S=S+I → back to the decision.
CI=1 → S=0 → decision 'IS I<=10?' — NO: PRINT S; YES: S=S+5*I → I=I+5 → back to the decision.
DS=0 → I=1 → decision 'IS I<=10?' — NO: PRINT S; YES: I=I+1 → S=S+5*I → back to the decision.
Show answerHide answer
Correct answer: (A) S=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
Explanation
The first 10 multiples of 5 are 5 to 50. Flowchart A starts at I = 5, adds I to S and then increases I by 5 while I ≤ 50. B increases I before adding, so it sums 10 to 55.
Which of the following is the correct code to create a framed webpage as in the figure below?
Figure: the window is split into two rows: the top row (25%) is Frame A; the bottom row (75%) is split into two equal columns (50% each): Frame B on the left and Frame C on the right.
The outer FRAMESET ROWS="25%,75%" makes two rows: Frame A in the first row, and a nested FRAMESET COLS="50%,50%" holding Frames B and C in the second. Options C and D swap FRAME and FRAMESET.
This question is based on the following C++ code segment and 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 C++ command/ statement can be written in the line marked as BLANK to invoke the function whose prototype is marked as Function 3 ?
AFUN F2;
BFUN F2 (501);
CFUN F2 (F1);
DFUN F2 = F1;
Show answerHide answer
Correct answer: (C) FUN F2 (F1);
Explanation
Function 3, FUN(FUN &F), is the copy constructor, which runs when a new object is made from an existing one, as in FUN F2(F1). (FUN F2 = F1; also calls it, but C is the direct form.)
This question is based on the following C++ code segment and 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 called a destructor of the class FUN ?
AFUNCTION 1
BFUNCTION 2
CFUNCTION 3
DFUNCTION 5
Show answerHide answer
Correct answer: (D) FUNCTION 5
Explanation
A destructor has the class name with a tilde and no arguments, so ~FUN() (Function 5) is the destructor.
Which of the following is the correct order of Problem Solving steps?
(A) Algorithm Development
(B) Coding
(C) Analysis of problem
(D) Testing & Debugging
A(A), (B), (C), (D)
B(C), (A), (D), (B)
C(A), (C), (B), (D)
D(C), (A), (B), (D)
Show answerHide answer
Correct answer: (D) (C), (A), (B), (D)
Explanation
First analyse the problem, then develop an algorithm, code it, and finally test and debug it: (C), (A), (B), (D).
The term ______ is used for the larger, more powerful computers other than supercomputers. It supports a large database, has elaborate I/O hardware, and is used in a central data processing facility.
AMinicomputer
BSupercomputer
CMainframe
DMicrocomputer
Show answerHide answer
Correct answer: (C) Mainframe
Explanation
A mainframe is a large, powerful computer below a supercomputer that supports large databases and extensive I/O, and is used in central data processing.
The development of second language skills must be in ?
Asequential manner
Bsequential order and in an integrated manner
Cin isolation
Dintegrated manner
Show answerHide answer
Correct answer: (B) sequential order and in an integrated manner
Explanation
The skills of a second language develop in a natural sequence (listening, speaking, reading, writing), but they should be taught together in an integrated way rather than in isolation.
The teacher provides study material a day before teaching the same thing students read it according to their ability and use the time to complete the assignments in the class with the help of teacher what type of approach is highlighted in the statement?
ABlended learning
BDistance learning
CVirtual learning
DTraditional learning
Show answerHide answer
Correct answer: (A) Blended learning
Explanation
Studying the material before class and using class time for assignments with the teacher is the flipped-classroom model, a form of blended learning that mixes self-study with face-to-face teaching.
The teacher delivered her lesson plan in the classroom and uploaded the study material on Google drive. She gave the access of the link to all the students for their ease. Which type of ICT source did she use ?
ACloud computing
BBlended learning
CSocial media
DTraditional method
Show answerHide answer
Correct answer: (A) Cloud computing
Explanation
Google Drive stores files on remote internet servers and shares them by link, which is cloud computing.
Which of the following is not an advantage of ICT in education?
ACommunication the gap
Bpromotes traditional education
Ctime efficient
DAccess more information
Show answerHide answer
Correct answer: (B) promotes traditional education
Explanation
ICT changes and modernises teaching, so "promotes traditional education" is not one of its advantages. Bridging communication gaps, saving time and giving access to more information are advantages.
Assessments like unit test and class tests are covered under following ______
ASummative assessment
BPortfolio assessment
CFormative assessment
DCCE
Show answerHide answer
Correct answer: (C) Formative assessment
Explanation
Unit tests and class tests happen during teaching to check progress and give feedback, so they are formative assessment. Summative assessment comes at the end of a term.
The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of lists could be used?
ASingly linked list
BDoubly linked list
CCircular doubly linked list
DArray implementation of list
Show answerHide answer
Correct answer: (C) Circular doubly linked list
Explanation
In a circular doubly linked list the last node is reached directly through head->prev. So two lists can be joined by changing a few pointers in O(1) time, without traversing.
Match List-I with List-II and select the correct answer using the codes given below the Lists:
List-I
A. All-pairs shortest path
B. Quicksort
C. Minimum weight spanning tree
D. Connected components
List-II
1. Greedy
2. Depth-first search
3. Dynamic programming
4. Divide and conquer
Codes: A B C D
A2 4 1 3
B3 4 1 2
C3 4 2 1
D4 1 2 3
Show answerHide answer
Correct answer: (B) 3 4 1 2
Explanation
All-pairs shortest path (Floyd-Warshall) uses dynamic programming, quicksort uses divide and conquer, minimum spanning tree (Prim/Kruskal) is greedy, and connected components are found with DFS. That gives 3, 4, 1, 2.
Which of the following algorithms solves the all-pairs shortest path problem?
ADijkstra's algorithm
BFloyd's algorithm
CPrim's algorithm
DWarshall's algorithm
Show answerHide answer
Correct answer: (B) Floyd's algorithm
Explanation
Floyd's (Floyd-Warshall) algorithm finds shortest paths between every pair of vertices in O(V³). Dijkstra is single-source, Prim builds an MST, and Warshall finds transitive closure.
Conceptual level, Internal level and External level are three components of the three- level RDBMS architecture. Which of the following is not part of the conceptual level?
AStorage dependent details
BEntities, attributes, relationships
CConstraints
DSemantic information
Show answerHide answer
Correct answer: (A) Storage dependent details
Explanation
Storage-dependent details such as file organisation and indexes belong to the internal (physical) level. The conceptual level describes entities, attributes, relationships, constraints and semantics.
Mechanism that is used to convert domain name into IP address is known as ______.
AHTTP
BURL
CFTP
DDNS
Show answerHide answer
Correct answer: (D) DNS
Explanation
DNS (Domain Name System) translates domain names such as example.com into IP addresses.
Q100From DSSSB TGT Computer Science Practice Set 4
Which of the following statements best describes the main reasons for normalizing relational database?
I. To Achieve physical data independence.
II. To remove data anomalies (insertion. update, deletion, anomalies).
III. To save space on disk.
AI, II and III
BI and II only
CI and III only
DII and III only
Show answerHide answer
Correct answer: (D) II and III only
Explanation
Normalization removes redundancy, which prevents insert, update and delete anomalies and saves storage space. It does not provide physical data independence, which comes from the three-level architecture.
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.