DSSSB TGT / PGT · Topic-wise previous year questions
Computer Science Previous Year Questions (page 12)
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.
Match the following file stream classes in C++ with its functions.
A. Fstream base — i. Provides support for simultaneous input and output operation
B. If stream — ii. Provides output operation
C. Of stream — iii. Provides operations common to file streams
D. F stream — iv. Provides input operation
AA-i, B-ii, C-iv, D-iii
BA-iv, B-iii, C-i, D-ii
CA-i, B-iii, C-iv, D-ii
DA-iii, B-iv, C-ii, D-i
Show answerHide answer
Correct answer: (D) A-iii, B-iv, C-ii, D-i
Explanation
fstreambase provides operations common to file streams, ifstream gives input, ofstream gives output, and fstream supports simultaneous input and output.
In C++, "Out-of-range-index" belong to ________ type exception while keyboard interrupts are called ________ exceptions.
ASynchronous; synchronous
BSynchronous; asynchronous
CAsynchronous; synchronous
DAsynchronous; asynchronous
Show answerHide answer
Correct answer: (B) Synchronous; asynchronous
Explanation
Errors such as out-of-range index come from the program's own execution, so they are synchronous. Events beyond the program's control, such as keyboard interrupts, are asynchronous.
Which of the following statement is NOT correct regarding Virtual function in C++?
I. It must be a member of some class.
II. It is accessed by using object points.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (D) Neither I nor II
Explanation
Both statements are true: a virtual function must be a member of a class, and it is accessed through object pointers (base-class pointers) for run-time polymorphism. So neither is incorrect.
Match the following formal relational term with informal equivalents.
i. Relation — A. Row
ii. Tuple — B. Value
iii. Attribute — C. Table
iv. Domain — D. Column
Ai-3, ii-4, iii-1, iv-2
Bi-3, ii-1, iii-4, iv-2
Ci-1, ii-3, iii-2, iv-4
Di-4, ii-3, iii-2, iv-1
Show answerHide answer
Correct answer: (B) i-3, ii-1, iii-4, iv-2
Explanation
Note: in the official paper the options refer to A, B, C, D as 1, 2, 3, 4 respectively.
Consider the following relation schema of students.
STUDENT (Rollno, Name, DOB, Marks, Gender)
Which of the given query is equivalent to this query in English? "Find the tuples of student having marks above 80".
Aσ Marks>80 (STUDENT)
BΠ Marks>80 (STUDENT)
Cσ Marks<80 (STUDENT)
DΠ Marks<80 (STUDENT)
Show answerHide answer
Correct answer: (A) σ Marks>80 (STUDENT)
Explanation
Selecting tuples (rows) that satisfy a condition uses σ: σ Marks>80 (STUDENT). Π selects columns, not rows.
Which of the following statement(s) is/are correct regarding Structured Query Language (SQL)?
I. The datatype FLOAT can hold numbers with decimal points.
II. The datatype BIGINT occupies 16 bytes.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (A) Only I
Explanation
FLOAT stores numbers with decimal points, but BIGINT occupies 8 bytes, not 16. So only I is correct.
Which of the following statement(s) is/are correct regarding COUNT functions in Structured Query Language of Relational Database Management System?
I. COUNT(*) is used to count the number of values in a column.
II. COUNT() is used to count the number of rows of the query result.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (D) Neither I nor II
Explanation
Both statements are reversed: COUNT(*) counts all rows of the result, while COUNT(column) counts the non-NULL values in a column. So neither is correct.
Which of the following statement(s) is/are correct regarding <title> tag in HTML?
I. This tag always goes outside to the <head> tag.
II. This tag is used to indicate the title of the webpage.
III. It is also used by search engines.
AI and II
BII and III
COnly II
DI, II and III
Show answerHide answer
Correct answer: (B) II and III
Explanation
<title> must be placed inside <head>, not outside it. It sets the page title shown in the browser tab, and search engines use it.
BIt contains the number of nested tags in the page.
CIt contains information about the webpage.
DIt contains the number of tags in the web page.
Show answerHide answer
Correct answer: (C) It contains information about the webpage.
Explanation
The tag described here seems to be <meta> (the tag name is missing in the source). It holds information about the page, such as description, keywords and author.
Which of the following statement(s) is/are true regarding OSI layers in computer networks?
I. The session layer provides means of establishing, maintaining and terminating a session between two end users.
II. Data Link layer sets up a logical path between the source and destination computer of the network.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (A) Only I
Explanation
The session layer establishes, maintains and terminates sessions. Setting up the logical path (routing) between source and destination is the network layer's job, not the data link layer's.
Which of the following statement(s) is/are true regarding Data Communication?
I. Half duplex communication is multidirectional communication.
II. Full duplex communication is bidirectional communication.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (B) Only II
Explanation
Half duplex is two-way but only one direction at a time, not "multidirectional". Full duplex is bidirectional at the same time. So only II is true.
Which of the following statement(s) is/are true regarding switching techniques in Data communication?
I. In circuit switching a dedicated path is identified between the sender and the receiver.
II. In packet switching each information to be transmitted between sender and receiver is broken down into smaller packets.
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (C) Both I and II
Explanation
Circuit switching sets up a dedicated path before transfer, and packet switching breaks the data into packets that are routed independently. Both are true.
Which of the following statement(s) is/are correct about red-black binary tree?
I. Every node is either red or black.
II. Every leaf node is red.
III. When a node is red and both its children are black.
AI and II
BI, II and III
CI and III
DIII and II
Show answerHide answer
Correct answer: (C) I and III
Explanation
In a red-black tree every node is red or black, and a red node's children must be black. Leaves (NIL nodes) are black, not red, so II is false.
Consider a max heap, represented by the array:
23, 17, 14, 6, 13, 10, 1, 5
If a value 20 is inserted into this heap, then what will be the new max heap
Add 20 at position 9 as the child of 6, then swap it with 6. Its parent is now 17, so swap again. The parent 23 is larger, so it stops: 23, 20, 14, 17, 13, 10, 1, 5, 6.
Consider the following graph.
Vertices P, Q, R, S, T with edges (weight): P–Q (30), Q–R (5), Q–S (20), Q–T (15), P–S (40), S–T (10), R–T (25).
What is the weight of minimum spanning tree?
A50
B60
C70
D80
Show answerHide answer
Correct answer: (B) 60
Explanation
Kruskal: take Q–R (5), S–T (10), Q–T (15); skip Q–S (20) and R–T (25), which would form cycles; take P–Q (30). Weight = 5 + 10 + 15 + 30 = 60.
________ act as a interface between a domain expert and an expert system.
ALanguage Editor
BK editor
CIntelligent editor
DKnowledge Editor
Show answerHide answer
Correct answer: (C) Intelligent editor
Explanation
In expert systems, the intelligent (knowledge-acquisition) editor is the interface the domain expert or knowledge engineer uses to enter and refine the knowledge base.
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.