Practice Set · Questions with answers

DSSSB TGT Computer Science Practice Set 2

All 100 questions of DSSSB TGT Computer Science Practice Set 2 with the correct answer and a solution. Read them free on UTpaper, or attempt the paper as a timed online test.

  • 100 questions
  • 100 explained
  • Free
Q1
Which data type is mostly returned by fetchall() method in Python-MySQL connectivity? Select the most common answer
  1. AA single list or an empty list, if no more rows are available.
  2. BA list of tuples or an empty list, if no more rows are available.
  3. CA list of dictionaries or an empty list, if no more rows are available.
  4. DA single tuples or an empty tuple, if no more rows are available.
Show answerHide answer

Correct answer: (B) A list of tuples or an empty list, if no more rows are available.

Explanation

cursor.fetchall() returns the remaining rows as a list of tuples (one tuple per row), or an empty list if no rows are left.

Q2
XML is designed to ______ and ______ data. Select the best pair of answers from the following options.
  1. ADesign, transport
  2. BStore, design
  3. CStore, transport
  4. DFormat, design
Show answerHide answer

Correct answer: (C) Store, transport

Explanation

XML was designed to store and transport data, while HTML was designed to display data.

Q3
How many times the below FOR LOOP gets executed ? <SCRIPT LANGUAGE = "VBScript"> Q = 29 FOR AGE = 5 to Q STEP 6 DOCUMENT.WRITE P NEXT </SCRIPT>
  1. A4 times
  2. B5 times
  3. CIt will not execute as STEP parameter is wrong
  4. DIt will not execute as P is not enclosed in ( )
Show answerHide answer

Correct answer: (B) 5 times

Explanation

Corrected: the book's key says (d). The loop runs for AGE = 5, 11, 17, 23, 29, i.e. 5 times.

Q4
What is the output of the following code snippet of VBScript ? 18 MOD 7+4*2−10
  1. A4
  2. B1
  3. C0
  4. D2
Show answerHide answer

Correct answer: (D) 2

Explanation

In VBScript, * is evaluated before MOD, and MOD before + and −. 18 MOD 7 = 4 and 4*2 = 8, so 4 + 8 − 10 = 2.

Q5
This question is based on following table : TABLE : DELIVERY SNO | DBOY | ITEM | STAR | AMOUNT 1001 | AMAN | FOOD | 5 | 3000 1005 | JONES | MEDICINE | 3 | 5000 1008 | AMAN | MEDICINE | 2 | 4000 1009 | RAZID | FOOD | 4 | 4500 1010 | JONES | GIFT | 5 | 5000 1018 | AMAN | FOOD | 5 | 3000 1022 | RAZID | MEDICINE | 4 | 5000 Which of the following SQL commands will remove the rows, which have column value of STAR less than 5 ?
  1. AREMOVE FROM DELIVERY WHERE STAR < 5;
  2. BDROP TABLE DELIVERY WHERE STAR < 5;
  3. CDELETE FROM DELIVERY WHERE STAR < 5;
  4. DDELETE * FROM DELIVERY WHERE STAR < 5;
Show answerHide answer

Correct answer: (C) DELETE FROM DELIVERY WHERE STAR < 5;

Explanation

DELETE FROM table WHERE condition removes matching rows. There is no REMOVE command, DROP removes the whole table, and DELETE * is not valid standard SQL.

Q6
Consider the following tables in a database SPORTS : Table 1 : STUDENTS ADMNO | SNAME 101 | AMAR 205 | MARIA 410 | MALALA Table 2 : GAMES GAMEID | GNAME G03 | CRICKET G05 | FOOTBALL Which of the following SQL Command will produce an output as : SNAME | GNAME AMAR | CRICKET MARIA | CRICKET MALALA | CRICKET AMAR | FOOTBALL MARIA | FOOTBALL MALALA | FOOTBALL
  1. ASELECT SNAME, GNAME FROM STUDENTS, GAMES;
  2. BSELECT SNAME, GNAME FROM STUDENTS X GAMES;
  3. CSELECT SNAME FROM STUDENTS, GNAME FROM GAMES;
  4. DSELECT SNAME FROM STUDENTS, SELECT GNAME FROM GAMES;
Show answerHide answer

Correct answer: (A) SELECT SNAME, GNAME FROM STUDENTS, GAMES;

Explanation

Listing two tables with no join condition gives their Cartesian product: every student paired with every game (3 × 2 = 6 rows), which matches the output.

Q7
This question is based upon the following class and code segment : class STOCK { float price ; public : STOCK( ) ; // Function 1 STOCK(float P) ; // Function 2 STOCK(STOCK &S) ; // Function 3 void INIT( ) ; // Function 4 void DISP( ) ; // Function 5 ~ STOCK( ) ; // Function 6 }; void main( ) { STOCK S2(10) ; // Statement 1 ______ ______ // Other Statements ______ } Which of the following declaration/statement will invoke the default constructor of the class - STOCK?
  1. ASTOCK S1(S2);
  2. BSTOCK S2;
  3. CSTOCK S1(20);
  4. DS2.INIT();
Show answerHide answer

Correct answer: (B) STOCK S2;

Explanation

Corrected: the book's key says (a), but STOCK S1(S2) calls the copy constructor. A declaration without arguments, like STOCK S2, invokes the default constructor.

Q8
Name the type of Inheritance if Activity, Teacher and SUPW are C++ Classes and → denotes inheritance. Activity ↓ Teacher ↓ SUPW
  1. AMulti Level Inheritance
  2. BMultiple Inheritance
  3. CSingle Level Inheritance
  4. DHybrid Inheritance
Show answerHide answer

Correct answer: (A) Multi Level Inheritance

Explanation

Teacher inherits from Activity, and SUPW inherits from Teacher. A chain of single inheritance like this is multilevel inheritance.

Q9
Which of the following is the correct order of problem solving steps ?
  1. ATesting and Debugging, Coding, Analysing the problem, Developing an Algorithm
  2. BDeveloping an Algorithm, Coding, Testing and Debugging, Analysing the problem
  3. CAnalysing the problem, Developing an Algorithm, Coding, Testing and Debugging
  4. DDeveloping an Algorithm, Analysing the problem, Coding, Testing and Debugging
Show answerHide answer

Correct answer: (C) Analysing the problem, Developing an Algorithm, Coding, Testing and Debugging

Explanation

Corrected: the book's key says (b). The standard order is: analyse the problem, develop an algorithm, code, then test and debug.

Q10
Which of the following can be considered as a unary as well as a binary operator ?
  1. A−
  2. B*
  3. C/
  4. D%
Show answerHide answer

Correct answer: (B) *

Explanation

Answer as per the book's key (b): * is binary multiplication and unary dereference. Note that − is also both unary and binary.

Q11
Which of the following options states the correct storage - device hierarchy in terms of decreasing access time?
  1. AMagnetic tape, magnetic disk, cache, main memory
  2. BMagnetic disk, optical disk, main memory, register
  3. CMagnetic tape, magnetic disk, main memory, register
  4. DRegister, main memory, magnetic disk, magnetic tape
Show answerHide answer

Correct answer: (C) Magnetic tape, magnetic disk, main memory, register

Explanation

Decreasing access time means going from slowest to fastest: magnetic tape, magnetic disk, main memory, register. Option A wrongly puts cache before main memory.

Q12
Interrupts are sent by ______ and received by ______.
  1. ACPU, I/O Devices
  2. BI/O Devices, CPU
  3. CTimer, I/O Devices
  4. DCPU, ALU
Show answerHide answer

Correct answer: (B) I/O Devices, CPU

Explanation

Corrected: the book's key says (a). Interrupts are sent by I/O devices and received by the CPU.

Q13
Name the top level object also known as the default object of the JavaScript Object Model.
  1. ADocument
  2. BBody
  3. CLocation
  4. DWindow
Show answerHide answer

Correct answer: (D) Window

Explanation

window is the top-level (global) object of the browser object model. document, location and others are its properties.

Q14
Which of the following is not an advantage of client - side scripting ?
  1. AFast processing as data is not sent to the server
  2. BGive developers more control over behaviour of web widgets
  3. CAllow for more interactivity by immediate responses to user's actions
  4. DGive developers more control for data repositories across systems
Show answerHide answer

Correct answer: (D) Give developers more control for data repositories across systems

Explanation

Client-side scripts run in the browser and give speed, control of widgets and interactivity. Managing data repositories across systems is done on the server side.

Q15
Which of the following C++ Statements will open a text file "VIEWS. TXT" in which read as well as write activities are required at the same time?
  1. AFstream F ("VIEWS.TXT", ios :: read | ios :: write);
  2. BFstream F ("VIEWS.TXT", ios :: in | ios :: out);
  3. CFstream F ("VIEWS.TXT", ios :: in | out);
  4. DFstream F ("VIEWS.TXT", ios :: read | write);
Show answerHide answer

Correct answer: (B) Fstream F ("VIEWS.TXT", ios :: in | ios :: out);

Explanation

An fstream opened with ios::in | ios::out allows both reading and writing. ios::read and ios::write do not exist.

Q16
Which of the following file stream function will not move the file pointer to (N+1)th record of a binary file F created with the help of objects of class EMPLOYEE ?
  1. AF. seekp (N*sizeof (EMPLOYEE));
  2. BF. seekg (F.tellg( )*N);
  3. CF. seekg (sizeof (EMPLOYEE)*N);
  4. DPOS = sizeof (EMPLOYEE)*N;
Show answerHide answer

Correct answer: (B) F. seekg (F.tellg( )*N);

Explanation

seekg(F.tellg()*N) multiplies the current position by N, which is not the offset of the (N+1)th record. The correct offset is N*sizeof(EMPLOYEE).

Q17
In Visual Basic, if CHR(65) is "A" what will be displayed in text box with following statement ? txtBox.Text = "A" & CHR(77) & "T"
  1. A657784
  2. BAMT
  3. CA M T
  4. D65 77 84
Show answerHide answer

Correct answer: (B) AMT

Explanation

CHR(77) is "M", and & joins strings, so "A" & "M" & "T" gives AMT.

Q18
In Visual Basic, variable declared inside a procedure are said to have ______ scope.
  1. AGLOBAL
  2. BLOCAL
  3. CMODULE-LEVEL
  4. DPROGRAM - LEVEL
Show answerHide answer

Correct answer: (B) LOCAL

Explanation

The book prints option (c) as LOCAL again; it has been replaced with MODULE-LEVEL so only one option is correct.

Q19
Which of the following statements about disk scheduling algorithms is correct ?
  1. AThe disk arm behaves like an elevator in SCAN algorithm
  2. BFCFS provides fastest service to the disk requests
  3. CSSTF algorithm is an optimal algorithm
  4. DSCAN algorithm provides more uniform wait time compared to C - SCAN algorithm
Show answerHide answer

Correct answer: (A) The disk arm behaves like an elevator in SCAN algorithm

Explanation

In SCAN, the disk arm moves to one end, then reverses, serving requests along the way, like an elevator. C-SCAN, not SCAN, gives more uniform waiting time.

Q20
Which of the following statements is incorrect?
  1. ACounting semaphore can be used to control access to finite number of instances of a resource
  2. BReader writers problem typically arises when several concurrent processes share the data base
  3. CBanker's algorithm prevents dead lock
  4. DA computer system is in a safe state only if there exists a safe sequence
Show answerHide answer

Correct answer: (C) Banker's algorithm prevents dead lock

Explanation

The banker's algorithm avoids deadlock (by checking for a safe state); it does not prevent it. Prevention means removing one of the four necessary conditions.

Q21
Determine the size of PROM required for implementing the 16-to-1 multiplexer.
  1. A1M x 1
  2. B2M x 1
  3. C8M x 1
  4. D32M x 1
Show answerHide answer

Correct answer: (A) 1M x 1

Explanation

A 16-to-1 MUX has 16 data inputs + 4 select lines = 20 inputs. A PROM needs 2²⁰ words × 1 output bit = 1M × 1.

Q22
The simplest, but most expensive, approach to introductory redundancy is duplicate to every disk. This technique is called
  1. ASwap space.
  2. BMirroring.
  3. CPage slots.
  4. DNone of these
Show answerHide answer

Correct answer: (B) Mirroring.

Explanation

Mirroring (RAID 1) keeps a duplicate copy of every disk. It is the simplest form of redundancy but the costliest, because storage is doubled.

Q23
Bridge works in which layer of the OSI model ?
  1. AApplication Layer
  2. BTransport Layer
  3. CNetwork layer
  4. DDatalink Layer
Show answerHide answer

Correct answer: (D) Datalink Layer

Explanation

A bridge filters and forwards frames using MAC addresses, so it works at the data link layer (layer 2).

Q24
The following figure is a ______ tree after zig_Zig rotations. Tree: root X; X has left child A and right child P; P has left child B and right child G; G has left child C and right child D.
  1. AHeap
  2. BBubble
  3. CSplay
  4. DBinary
Show answerHide answer

Correct answer: (C) Splay

Explanation

Zig-zig rotations are the restructuring steps of a splay tree, which move an accessed node up to the root.

Q25
The diagram below represents a solution to the ______ 8 x 8 board (rows 0-7, columns 0-7), one piece per row: Row 0: column 0 Row 1: column 6 Row 2: column 4 Row 3: column 7 Row 4: column 1 Row 5: column 3 Row 6: column 5 Row 7: column 2
  1. AKnights Tour.
  2. BEight Queens Problem.
  3. CKings Problem.
  4. DRooks Problem.
Show answerHide answer

Correct answer: (B) Eight Queens Problem.

Explanation

Each row and each column has exactly one piece, and no two pieces share a diagonal. This is a solution to the Eight Queens problem.

Q26
Determine the function performed by the combinational circuit of the given figure. Circuit: three 2-to-1 MUXes. MUX-1 has inputs I3 (to its I1) and I2 (to its I0). MUX-2 has inputs I1 (to its I1) and I0 (to its I0). The select lines of MUX-1 and MUX-2 are tied together to S1. The output Y of MUX-1 goes to input I1 of MUX-3 and the output Y of MUX-2 goes to input I0 of MUX-3. MUX-3 has select S0 and output F.
  1. A4-to-1 multiplexer
  2. B8-to-1 multiplexer
  3. C16-to-1 multiplexer
  4. D32-to1 multiplexer
Show answerHide answer

Correct answer: (A) 4-to-1 multiplexer

Explanation

MUX-1 and MUX-2 choose between I3/I2 and I1/I0 using S1, and MUX-3 chooses between their outputs using S0. Four inputs and two select lines make a 4-to-1 multiplexer.

Q27
A ______ multivibrator circuit is one in which both LOW and HIGH output states are stable.
  1. AMonostable
  2. BBistable
  3. CMultistable
  4. DTristable
Show answerHide answer

Correct answer: (B) Bistable

Explanation

A bistable multivibrator (flip-flop) has two stable states and stays in either HIGH or LOW until it is triggered.

Q28
How many characters does an escape sequence (\On, \Hn, \n, \f) in C++ consume?
  1. A1
  2. B3
  3. C2
  4. DNone of these
Show answerHide answer

Correct answer: (A) 1

Explanation

An escape sequence is written with two or more characters in the source code, but it represents and stores a single character, so it takes 1 character (1 byte).

Q29
The closeness of the recorded version to the original sound is called
  1. AFidelity.
  2. BDigitization.
  3. CSampling.
  4. DNyquil's theorem.
Show answerHide answer

Correct answer: (A) Fidelity.

Explanation

Fidelity is how closely the recorded or reproduced sound matches the original sound.

Q30
Which of the following topologies gives highest reliability ?
  1. AMesh topology
  2. BBus topology
  3. CStar topology
  4. DRing topology
Show answerHide answer

Correct answer: (A) Mesh topology

Explanation

In a mesh topology each device has dedicated links to the others, so a single link failure does not affect the network. This gives the highest reliability.

Q31
What is the length of an IP address in bytes (Pre-IPv6) ?
  1. A8
  2. B1
  3. C2
  4. D4
Show answerHide answer

Correct answer: (D) 4

Explanation

An IPv4 address is 32 bits = 4 bytes, usually written as four dotted decimal octets.

Q32
Buying and selling goods over the Internet is called :
  1. AEuro-Conversion
  2. BHyper-Marketing
  3. CCyber-Selling
  4. DE-Commerce
Show answerHide answer

Correct answer: (D) E-Commerce

Explanation

E-commerce (electronic commerce) means buying and selling goods and services over the Internet.

Q33
Which one of the following most accurately describes "multiple inheritance" ?
  1. AWhen a child class has both an "is a" and a "has a" relationship with its parent class.
  2. BWhen two classes inherit from each other.
  3. CWhen a base class has two or more derived classes.
  4. DWhen a child class has two or more parent classes.
Show answerHide answer

Correct answer: (D) When a child class has two or more parent classes.

Explanation

Multiple inheritance means one derived (child) class inherits from two or more base (parent) classes.

Q34
Which of the following is not a transaction management SQL command ?
  1. ARollback
  2. BCommit
  3. CSelect
  4. DSavepoint
Show answerHide answer

Correct answer: (C) Select

Explanation

COMMIT, ROLLBACK and SAVEPOINT are transaction control (TCL) commands. SELECT is a data query command.

Q35
Concurrency control in RDBMS is important for which of the following reasons ?
  1. ATo ensure data integrity when reads occur to the database in a multi-user environment.
  2. BTo ensure data integrity when updates occur to the database in a single-user environment.
  3. CTo ensure data integrity when updates occur to the database in a multi-user environment.
  4. DTo ensure data integrity when reads occur to the database in a single-user environment.
Show answerHide answer

Correct answer: (C) To ensure data integrity when updates occur to the database in a multi-user environment.

Explanation

Concurrency control keeps data consistent when several users update the database at the same time, preventing lost updates and inconsistent reads.

Q36
Consider the following code segment: if ( Y<0 ) {X = −X; Y = − Y;} Z = 0; while (Y>0) {Z = Z + X; Y = Y −1;} Assume that X, Y and Z are inter variables, and that X and Y have be initialized. Which of the following best describes what this code segment does?
  1. ASets Z to be the product X* Y
  2. BSets Z to be the sum X+Y
  3. CSets Z to be the absolute value of X
  4. DSets Z to be the value of Y
Show answerHide answer

Correct answer: (A) Sets Z to be the product X* Y

Explanation

If Y is negative, both signs are flipped. The loop then adds X to Z Y times, so Z = X × Y.

Q37
A combinational logic circuit that is used when it is desired to send data from two more source through a single transmission line is known as ______.
  1. ADe-multiplexer
  2. BEncoder
  3. CDecoder
  4. DMultiplexer
Show answerHide answer

Correct answer: (D) Multiplexer

Explanation

A multiplexer selects one of several inputs and sends it over a single output line, so many data sources can share one transmission line.

Q38
Anti-aliasing is important to improve the readability of text. It deals with the:
  1. AElimination of "jaggies".
  2. BSpacing between two individual characters.
  3. CUnderlining of letters.
  4. DSpacing of a group of characters.
Show answerHide answer

Correct answer: (A) Elimination of "jaggies".

Explanation

Anti-aliasing smooths the jagged, staircase edges ("jaggies") caused by pixel sampling, which makes text easier to read.

Q39
Consider a set of n tasks with known runtimes r1, r2 ........ rn, to be run on a uniprocessor machine, Which of the following processor scheduling algorithm will result in the maximum throughput.
  1. APriority scheduling
  2. BRound-robin
  3. CFCFS
  4. DShortest job first
Show answerHide answer

Correct answer: (D) Shortest job first

Explanation

Shortest Job First runs the shortest tasks first, so the average waiting time is minimised and the most jobs are completed per unit time.

Q40
Anti-aliasing is important to improve the readability of text. It deals with the:
  1. AElimination of "jaggies".
  2. BSpacing between two individual characters.
  3. CUnderlining of letters.
  4. DSpacing of a group of characters.
Show answerHide answer

Correct answer: (A) Elimination of "jaggies".

Explanation

Anti-aliasing smooths the jagged, staircase edges ("jaggies") caused by pixel sampling, which makes text easier to read.

Q41
Consider a set of n tasks with known runtimes r1, r2 ........ rn, to be run on a uniprocessor machine, Which of the following processor scheduling algorithm will result in the maximum throughput.
  1. APriority scheduling
  2. BRound-robin
  3. CFCFS
  4. DShortest job first
Show answerHide answer

Correct answer: (D) Shortest job first

Explanation

Shortest Job First runs the shortest tasks first, so the average waiting time is minimised and the most jobs are completed per unit time.

Q42
What shall be the 2's complement representation of 24 in a 16 bit computer?
  1. A1111 1111 1110 1011
  2. B1111 1111 1110 1001
  3. C1111 1111 1110 0111
  4. D1111 1111 1110 1000
Show answerHide answer

Correct answer: (D) 1111 1111 1110 1000

Explanation

24 = 0000 0000 0001 1000. Invert the bits (1111 1111 1110 0111) and add 1 to get 1111 1111 1110 1000, which is −24 in 2's complement.

Q43
The worst case complexity for searching an element in binary search tree is:
  1. AO(lgn)
  2. BO(nlgn)
  3. CO(n²)
  4. DO(n)
Show answerHide answer

Correct answer: (D) O(n)

Explanation

A skewed (degenerate) BST is like a linked list, so a search may have to visit all n nodes: O(n) in the worst case.

Q44
Which of the following expression results in zero?
  1. A(0+0+1)(0+0+1)
  2. B(0+0+0)(0+1+1)
  3. C(1+0+0)(1+1+1)
  4. D(0+1+0)(1+0+1)
Show answerHide answer

Correct answer: (B) (0+0+0)(0+1+1)

Explanation

In Boolean algebra, + is OR and · is AND. (0+0+0) = 0, so 0 · (0+1+1) = 0. Every other option has both factors equal to 1.

Q45
How many page faults occur in LRU page replacement algorithm for the given reference string, with four page frames. 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1
  1. A6
  2. B8
  3. C7
  4. D9
Show answerHide answer

Correct answer: (C) 7

Explanation

With LRU and 4 frames: 7, 0, 1, 2 are 4 faults; 3 replaces 7; 4 replaces 1; then 1 replaces 4. All other references are hits, so there are 7 page faults.

Q46
In VB, to change the size of a dynamic array, ______ is used at the point in the code where you want it to change.
  1. ADim
  2. BRedim
  3. CChdim
  4. DBydim
Show answerHide answer

Correct answer: (B) Redim

Explanation

ReDim resizes a dynamic array in VB (ReDim Preserve also keeps its existing contents). Dim only declares the array.

Q47
The producer and Consumer processes share the following Variables: int n, Semaphore M = 1 Semaphore E = n Semaphore F = 0 The consumer process must execute ______ and ______ before removing an item from buffer.
  1. ASignal (M), Signal (F)
  2. BSignal (M), Wait (F)
  3. CSignal (F), Wait (M)
  4. DWait (F), Wait (M)
Show answerHide answer

Correct answer: (D) Wait (F), Wait (M)

Explanation

A consumer first does wait(F) to make sure a full slot exists, then wait(M) for mutual exclusion on the buffer, and only then removes the item.

Q48
Which of the following is correct?
  1. AIn asymmetric multiprocessing, the processors are peers.
  2. BIn symmetric multiprocessing, the processors are placed symmetrically on the mother board.
  3. CClustered systems are used for high performance computing.
  4. DAll multiprocessor systems are multicore systems.
Show answerHide answer

Correct answer: (C) Clustered systems are used for high performance computing.

Explanation

Clustered systems join several computers to provide high availability and high-performance computing. In asymmetric multiprocessing the processors are not peers, and multiprocessor does not always mean multicore.

Q49
How many characters per second (7 bits + 1 parity) can be transmitted over a 2400 bps line if the transfer is asynchronous (1 start and 1 stop bit)?
  1. A240
  2. B250
  3. C275
  4. D300
Show answerHide answer

Correct answer: (A) 240

Explanation

Each character takes 1 start + 7 data + 1 parity + 1 stop = 10 bits, so 2400 / 10 = 240 characters per second.

Q50
Which of the following is not a record-based data model?
  1. ARelational model
  2. BHierarchical model
  3. CE-R model
  4. DNetwork model
Show answerHide answer

Correct answer: (C) E-R model

Explanation

The relational, hierarchical and network models are record-based logical models. The E-R model is an object-based conceptual model.

Q51
If transaction A holds a shared lock R and if transaction B also requests for a shared lock on R, it will
  1. AResult in a deadlock situation
  2. BImmediately be granted
  3. CImmediately be rejected
  4. DBe granted as soon as it is released by A
Show answerHide answer

Correct answer: (B) Immediately be granted

Explanation

Shared (read) locks are compatible with each other, so B's shared-lock request on R is granted immediately.

Q52
A data model is a collection of conceptual tools for describing
  1. AData and data relationship
  2. BData semantics and consistency constraints
  3. CData, data relationship, data semantics and consistency constraints
  4. DNone of the above
Show answerHide answer

Correct answer: (C) Data, data relationship, data semantics and consistency constraints

Explanation

A data model is a collection of conceptual tools for describing data, data relationships, data semantics and consistency constraints (Korth).

Q53
The difference (−) operation removes common tuples from the first relation. This operation is
  1. ACommutative and associative
  2. BNon-commutative and associative
  3. CCommutative and non-associative
  4. DNon-commutative and non-associative
Show answerHide answer

Correct answer: (D) Non-commutative and non-associative

Explanation

Corrected: the book's key says (b). Set difference is neither commutative (R − S ≠ S − R) nor associative.

Q54
The number of equivalence relations of the set {1, 2, 3, 4} is
  1. A4
  2. B24
  3. C25
  4. D15
Show answerHide answer

Correct answer: (D) 15

Explanation

The number of equivalence relations on a 4-element set equals the number of its partitions, which is the Bell number B₄ = 15.

Q55
What is the range of the following function? {(4, 8), (9, 2), (−3, −4)}
  1. A{4, 9, −3}
  2. B{8}
  3. C{(4, 8), (9, 2), (−3, −4)}
  4. D{8, 2, −4}
Show answerHide answer

Correct answer: (D) {8, 2, −4}

Explanation

The range is the set of second elements (outputs) of the ordered pairs: {8, 2, −4}.

Q56
In the given graph identify the cut vertices : Graph: vertices A, B, C, D, E; edges A-B, A-D, D-B, B-C, C-E.
  1. AB and E
  2. BC and D
  3. CA and E
  4. DC and B
Show answerHide answer

Correct answer: (D) C and B

Explanation

Removing B separates {A, D} from {C, E}, and removing C cuts off E. Removing A, D or E leaves the graph connected, so the cut vertices are B and C.

Q57
______ monitors user's activity on Internet and transmits that information in the backgroud to someone else.
  1. AMalware
  2. BSpyware
  3. CAdware
  4. DNone of the above
Show answerHide answer

Correct answer: (B) Spyware

Explanation

Spyware secretly monitors a user's activity, such as browsing and keystrokes, and sends that information to a third party in the background. Adware mainly shows unwanted advertisements.

Q58
Which one of the following is prefix representation of the infix expression A*(B+C)/D?
  1. A/*A+BCD
  2. BA+B/CD
  3. C+*AB/CD
  4. DNone of the above
Show answerHide answer

Correct answer: (A) /*A+BCD

Explanation

A*(B+C)/D is evaluated as (A*(B+C))/D. In prefix form this is / * A + B C D.

Q59
A B-Tree is of order p and consists of n keys. Its maximum height is
  1. Alog_(p/2) (n+1)/2
  2. Blog_p n
  3. Clog_(p/2) (n+1)
  4. DNone of the above
Show answerHide answer

Correct answer: (A) log_(p/2) (n+1)/2

Explanation

In a B-tree of order p, every non-root node has at least ⌈p/2⌉ children. So the maximum height is log base ⌈p/2⌉ of (n+1)/2.

Q60
The following postfix expression with single-digit operands is evaluated using a stack: 823^/23*+51*- (Note that ^ is the exponentiation operator.) The top two elements of the stack after the first * is evaluated, are
  1. A6, 1
  2. B5, 7
  3. C3, 2
  4. D1, 5
Show answerHide answer

Correct answer: (A) 6, 1

Explanation

8 2 3 ^ gives 2³ = 8, then 8 / 8 = 1. Next 2 and 3 are pushed and * gives 6. The stack now holds 1, 6, so the top two elements are 6 and 1.

Q61
A hash function defined as f(key) = key mod 7 with linear probing is used to insert the keys 37, 38, 72, 48, 98, 11, 56 into a table indexed from 0 to 6. What will be the location of 11?
  1. A3
  2. B4
  3. C5
  4. D6
Show answerHide answer

Correct answer: (C) 5

Explanation

37→2, 38→3, 72→2 (taken, goes to 3, then 4), 48→6, 98→0. 11 mod 7 = 4 is taken, so linear probing places 11 at slot 5.

Q62
Which of the following transmission media works on the principle of total internal reflection ?
  1. AOptical fiber cable
  2. BShielded twisted pair cable
  3. CUnshielded twisted pair cable
  4. DCoaxial cable
Show answerHide answer

Correct answer: (A) Optical fiber cable

Explanation

In optical fibre, light stays inside the glass core by total internal reflection at the core-cladding boundary.

Q63
The mechanism that brings a page into memory only when it is needed is called ______.
  1. APage replacement
  2. BSegmentation
  3. CFragmentation
  4. DDemand paging
Show answerHide answer

Correct answer: (D) Demand paging

Explanation

Demand paging loads a page into memory only when it is referenced, which triggers a page fault.

Q64
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?
  1. AIt computes the GCD of two numbers.
  2. BIt computes the LCM of two numbers.
  3. CIt finds the smallest of two numbers.
  4. DIt divides the largest number by the smaller.
Show answerHide answer

Correct answer: (A) It computes the GCD of two numbers.

Explanation

This is the subtraction form of Euclid's algorithm: repeatedly subtracting the smaller number from the larger one until both are equal leaves their GCD.

Q65
The Boolean expression (A + C) (AB' + AC) ((AC)' + B') can be simplified as :
  1. AA'B + BC
  2. BAB'
  3. CAB + BC
  4. DAB + A'C
Show answerHide answer

Correct answer: (B) AB'

Explanation

(A+C)(AB'+AC) = AB' + AC by absorption. Multiplying by (A' + B' + C') gives AB' + AB'C = AB'.

Q66
Which of the following is not a program control instruction ?
  1. ACMP
  2. BMOV
  3. CJMP
  4. DCALL
Show answerHide answer

Correct answer: (B) MOV

Explanation

MOV is a data transfer instruction. JMP and CALL change the flow of control, and CMP is used with jumps to make decisions, so these are program control instructions.

Q67
Based on the current technology, ______ is the fastest logic family.
  1. ACMOS
  2. BTTL
  3. CMOS
  4. DECL
Show answerHide answer

Correct answer: (D) ECL

Explanation

Emitter-Coupled Logic (ECL) is the fastest logic family, because its transistors never saturate, but it uses a lot of power.

Q68
Recursive procedures is implement using:
  1. AString
  2. BQueue
  3. CStack
  4. DLinked List
Show answerHide answer

Correct answer: (C) Stack

Explanation

Each recursive call pushes its return address and local variables onto a stack, so recursion is implemented with a stack.

Q69
For a tree with just one node, the root node is the height of a binary tree is defined to zero; if there are 2 levels of nodes, the height is 1 and so on. A Binary Search Tree is built according to the usual rules with the following six key inserted one at a time as given : B, I, N, A, R, Y. What is the height of the tree?
  1. A5
  2. B2
  3. C3
  4. D4
Show answerHide answer

Correct answer: (D) 4

Explanation

Inserting B, I, N, A, R, Y gives root B with A on the left and the chain I → N → R → Y to the right. The longest path B-I-N-R-Y has 4 edges, so the height is 4.

Q70
Which of the following methods in Java Script will display a window having a dialog box with a specified message, along with an OK and CANCEL button as options?
  1. Aprompt ()
  2. Balert ()
  3. Cconfirm ()
  4. Drequest ()
Show answerHide answer

Correct answer: (C) confirm ()

Explanation

confirm() shows a dialog with a message and OK and Cancel buttons and returns true or false. alert() has only OK, and prompt() also asks for text input.

Q71
To declare the version of XML. the correct syntax is :
  1. A</xml version = '1.0'/>
  2. B<?xml version = "1.0"/>
  3. C<*xml version = '1.0'/>
  4. D<?xml version = 1.0"/>
Show answerHide answer

Correct answer: (B) <?xml version = "1.0"/>

Explanation

The XML declaration is a processing instruction: <?xml version="1.0"?>. It begins with <?xml and the version value is quoted. Option B is the closest to this form.

Q72
Identify the Logical Operator used in Python out of the following.
  1. Aand
  2. Bin
  3. C<=
  4. D+=
Show answerHide answer

Correct answer: (A) and

Explanation

and is a logical operator in Python (as are or and not). in is a membership operator, <= is relational and += is assignment.

Q73
Which of the following cannot be used as a valid identifier in Python?
  1. A1st Name
  2. BName1
  3. CName_1
  4. DFirstName
Show answerHide answer

Correct answer: (A) 1st Name

Explanation

Python identifiers cannot start with a digit or contain spaces, so "1st Name" is invalid.

Q74
Which of the following Function Headers in a Python code will result in error?
  1. Adef Compu (X = 100, Y = 10, Z):
  2. Bdef Compu (X, Y, Z = 1):
  3. Cdef Compu (X=100, Y =10, Z=1):
  4. Ddef Compu (X, Y = 10, Z = 1):
Show answerHide answer

Correct answer: (A) def Compu (X = 100, Y = 10, Z):

Explanation

A parameter without a default value cannot follow parameters that have default values. def Compu(X=100, Y=10, Z): raises a SyntaxError.

Q75
Which method out of the following is used to write a line of content in a CSV file in a Phython program?
  1. AWriter
  2. BWriterow
  3. CWrite
  4. DWriteline
Show answerHide answer

Correct answer: (B) Writerow

Explanation

The csv writer object's writerow() method writes one row (line) to a CSV file. writerows() writes several rows.

Q76
Observe the following flowchart and find the output. Flowchart: START → A = 100, S = 0 → decision "IS A >= 20 ?": if YES → S += A → A −= 40 → back to the decision; otherwise → OUTPUT S → STOP.
  1. A180
  2. B120
  3. C100
  4. D160
Show answerHide answer

Correct answer: (A) 180

Explanation

A=100: S=100, A=60. A=60: S=160, A=20. A=20 (still ≥ 20): S=180, A=−20. The condition is now false, so the output is 180.

Q77
Observe the following graph and find the missing statement in the Python code. import matplotlib.pyplot as pl ______ pl. show() Graph: a single line joining the points (0.0, 5), (1.0, 2), (2.0, 3), (3.0, 1); x-axis 0.0 to 3.0, y-axis 1.0 to 5.0.
  1. Apl.bar ([5, 2, 3, 1])
  2. Bpl.scatter ([5, 2, 3, 1])
  3. Cpl.plot ([5, 2, 3, 1])
  4. Dpl.line ([5, 2, 3, 1])
Show answerHide answer

Correct answer: (C) pl.plot ([5, 2, 3, 1])

Explanation

pl.plot([5, 2, 3, 1]) draws a line graph, using the indexes 0-3 as x values. bar and scatter give different charts, and pl.line does not exist.

Q78
The number of attributes in a relation is called the ______ of the relation.
  1. ADegree
  2. BDomain
  3. CCardinality
  4. DTuyples
Show answerHide answer

Correct answer: (A) Degree

Explanation

The degree of a relation is its number of attributes (columns). Cardinality is the number of tuples (rows).

Q79
A school organizes an educational trip for middle school students to the Jim Corbett National Park. What would be the teachers' advisory to the children during the visit?
  1. AObserve everything without asking questions about it.
  2. BNote down their doubts and ask the questions after reaching back.
  3. CObserve keenly, make note and share observations with other fellow students and teacher.
  4. DEnjoy the trip along with fellow students.
Show answerHide answer

Correct answer: (C) Observe keenly, make note and share observations with other fellow students and teacher.

Explanation

Observing keenly, making notes and sharing observations encourages active, inquiry-based and collaborative learning.

Q80
The best method to teach the concept of the 'germination of a seed' is to:
  1. AProvide detailed explanations
  2. BDraw pictures on the board and givn descriptions
  3. CMake students plant seeds and observe germination
  4. DShow pictures of seed growth
Show answerHide answer

Correct answer: (C) Make students plant seeds and observe germination

Explanation

Learning by doing (planting seeds and watching them germinate) gives direct experience, which is the most effective way to teach this concept.

Q81
Rasleen is adding links to her company website. She wants to change the link colour as soon as the visitor's mouse hoven over the link and wants it should retain the original colour when visitor's mouse moves to any other location away from the link. Which of the following two event handless will be required to write a JavaScript code to achieve the same.
  1. AOnMouseOver and OnMouseExit
  2. BOnMouseOver and OnMouseOut
  3. COnMouseIn and OnMouseOut
  4. DOnMouseIn and OnMouseExit
Show answerHide answer

Correct answer: (B) OnMouseOver and OnMouseOut

Explanation

onmouseover fires when the pointer enters the link, and onmouseout fires when it leaves. There are no OnMouseIn or OnMouseExit events.

Q82
Which of the following is not a method of the window object in JavaScript ?
  1. Aopen( )
  2. Bclose( )
  3. Cname( )
  4. Dprompt( )
Show answerHide answer

Correct answer: (C) name( )

Explanation

open(), close() and prompt() are methods of the window object. name is a property (window.name), not a method.

Q83
The number of pointer changes required for inserting a node between two given nodes in the linked implementation of a doubly linked list is ______.
  1. AOne
  2. BTwo
  3. CThree
  4. DFour
Show answerHide answer

Correct answer: (D) Four

Explanation

The new node's next and prev pointers are set, and the next pointer of the previous node and the prev pointer of the following node are updated. That makes 4 pointer changes.

Q84
Which of the following options is the correct code for traversing a link list staring at pointer P, upto element X ?
  1. AWhile (P == NULL || P → Element ! = X) P = P → Next ;
  2. BWhile (P == NULL && P → Element ! = X) P = P → Next ;
  3. CWhile (P ! = NULL || P → Element ! = X) P = P → Next ;
  4. DWhile (P ! = NULL && P → Element ! = X) P = P → Next ;
Show answerHide answer

Correct answer: (D) While (P ! = NULL && P → Element ! = X) P = P → Next ;

Explanation

The loop must stop at the end of the list or when X is found, so it continues only while P != NULL && P→Element != X. Checking for NULL first also avoids dereferencing a null pointer.

Q85
Which of the following Boolean expression correctly represents the logic circuit diagram ? Circuit: A and B feed a NOR gate; C and D feed a second NOR gate; the outputs of both NOR gates feed an AND gate, whose output is the circuit output.
  1. A(A+B) . (C+D)
  2. B(A . B)' + (C . D)'
  3. CA . B + C . D
  4. D(A+B)' . (C+D)'
Show answerHide answer

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

Explanation

The NOR gates give (A+B)' and (C+D)', and the AND gate combines them, so the output is (A+B)' · (C+D)'.

Q86
In Boolean Algebra, the expression a + a . b is equivalent to:
  1. Aa
  2. Bb
  3. Ca . b
  4. Da + b
Show answerHide answer

Correct answer: (A) a

Explanation

By the absorption law, a + a·b = a(1 + b) = a·1 = a.

Q87
Ms. Rabda is a CEO of a multinational company and she is planning to connect 3 offices of nearby cities with the help of wired media. Out of the following which wired media you would suggest for the same.
  1. ACAT6 CABLE
  2. BCOAXIAL CABLE
  3. CTWO PAIR TELEPHONE CABLE
  4. DOPTIC FIBER CABLE
Show answerHide answer

Correct answer: (D) OPTIC FIBER CABLE

Explanation

Optical fibre gives high bandwidth over long distances with little loss and no electromagnetic interference, so it is best for linking offices in different cities.

Q88
What is the full form for GSM ?
  1. AGeneral System for Mobile Communication
  2. BGlobal Synchronization for Mobile Communication
  3. CGlobal System for Mobile Communication
  4. DGlobal System for Mobile Community
Show answerHide answer

Correct answer: (C) Global System for Mobile Communication

Explanation

GSM stands for Global System for Mobile Communication, the 2G digital cellular standard.

Q89
A Trial Balance is prepared mainly to:
  1. ACalculate depreciation
  2. BFind the profit of the business
  3. CCheck the arithmetical accuracy of ledger accounts
  4. DPrepare invoices
Show answerHide answer

Correct answer: (C) Check the arithmetical accuracy of ledger accounts

Explanation

A Trial Balance lists all ledger balances to check that total debits equal total credits, which tests the arithmetical accuracy of the ledger accounts.

Q90
Which book is maintained to record only credit sales of goods?
  1. ACash Book
  2. BPurchase Book
  3. CSales Book
  4. DJournal Proper
Show answerHide answer

Correct answer: (C) Sales Book

Explanation

The Sales Book (Sales Journal) records only credit sales of goods. Cash sales go to the Cash Book.

Q91
A child has a schema for a dog based on his experience with his pet, then when he sees another dog in the garden, he is able to recognize the animal. Which process of cognitive development is highlighted in the statement?
  1. AAssimilation
  2. BAccommodation
  3. COperation
  4. DEquilibrium
Show answerHide answer

Correct answer: (A) Assimilation

Explanation

Fitting a new experience (another dog) into an existing schema is assimilation in Piaget's theory. Accommodation means changing the schema itself.

Q92
The student behaves aggressively in the classroom, he needs help in :
  1. AHigh order thinking skills
  2. Bcognitive domain of learning
  3. Caffective domain of learning
  4. Dpsychomotor domain of learning
Show answerHide answer

Correct answer: (C) affective domain of learning

Explanation

Aggression relates to emotions, attitudes and behaviour, which belong to the affective domain of learning.

Q93
Which domain is also called as conative domain of learning ?
  1. ACognitive
  2. BAffective
  3. CPsycho-motor
  4. DHigh order thinking skills
Show answerHide answer

Correct answer: (C) Psycho-motor

Explanation

The psychomotor domain (doing, action) is also called the conative domain. Cognitive is knowing and affective is feeling.

Q94
According to piaget, at which stage do children learn about their environment through the senses?
  1. ASensory motor stage (2years of birth)
  2. BFormal operational stage (After 12 years)
  3. CConcrete operational stage (7 to 12 years)
  4. DPre-operational stage (2-7 years)
Show answerHide answer

Correct answer: (A) Sensory motor stage (2years of birth)

Explanation

In Piaget's sensorimotor stage (birth to 2 years), infants learn about the world through their senses and motor actions.

Q95
Which psychologist talked about the period of latency in the theory of sexual development?
  1. AFreud
  2. BPiaget
  3. CErikson
  4. DVygotsky
Show answerHide answer

Correct answer: (A) Freud

Explanation

Sigmund Freud described the latency period (about 6 years to puberty) as one of the stages of psychosexual development.

Q96
Which psychologist spoke of private speech for self-regulation?
  1. AVygotsky
  2. BPiaget
  3. CKohlberg
  4. DRousseau
Show answerHide answer

Correct answer: (A) Vygotsky

Explanation

Vygotsky said that private speech (talking to oneself) helps children guide and regulate their own thinking and behaviour.

Q97
In the revised version of Bloom's Taxonomy in 2001, the noun 'synthesis was changed to which of the following verb ?
  1. Acreating
  2. Bdefining
  3. Cblending
  4. Dcombining
Show answerHide answer

Correct answer: (A) creating

Explanation

In the 2001 revision by Anderson and Krathwohl, the nouns were changed to verbs, and synthesis became "creating", placed at the top level.

Q98
During the pandemic, it has been on easy journey for students of private schools to continue their studies, while it has been a difficult one for students of government schools. Which characteristic of social culture is being highlighted in the above situation?
  1. ACultural spread
  2. BTechnical factor
  3. CPhysical factor
  4. DPolitical factor
Show answerHide answer

Correct answer: (B) Technical factor

Explanation

Private-school students could continue studying because they had better access to digital devices and the internet. The gap is a technological (digital divide) factor.

Q99
At which stage of child development, does the child feel that every body is looking at them and they become conscious ?
  1. AChildhood
  2. BAdolescence
  3. CAdulthood
  4. DInfant
Show answerHide answer

Correct answer: (B) Adolescence

Explanation

Adolescents feel that everyone is watching them (Elkind's "imaginary audience"), so they become very self-conscious.

Q100
At which stage of child development does children most enjoy fictional stories like fairy tales?
  1. ANewborn
  2. BAdulthood
  3. CAdolescence
  4. DChild
Show answerHide answer

Correct answer: (D) Child

Explanation

In childhood (early childhood), imagination is strong, so children enjoy fictional stories such as fairy tales the most.

Practise it as a real test

Reading answers is not the same as solving under time pressure. Attempt DSSSB TGT Computer Science Practice Set 2 online with the real 60-minute timer and marking scheme to get your score and all-India rank, or browse the other tests in the DSSSB TGT Computer Science Mock Test & Previous Year Papers.