Practice Set · Questions with answers

DSSSB TGT Computer Science Practice Set 5

All 100 questions of DSSSB TGT Computer Science Practice Set 5 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
Name the tag and the attribute to be used to change the sequence of the list items in an ordered list from numbers to upper case letters
  1. ATag-<OL>, Attribute - START
  2. BTag-<OL>, Attribute - VALUE
  3. CTag-<OL>, Attribute - TYPE
  4. DTag-<OL>, Attribute - CASE
Show answerHide answer

Correct answer: (C) Tag-<OL>, Attribute - TYPE

Explanation

The TYPE attribute of <OL> sets the numbering style; TYPE="A" gives upper-case letters (A, B, C...). START only sets the starting value, and VALUE belongs to <LI>.

Q2
Which of the following file stream function will move the file pointer to Nth record in a binary file F created with the help of objects of class EMP?
  1. AF.tellg(N)
  2. BF.seekp(N)
  3. CF.seekp((N−1)* sizeof(EMP))
  4. DF.seekp(sizeof(EMP)/N)
Show answerHide answer

Correct answer: (C) F.seekp((N−1)* sizeof(EMP))

Explanation

Records are stored one after another, so the Nth record begins after N−1 records, at byte offset (N−1)*sizeof(EMP). seekp() moves the put pointer there; tellg() only reports the current position.

Q3
Which of the following best describes an attribute/column in a table?
  1. AIt is a set of numeric values in a table
  2. BIt is a set of string values in a table
  3. CIt is a vertical subset of a table
  4. DIt is a horizontal subset of a table
Show answerHide answer

Correct answer: (C) It is a vertical subset of a table

Explanation

Corrected: the book's key says (a), but its own explanation says a column is a vertical subset of a table.

Q4
In Visual Basic, if ASC ("A") is 65, what will be ASC ("E") ?
  1. A69
  2. BError
  3. C68
  4. D70
Show answerHide answer

Correct answer: (A) 69

Explanation

ASCII codes of letters are consecutive: A=65, B=66, C=67, D=68, so E = 65 + 4 = 69.

Q5
In Visual Basic, the constructs in which an IF block is contained inside another IF block are called:
  1. AChain of IF blocks
  2. BSequential IF blocks
  3. CNested IF blocks
  4. DSerial IF blocks
Show answerHide answer

Correct answer: (C) Nested IF blocks

Explanation

An IF block placed inside another IF block is a nested IF; the inner condition is checked only when the outer one is true.

Q6
Which of the following statements is not correct?
  1. ALinked allocation of disk space allows only sequential access of data.
  2. BIndexed allocation of disk space allows direct access to disk blocks.
  3. CThere is no internal fragmentation in contiguous allocation of disk space.
  4. DThere is no external fragmentation in linked allocation of disk space.
Show answerHide answer

Correct answer: (C) There is no internal fragmentation in contiguous allocation of disk space.

Explanation

Contiguous allocation does suffer internal fragmentation, since a file's last block is usually only partly filled; its main problem is external fragmentation. The other three statements are correct.

Q7
Consider the following statements about deadlock: A. Existence of a cycle in resource-allocation graph indicates deadlock. B. Existence of a cycle in wait-for graph indicates deadlock. C. Mutual-exclusion, hold and wait, no preemption and circular wait conditions, if occur simultaneously, may lead to deadlock. Mark the correct option :
  1. AOnly (b) is correct
  2. BOnly (c) is correct
  3. COnly (a) and (c) are correct
  4. DOnly (b) and (c) are correct
Show answerHide answer

Correct answer: (D) Only (b) and (c) are correct

Explanation

Corrected: the book's key says (c). A cycle in a resource-allocation graph does not always mean deadlock (with multiple instances), so A is false; B and C are correct.

Q8
In order to interpret XML documents, you need to :
  1. AUse standardized predefined tags
  2. BSpecify the tags separately in a file
  3. CHave a document type definition for the tags
  4. DUse standardized HTML tags
Show answerHide answer

Correct answer: (C) Have a document type definition for the tags

Explanation

XML has no predefined tags, so the meaning and allowed structure of user-made tags must be described in a Document Type Definition (DTD) or schema.

Q9
XML is a Subset of :
  1. AHTML
  2. BSGML
  3. CDGML
  4. DGML
Show answerHide answer

Correct answer: (B) SGML

Explanation

XML is a simplified subset of SGML (Standard Generalized Markup Language), the meta-language from which HTML was also derived.

Q10
This question is based on the following SQL Table. Mr. Aman, a Computer Science Teacher maintains the details of his class 12 Students is a SQL table as follow : Table Name : MYSTUDENT ROLLNO | NAME | SEC | MARKS 80105 | MARIA | A | 83.0 80108 | AMAR | B | 44.0 80109 | MANPREET | A | 92.0 80112 | SAMEER | A | 81.0 80115 | AKBAR | B | NULL Identify the most Suitable Command to display the merit List of his students where the details will be displayed in descending order of their marks. If some students have same MARKs, their detail will be displayed in ascending order of their ROLLNO.
  1. ASELECT * FROM MYSTUDENT ORDER BY DESC MARKS, ASC ROLLNO;
  2. BSELECT * FROM MYSTUDENT ORDER BY MARKS DESC, ROLLNO ASC;
  3. CSELECT * FROM MYSTUDENT ORDER BY MARKS; ROLLNO DESC, ASC;
  4. DSELECT * FROM MYSTUDENT ORDER BY MARKS DESC; ROLLNO ASC;
Show answerHide answer

Correct answer: (B) SELECT * FROM MYSTUDENT ORDER BY MARKS DESC, ROLLNO ASC;

Explanation

ORDER BY takes the column first and the direction after it, separated by commas: ORDER BY MARKS DESC, ROLLNO ASC sorts by marks high to low and breaks ties by roll number ascending. The other options have wrong syntax.

Q11
This question is based on the following SQL Table. Mr. Aman, a Computer Science Teacher maintains the details of his class 12 Students is a SQL table as follow : Table Name : MYSTUDENT ROLLNO | NAME | SEC | MARKS 80105 | MARIA | A | 83.0 80108 | AMAR | B | 44.0 80109 | MANPREET | A | 92.0 80112 | SAMEER | A | 81.0 80115 | AKBAR | B | NULL Which of the following command can display the SEC wise Average of the student ?
  1. ASELECT SEC, AVG (MARKS) FROM MYSTUDENT ORDER BY SEC;
  2. BSELECT SEC, AVG (MARKS) FROM MYSTUDENT GROUP BY MARKS;
  3. CSELECT *SEC, AVG (MARKS) FROM MYSTUDENT GROUP BY SEC;
  4. DSELECT AVG (MARKS) FROM MYSTUDENT ORDER BY SEC;
Show answerHide answer

Correct answer: (C) SELECT *SEC, AVG (MARKS) FROM MYSTUDENT GROUP BY SEC;

Explanation

Section-wise averages need GROUP BY SEC with SELECT SEC, AVG(MARKS); ORDER BY only sorts and does not form groups, and GROUP BY MARKS groups the wrong column. Option C is the intended query (the "*" is a printing slip).

Q12
Consider the following expression tree. Tree: root is '+'; its left child is 'a' and its right child is '*'; the '*' node has left child 'b' and right child 'c'. In-order, pre-order and post-order traversal of this tree will result into which of the following expressions, respectively.
  1. Aa+bc*, +a*bc, abc*+
  2. Ba+b*c, +abc*, abc*+
  3. Ca+b*c, +a*bc, abc*+
  4. Da+b*c, +a*bc, abc+*
Show answerHide answer

Correct answer: (C) a+b*c, +a*bc, abc*+

Explanation

In-order (left, root, right) gives a+b*c, pre-order (root first) gives +a*bc, and post-order (root last) gives abc*+.

Q13
Running time of a 'for' loop is ______ the running time of the statements inside the for loop times the number of iterations.
  1. AAtleast
  2. BAtmost
  3. CEqual to
  4. DIndependent of
Show answerHide answer

Correct answer: (B) Atmost

Explanation

The loop body runs once per iteration, so the loop's running time is at most the time of the statements inside it (including the test) multiplied by the number of iterations.

Q14
Identify the Hexadecimal equivalent of the decimal number. (3245)10 = ( ? )16
  1. ACBF
  2. BCED
  3. CCAD
  4. DCBA
Show answerHide answer

Correct answer: (C) CAD

Explanation

3245 ÷ 16 = 202 remainder 13 (D); 202 ÷ 16 = 12 remainder 10 (A); 12 = C. Reading upward gives CAD.

Q15
Binary equivalent of the Hexadecimal number (7A4)₁₆ is :
  1. A(11110100100)₂
  2. B(10000101111)₂
  3. C(10010001111)₂
  4. D(10000010100)₂
Show answerHide answer

Correct answer: (A) (11110100100)₂

Explanation

Replace each hex digit with 4 bits: 7 = 0111, A = 1010, 4 = 0100, giving 011110100100 = 11110100100.

Q16
The ______ is a popular high-bandwidth, processor independent bus that can function as a mezzanine or peripheral bus.
  1. APeripheral component interconnect (PCI)
  2. BPeripheral component disconnect (PCD)
  3. CInput output connect
  4. DArray connect
Show answerHide answer

Correct answer: (A) Peripheral component interconnect (PCI)

Explanation

PCI (Peripheral Component Interconnect) is a high-bandwidth, processor-independent bus that can work as a mezzanine or peripheral bus.

Q17
Sequential, direct, random and associative are access methods and key characteristics of computer ______ system.
  1. AStack
  2. BCounter
  3. CMemory
  4. DCore
Show answerHide answer

Correct answer: (C) Memory

Explanation

Sequential, direct, random and associative access are the access methods used to describe computer memory systems.

Q18
The file size of a 640 by 480 picture of 256 colours in a 8-bit resolution is
  1. A300 KB
  2. B900 KB
  3. C128 KB
  4. D1024 KB
Show answerHide answer

Correct answer: (A) 300 KB

Explanation

256 colours need 8 bits = 1 byte per pixel. 640 × 480 = 307,200 bytes, and 307,200 ÷ 1024 = 300 KB.

Q19
The diagram below depicts : Figure: a repeating sine-like wave plotted against time (in seconds) on the horizontal axis; the vertical extent is marked 'amplitude', the distance between two successive peaks is marked 'period', the top of a wave is labelled 'crest' and the bottom is labelled 'trough'.
  1. ASound in wave form.
  2. BWind frequency.
  3. CLine of sight.
  4. DCompressions on a map.
Show answerHide answer

Correct answer: (A) Sound in wave form.

Explanation

The figure shows a wave with amplitude, period, crest and trough plotted against time, which is how a sound wave is represented.

Q20
A transient of 100 ms is to be captured on a digital storage oscilloscope on full screen in the horizontal direction. If the transient is to be recorded at a sampling rate of 100 KS/s, what should the minimum size of the acqisition memory be ?
  1. A5K
  2. B10K
  3. C15K
  4. D20K
Show answerHide answer

Correct answer: (B) 10K

Explanation

Samples needed = sampling rate × time = 100,000 per second × 0.1 s = 10,000 samples, so the acquisition memory must hold at least 10K.

Q21
Prolog in XML contains an XML declaration like
  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: (A) <?xml version="1.0">

Explanation

The XML declaration in the prolog starts with <?xml, as in <?xml version="1.0"?>. Option A is the only one that uses the <? processing-instruction form.

Q22
A web page contains many small images. We can speed up the performance of the browser by
  1. AHaving multiple processes executed simultaneously.
  2. BHaving multiple threads.
  3. CIncreasing the speed of the transmission lipe.
  4. DIncreasing the main memory of the system.
Show answerHide answer

Correct answer: (B) Having multiple threads.

Explanation

With multiple threads the browser can download and render several small images at the same time instead of one after another, which speeds up loading.

Q23
The percentage resolution of an eight bit D/A converter is
  1. A0.39%
  2. B0.38%
  3. C0.50%
  4. D0.51%
Show answerHide answer

Correct answer: (A) 0.39%

Explanation

Resolution = 1/(2⁸ − 1) = 1/255 ≈ 0.0039, which is about 0.39%.

Q24
The diagram below represents Figure: a log-scale graph of 'Transistors per chip' (10³ to 10⁹) on the vertical axis against years 1970 to 2010 on the horizontal axis; the plotted points rise along a straight line on the log scale (doubling at regular intervals), ending at a '1 billion transistor CPU' near 2010.
  1. AMoore' law.
  2. BNewton Raphson method.
  3. CBoyle's law.
  4. DGregor law.
Show answerHide answer

Correct answer: (A) Moore' law.

Explanation

The log-scale graph shows transistors per chip doubling at regular intervals, which is Moore's law.

Q25
______ is the first Intel x86 microprocessor with a dual core, referring to the implementation of two processors on a single chip.
  1. ACore
  2. BCore 2 duo
  3. CDual core
  4. DCentrino
Show answerHide answer

Correct answer: (A) Core

Explanation

Following Stallings' list of Intel processors, the Intel Core was the first x86 microprocessor with a dual core, meaning two processors on a single chip. Core 2 Duo came later.

Q26
Program counter contents indicate :
  1. AThe time needed to execute a program.
  2. BThe time elapsed since execution begins.
  3. CThe address where next instruction is stored.
  4. DThe count of programs being executed after switching the power ON.
Show answerHide answer

Correct answer: (C) The address where next instruction is stored.

Explanation

The program counter holds the address of the next instruction to be fetched and executed.

Q27
Semaphores are used to solve the problem of ______.
  1. AMutual exclusion
  2. BRace condition
  3. CProcess synchronization
  4. DThe belady problem
Show answerHide answer

Correct answer: (C) Process synchronization

Explanation

Semaphores are a synchronization tool. They control how concurrent processes access shared resources, which solves process synchronization problems, including mutual exclusion.

Q28
The logic circuit of binary adder which is used to add two 4-bits binary numbers, requires ______ half adder (s) and ______ full adder (s).
  1. A4 , 0
  2. B1 , 3
  3. C2 , 2
  4. D3 , 1
Show answerHide answer

Correct answer: (B) 1 , 3

Explanation

The least significant bit has no incoming carry, so a half adder is enough there. The other three bit positions must add a carry, so they need full adders: 1 half adder and 3 full adders.

Q29
The 10Base5 cabling is also known as ______.
  1. AFast Ethernet
  2. BThick Ethernet
  3. CThin Ethernet
  4. DGigabit Ethernet
Show answerHide answer

Correct answer: (B) Thick Ethernet

Explanation

10Base5 is the original Ethernet on thick coaxial cable (10 Mbps, 500 m segments), known as Thick Ethernet or Thicknet. 10Base2 is Thin Ethernet.

Q30
Which of the following memory improves the speed of execution of a program?
  1. AVirtual memory
  2. BPrimary memory
  3. CSecondary memory
  4. DCache memory
Show answerHide answer

Correct answer: (D) Cache memory

Explanation

Cache memory is a small, very fast memory between the CPU and main memory. It keeps frequently used data close to the processor, which cuts access time.

Q31
Which of the following statements is false with respect to Relational DBMS?
  1. AA disadvantage of highly normalized tables is that queries may require too many time consuming joins.
  2. BForeign key constraints are referential integrity constraints.
  3. CA primary key uniquely indentifies a row in a table.
  4. DNulls reduce space requirements in tables.
Show answerHide answer

Correct answer: (D) Nulls reduce space requirements in tables.

Explanation

The false statement is D: nulls do not reduce storage. They mark missing values and often still take up space. Too many joins, foreign keys as referential integrity, and primary keys as unique identifiers are all correct.

Q32
A register in the microprocessor that keeps track of the answer or result of any arithmetic or logic operation is the ______.
  1. AAccumulator
  2. BStack pointer
  3. CProgram counter
  4. DInstruction pointer
Show answerHide answer

Correct answer: (A) Accumulator

Explanation

The accumulator is the register that holds the result of arithmetic and logic operations in the ALU.

Q33
If the time quantum size is 2 units of an there is only one job of 14 time unit in a ready queue, the round-robin scheduling algorithm will cause ______ context switches.
  1. A8
  2. B5
  3. C6
  4. D7
Show answerHide answer

Correct answer: (C) 6

Explanation

14 units ÷ 2 per quantum = 7 time slices. The job is preempted at the end of each of the first 6 slices, so there are 6 context switches.

Q34
In the context of Visual Basic, multiple controls of the same type can be grouped into an array, in the same manner as a collection of data items. Such a grouping is known as :
  1. AControl array
  2. BPrimary array
  3. CSecondary array
  4. DAn integer array
Show answerHide answer

Correct answer: (A) Control array

Explanation

A control array is a group of controls of the same type that share one name and are told apart by an Index property.

Q35
Consider two database relations R and S having 3 tuples in R and 2 tuples in S. What is the maximum number of tuples that could appear in the natural join of R and S?
  1. A6
  2. B2
  3. C3
  4. D5
Show answerHide answer

Correct answer: (A) 6

Explanation

At most, the natural join can produce every combination, as when there are no common attributes or every row shares the same common value. That is 3 × 2 = 6 tuples.

Q36
In the context of Visual Basic, multiple controls of the same type can be grouped into an array, in the same manner as a collection of data items. Such a grouping is known as :
  1. AControl array
  2. BPrimary array
  3. CSecondary array
  4. DAn integer array
Show answerHide answer

Correct answer: (A) Control array

Explanation

A control array is a group of controls of the same type that share one name and are told apart by an Index property.

Q37
Consider two database relations R and S having 3 tuples in R and 2 tuples in S. What is the maximum number of tuples that could appear in the natural join of R and S?
  1. A6
  2. B2
  3. C3
  4. D5
Show answerHide answer

Correct answer: (A) 6

Explanation

At most, the natural join can produce every combination, as when there are no common attributes or every row shares the same common value. That is 3 × 2 = 6 tuples.

Q38
The ______ attribute of <TABLE> tag is used to control the distance between the data in a cell and the boundaries of the cell.
  1. AColspan
  2. BRowspan
  3. CCellpadding
  4. DCellspacing
Show answerHide answer

Correct answer: (C) Cellpadding

Explanation

CELLPADDING sets the space between a cell's content and its border. CELLSPACING sets the space between neighbouring cells.

Q39
File operations that manipulate the 'open-count' maintained for each entry in open-file table include:
  1. AOpen, write
  2. BRead, write
  3. CWrite, close
  4. DOpen, close
Show answerHide answer

Correct answer: (D) Open, close

Explanation

The open-count records how many processes have the file open. open() increments it and close() decrements it, and the entry is removed when it reaches zero.

Q40
Given the list of tasks in Col-A and list of data structure in Col-B. Identify the best match. Col-A | Col-B A. Recursion | (i) Binary tree B. Scheduling | (ii) Stack C. Sorting | (iii) Queue
  1. AA-(i), B-(iii), C-(ii)
  2. BA-(ii), B-(i), C-(iii)
  3. CA-(iii), B-(ii), C-(i)
  4. DA-(ii), B-(iii), C-(i)
Show answerHide answer

Correct answer: (D) A-(ii), B-(iii), C-(i)

Explanation

Recursion uses a stack of activation records, scheduling uses a queue (first come, first served), and sorting can use a binary tree (as in a BST or heap).

Q41
______ operation preserves those tuples that would be lost in ______.
  1. ANatural join, outer join
  2. BOuter join, natural join
  3. CLeft outer join, right outer join
  4. DLeft outer join, natural join
Show answerHide answer

Correct answer: (B) Outer join, natural join

Explanation

An outer join keeps the unmatched tuples, padded with NULLs, that a natural join would drop.

Q42
Which of the following applications may use a stack? (A) Parenthesis balancing program (B) Process scheduling in operating system (C) Conversion of infix arithmetic expression to postfix form
  1. A(A) and (B)
  2. B(B) and (C)
  3. C(A) and (C)
  4. D(A), (B) and (C)
Show answerHide answer

Correct answer: (C) (A) and (C)

Explanation

Stacks are used for parenthesis balancing and infix-to-postfix conversion, so (A) and (C) are correct. Process scheduling uses queues, not stacks.

Q43
In which of the following, the density of the core remains constant from the center to the edges?
  1. ASingle mode fiber
  2. BMultimode step-index fiber
  3. CMultimode graded-index fiber
  4. DSingle mode step-index fiber
Show answerHide answer

Correct answer: (B) Multimode step-index fiber

Explanation

In a multimode step-index fiber, the core has the same density (refractive index) everywhere, with a sudden step at the cladding. In graded-index fiber the density changes gradually.

Q44
MPEG involves both spatial compression and temporal compression. The spatial compression is similar to JPEG and temporal compression removes ______ frames.
  1. AVoice
  2. BSpatial
  3. CTemporal
  4. DRedundant
Show answerHide answer

Correct answer: (D) Redundant

Explanation

MPEG temporal compression removes redundant frames. Consecutive frames are largely the same, so only the differences from reference frames are stored.

Q45
______ variables are not reinitialized each times Visual Basic invokes a procedure and thus retains or preserves value even when a procedure ends.
  1. AStatic
  2. BDynamic
  3. CVirtual
  4. DPrivate
Show answerHide answer

Correct answer: (A) Static

Explanation

A Static variable keeps its value between procedure calls. It is not reinitialized each time the procedure runs.

Q46
What is data encryption standard (DES)?
  1. ABlock cipher
  2. BStream cipher
  3. CBit cipher
  4. DNone of the above
Show answerHide answer

Correct answer: (A) Block cipher

Explanation

DES is a symmetric block cipher that encrypts data in 64-bit blocks with a 56-bit key.

Q47
Which of the following represents stealing the ideas or stealing the creations of others?
  1. APlagiarism
  2. BIntellectual Property Rights
  3. CPiracy
  4. DAll of the above
Show answerHide answer

Correct answer: (A) Plagiarism

Explanation

Plagiarism is presenting someone else's ideas or creations as your own. Piracy is unauthorized copying, and IPR is the legal protection itself.

Q48
Which of the following protocols may be used for accessing World Wide Web?
  1. AHTTP
  2. BSMTP
  3. CSLIP
  4. DNone of the above
Show answerHide answer

Correct answer: (A) HTTP

Explanation

HTTP (HyperText Transfer Protocol) is used to access web pages on the World Wide Web. SMTP is for email, and SLIP is a serial-line link protocol.

Q49
Web pages are created in a language called
  1. ASLIP
  2. BHTML
  3. CHTTP
  4. DWWW
Show answerHide answer

Correct answer: (B) HTML

Explanation

Web pages are written in HTML (HyperText Markup Language). HTTP is the protocol that transfers them.

Q50
The Boolean expression X + X'Y equals
  1. AX + Y
  2. BX + XY
  3. CX + YX
  4. DX' Y + Y' X
Show answerHide answer

Correct answer: (A) X + Y

Explanation

X + X'Y = (X + X')(X + Y) = 1·(X + Y) = X + Y, by the distributive law.

Q51
A computer has 32 MB memory. How many bits are needed to access any single byte in the memory?
  1. A25
  2. B16
  3. C24
  4. D20
Show answerHide answer

Correct answer: (A) 25

Explanation

32 MB = 32 × 2²⁰ bytes = 2⁵ × 2²⁰ = 2²⁵ bytes, so 25 address bits are needed.

Q52
A computer has 128MB memory. Each word in this computer is of 8 bytes. How many bits are required to address any single word in the memory?
  1. A27
  2. B24
  3. C23
  4. D25
Show answerHide answer

Correct answer: (B) 24

Explanation

128 MB = 2²⁷ bytes. With 8 bytes (2³) per word that is 2²⁷/2³ = 2²⁴ words, so 24 bits are needed.

Q53
To achieve parallelism, one needs a minimum of
  1. A2 processors
  2. B3 processors
  3. C4 processors
  4. DNone of the above
Show answerHide answer

Correct answer: (A) 2 processors

Explanation

Parallelism means tasks really run at the same time, which needs at least two processors.

Q54
What is common in three different types of traversals (inorder, preorder and postorder)?
  1. ARoot is visited before right subtree
  2. BLeft subtree is always visited before right subtree
  3. CRoot is visited after left subtree
  4. DAll of the above
Show answerHide answer

Correct answer: (B) Left subtree is always visited before right subtree

Explanation

In inorder, preorder and postorder the left subtree is always visited before the right subtree. Only the position of the root changes.

Q55
Which of the following is correct recurrence relation for worst caset of binary search?
  1. AT(n) = 2T(n/2) + O(1), T(1) = T(0) = O(1)
  2. BT(n) = T(n/2) + O(n), T(1) = T(0) = O(1)
  3. CT(n) = T(n/2) + O(1), T(1) = T(0) = O(1)
  4. DT(n) = T(n/2) + O(log n), T(1) = T(0) = O(1)
Show answerHide answer

Correct answer: (C) T(n) = T(n/2) + O(1), T(1) = T(0) = O(1)

Explanation

Each binary search step does a constant amount of work and continues in one half of the array, giving T(n) = T(n/2) + O(1), which solves to O(log n).

Q56
Which of the following traversal techniques lists the nodes of a binary search tree in ascending order?
  1. APostorder
  2. BPreorder
  3. CInorder
  4. DNone of the above
Show answerHide answer

Correct answer: (C) Inorder

Explanation

In a BST, an inorder traversal (left, root, right) visits the keys in ascending order.

Q57
A hash table of length 10 uses open addressing with hash function h(k) = kmod 10 and linear probing. After inserting 6 values into an empty hash table, the table is shown below: Slot | Key 0 | 1 | 2 | 42 3 | 23 4 | 34 5 | 52 6 | 46 7 | 33 8 | 9 | Which of the following choices gives a possible order in which the key values could have been inserted in the table?
  1. A46, 42, 34, 52, 23, 33
  2. B34, 42, 23, 52, 33, 46
  3. C46, 34, 42, 23, 52, 33
  4. D42, 46, 33, 23, 34, 52
Show answerHide answer

Correct answer: (C) 46, 34, 42, 23, 52, 33

Explanation

Order C reproduces the table: 46→6, 34→4, 42→2, 23→3, 52→2 (taken) then 3, 4 (taken) so 5, and 33→3 then 4, 5, 6 (taken) so 7.

Q58
Consider the following statements respect to JavaScript : (I) A variable is created using the keyword. (II) JavaScript is untyped language. Which of the above are true ?
  1. ANeither (I) not (II)
  2. B(I) only
  3. C(II) only
  4. DBoth (I) and (II)
Show answerHide answer

Correct answer: (D) Both (I) and (II)

Explanation

Both statements are true as intended: in JavaScript a variable is created with the var keyword (the word is missing from the question), and JavaScript is loosely (dynamically) typed, so variables have no fixed type.

Q59
A condition that is caused by run-time error in a computer program is known as :
  1. AException
  2. BSyntax error
  3. CSemantic error
  4. DFault
Show answerHide answer

Correct answer: (A) Exception

Explanation

An exception is an abnormal condition raised while a program is running, such as division by zero. Syntax errors are found at compile time.

Q60
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 :
  1. AS
  2. BP
  3. CQ
  4. 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.

Q61
How many bits are used in the exponent part of IEEE single precision format for the representation of floating – point numbers?
  1. A32 bits
  2. B8 bits
  3. C16 bits
  4. D24 bits
Show answerHide answer

Correct answer: (B) 8 bits

Explanation

IEEE 754 single precision uses 1 sign bit, 8 exponent bits and 23 mantissa bits, 32 bits in total.

Q62
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 ______.
  1. AStrobe control
  2. BMultitasking
  3. CHandshaking
  4. 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.

Q63
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;
  1. AX [P] = 5 should be X (P) = 5
  2. BP<= X.length() should be P< X.length()
  3. CX.length() should be X.length
  4. 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.

Q64
Copying a process from memory to disk to allow space for other processes is called ______.
  1. ADemand paging
  2. BDeadlock
  3. CPagefault
  4. DSwapping
Show answerHide answer

Correct answer: (D) Swapping

Explanation

Swapping moves a whole process from main memory to disk (and back later) to free memory for other processes.

Q65
When a subroutine is called, the address of the instruction following the CALL instructions stored in/on the ______.
  1. AProgram counter
  2. BStack
  3. CStack pointer
  4. DAccumulator
Show answerHide answer

Correct answer: (B) Stack

Explanation

CALL pushes the return address (the address of the next instruction) onto the stack, and RET pops it back into the program counter.

Q66
Which of the following is the most appropriate format for graphics that are to be embedded within an Internet documents?
  1. AHTML
  2. BBMP
  3. CTIFF
  4. DGIF
Show answerHide answer

Correct answer: (D) GIF

Explanation

GIF is a compressed image format that browsers support directly, so it suits graphics embedded in web pages. BMP and TIFF files are large, and HTML is not a graphics format.

Q67
Which of the following is true to define a variable for ASP?
  1. AVar
  2. BDim
  3. C$
  4. DSet
Show answerHide answer

Correct answer: (B) Dim

Explanation

Classic ASP uses VBScript, where variables are declared with Dim, e.g. Dim name.

Q68
Which method out of the following will allow the read operation from a Binary file in a Python program?
  1. Aread
  2. Binput
  3. Caccept
  4. Dload
Show answerHide answer

Correct answer: (A) read

Explanation

read() reads bytes from a file opened in binary mode ('rb'). input() reads from the keyboard.

Q69
Which is the Linux?
  1. AOpen-source Operating System
  2. BOpen-source Application Software
  3. CWindows based Application Software
  4. DProprietary Operating System
Show answerHide answer

Correct answer: (A) Open-source Operating System

Explanation

Linux is a free, open-source operating system (kernel) released under the GNU GPL.

Q70
Which of the following MySQL query is syntactically correct and most preferred one?
  1. ASELECT SECTION, COUNT(*) FROM STUDENT ORDER BY SECTION GROUP BY SECTION WHERE MARKS<33 AND COUNT(*)>0;
  2. BSELECT SECTION, COUNT(*) FROM STUDENT WHERE MARKS<33 HAVING COUNT(*)>0 GROUP BY SECTION ORDER BY SECTION;
  3. CSELECT SECTION, COUNT(*) FROM STUDENT WHERE MARKS<33 GROUP BY SECTION HAVING COUNT(*)>0 ORDER BY SECTION;
  4. DSELECT SECTION COUNT(*) FROM STUDENT GROUP BY SECTION WHERE MARKS<33 AND COUNT(*)>0 ORDER BY SECTION;
Show answerHide answer

Correct answer: (C) SELECT SECTION, COUNT(*) FROM STUDENT WHERE MARKS<33 GROUP BY SECTION HAVING COUNT(*)>0 ORDER BY SECTION;

Explanation

The clauses must come in the order WHERE, GROUP BY, HAVING, ORDER BY. Conditions on groups such as COUNT(*) > 0 go in HAVING, not WHERE.

Q71
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'?
  1. ASELECT NAME FROM STUDENT WHERE NAME LIKE 'A____';
  2. BSELECT NAME FROM STUDENT WHERE NAME = 'A____';
  3. CSELECT NAME FROM STUDENT WHERE NAME = 'A%%%%;
  4. 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.

Q72
Which of the following components of pre-service teacher education program has greater scope for experiential learning?
  1. APedagogy courses through use of critical thinking
  2. BFoundation courses through critical exposure
  3. CCritical reading based on great thinkiers' work
  4. 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.

Q73
What is the full form of ABC as per the NEP 2020?
  1. AAssessment Book of Credits
  2. BAcademic Bank of Certificates
  3. CAcademic Bank of Credit
  4. DAssessment Book of Certificates
Show answerHide answer

Correct answer: (C) Academic Bank of Credit

Explanation

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.

Q74
In XML, what is the single top level element called that can contain any number of nested subelements ?
  1. ANode element
  2. BRoot element
  3. CMeta element
  4. DSource element
Show answerHide answer

Correct answer: (B) Root element

Explanation

An XML document has exactly one root element, which encloses every other element.

Q75
A valid XML document means : (a) The document must be well formed (b) The document must apply to the rules of the DTD
  1. ABoth (a) and (b) are true
  2. BOnly (a) is true
  3. COnly (b) is true
  4. DBoth (a) and (b) are false
Show answerHide answer

Correct answer: (A) Both (a) and (b) are true

Explanation

A valid XML document must be well-formed and must also follow the rules of its DTD (or schema), so both statements are true.

Q76
This begins at the root and follows a path down to the specified file, giving the directory names on the path. This is known as
  1. AAbsolute path name
  2. BRelative path name
  3. CDefinite path name
  4. DIndefinite path name
Show answerHide answer

Correct answer: (A) Absolute path name

Explanation

An absolute path name starts at the root directory and lists every directory down to the file. A relative path starts from the current directory.

Q77
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; }
  1. ASQL
  2. BQL
  3. CMy
  4. 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.

Q78
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.
  1. A1
  2. B2
  3. C3
  4. 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.

Q79
Which of the following flow charts will be most appropriate for finding sum of first 10 multiples of 5?
  1. AS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
  2. BS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: I=I+5 → S=S+I → back to the decision.
  3. CI=1 → S=0 → decision 'IS I<=10?' — NO: PRINT S; YES: S=S+5*I → I=I+5 → back to the decision.
  4. 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.

Q80
What will be the output of the following HTML code snippet? <IMG SRC = "FLOWER.JPG" HEIGHT = 100 WIDTH = 40 BORDER = 10>
  1. AThe image flower.jpg will be displayed with 100 pixel height 40 pixel width and a border with RGB code as 10
  2. BThe image flower.jpg will be displayed as a 100 px by 40px image with a 10px thick border
  3. CThe image flower.jpg will be displayed as a 40 cm by 100 cm image with a 10 cm thick border
  4. DThe image flower.jpg will be displayed as a 100 mm by 40 mm image with a 10 mm thick border
Show answerHide answer

Correct answer: (B) The image flower.jpg will be displayed as a 100 px by 40px image with a 10px thick border

Explanation

In HTML, HEIGHT, WIDTH and BORDER values are in pixels, so the image appears 100 px high and 40 px wide with a 10 px border.

Q81
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.
  1. A<FRAMESET ROWS = "25%, 75%"> <FRAME SRC = "A.html"> <FRAMESET COLS = "50%, 50%"> <FRAME SRC = "B.html"> <FRAME SRC = "C.html"> </FRAMESET> </FRAMESET>
  2. B<FRAMESET COLS = "25%, 75%"> <FRAME SRC = "A.html"> <FRAMESET ROWS = "50%, 50%"> <FRAME SRC = "B.html"> <FRAME SRC = "C.html"> </FRAMESET> </FRAMESET>
  3. C<FRAME ROWS = "25%, 75%"> <FRAMESET SRC = "A.html"> <FRAME COLS = "50%, *"> <FRAMESET SRC = "B.html"> <FRAMESET SRC = "C.html"> </FRAME> </FRAME>
  4. D<FRAME COLS = "25%, 75%"> <FRAMESET SRC = "A.html"> <FRAME ROWS = "50%, *"> <FRAMESET SRC = "B.html"> <FRAMESET SRC = "C.html"> </FRAME> </FRAME>
Show answerHide answer

Correct answer: (A) <FRAMESET ROWS = "25%, 75%"> <FRAME SRC = "A.html"> <FRAMESET COLS = "50%, 50%"> <FRAME SRC = "B.html"> <FRAME SRC = "C.html"> </FRAMESET> </FRAMESET>

Explanation

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.

Q82
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 ?
  1. AFUN F2;
  2. BFUN F2 (501);
  3. CFUN F2 (F1);
  4. 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.)

Q83
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 ?
  1. AFUNCTION 1
  2. BFUNCTION 2
  3. CFUNCTION 3
  4. 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.

Q84
Which of the following is the correct order of Problem Solving steps? (A) Algorithm Development (B) Coding (C) Analysis of problem (D) Testing & Debugging
  1. A(A), (B), (C), (D)
  2. B(C), (A), (D), (B)
  3. C(A), (C), (B), (D)
  4. 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).

Q85
Which of the following operator is not an arithmatic operator ?
  1. A+
  2. B*
  3. C−
  4. D>
Show answerHide answer

Correct answer: (D) >

Explanation

">" is a relational (comparison) operator. +, * and − are arithmetic operators.

Q86
Which of the following options states the correct storage - device hierarchy in terms of increasing size in a computer system?
  1. Acache, register, main memory, solid state disk
  2. Bregisters, cache, main memory, solid state disk
  3. Cregisters, cache, solid state disk, main memory
  4. Dcache, register, solid state disk, main memory
Show answerHide answer

Correct answer: (B) registers, cache, main memory, solid state disk

Explanation

Going up the hierarchy, size grows and speed falls: registers, then cache, then main memory, then solid-state disk.

Q87
DMA steals cycle from the ______.
  1. AI/O device or Hard disk
  2. BPhysical Memory
  3. CCache Memory
  4. DCentral Processing Unit
Show answerHide answer

Correct answer: (D) Central Processing Unit

Explanation

In cycle stealing, the DMA controller takes the system bus from the CPU for a memory cycle at a time, so it steals cycles from the CPU.

Q88
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.
  1. AMinicomputer
  2. BSupercomputer
  3. CMainframe
  4. 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.

Q89
Opening cash balance is ₹2,50,000. Receipts are ₹1,75,000 and payments are ₹1,25,000. Closing balance is:
  1. A₹3,00,000
  2. B₹3,25,000
  3. C₹2,75,000
  4. D₹4,00,000
Show answerHide answer

Correct answer: (A) ₹3,00,000

Explanation

Closing balance = opening + receipts − payments = 2,50,000 + 1,75,000 − 1,25,000 = ₹3,00,000.

Q90
Opening cash is ₹9,00,000. Receipts are ₹4,50,000. Payments are ₹3,75,000. Closing cash is:
  1. A₹9,75,000
  2. B₹10,00,000
  3. C₹9,50,000
  4. D₹8,75,000
Show answerHide answer

Correct answer: (A) ₹9,75,000

Explanation

Closing cash = 9,00,000 + 4,50,000 − 3,75,000 = ₹9,75,000.

Q91
The development of second language skills must be in ?
  1. Asequential manner
  2. Bsequential order and in an integrated manner
  3. Cin isolation
  4. 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.

Q92
A child is able to acquire his mother tongue by ?
  1. Ainformal way
  2. Bschooling
  3. Crules
  4. Dformal way
Show answerHide answer

Correct answer: (A) informal way

Explanation

A child picks up the mother tongue informally, by hearing and using it every day at home, without formal teaching of rules.

Q93
What is the correct sequence of acquiring a language ?
  1. AListening, speaking, reading, writing
  2. BWriting, speaking, reading, listening
  3. CListening, reading, writing, speaking
  4. DSpeaking, listening, reading, writing
Show answerHide answer

Correct answer: (A) Listening, speaking, reading, writing

Explanation

Language is acquired in the natural order: listening first, then speaking, then reading, and finally writing (LSRW).

Q94
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?
  1. ABlended learning
  2. BDistance learning
  3. CVirtual learning
  4. 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.

Q95
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 ?
  1. ACloud computing
  2. BBlended learning
  3. CSocial media
  4. 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.

Q96
Which stage in child development refers to the holly Frostik age ?
  1. AThe stage of two words
  2. BThe stage of one word
  3. CThe stage of syntax
  4. DStage of combining words
Show answerHide answer

Correct answer: (B) The stage of one word

Explanation

The holophrastic stage (about 12-18 months) is the one-word stage, when a single word expresses a whole sentence or idea.

Q97
At what age does the child develop his fluent speech without any errors ?
  1. A11 years
  2. BAbove 12 years
  3. CAbove 14 years
  4. D8-12 years
Show answerHide answer

Correct answer: (B) Above 12 years

Explanation

According to the source, a child's speech becomes fully fluent and free of errors only after the age of about 12 years.

Q98
Which refers to the subconscious process of 'understanding' a language through exposure?
  1. AAccess
  2. BListening
  3. CSpeaking
  4. DAcquisition
Show answerHide answer

Correct answer: (D) Acquisition

Explanation

Acquisition is the subconscious way a language is picked up through exposure and use. Learning is the conscious study of rules.

Q99
Which of the following is not an advantage of ICT in education?
  1. ACommunication the gap
  2. Bpromotes traditional education
  3. Ctime efficient
  4. 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.

Q100
Assessments like unit test and class tests are covered under following ______
  1. ASummative assessment
  2. BPortfolio assessment
  3. CFormative assessment
  4. 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.

Practise it as a real test

Reading answers is not the same as solving under time pressure. Attempt DSSSB TGT Computer Science Practice Set 5 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.