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.
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
ATag-<OL>, Attribute - START
BTag-<OL>, Attribute - VALUE
CTag-<OL>, Attribute - TYPE
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>.
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?
AF.tellg(N)
BF.seekp(N)
CF.seekp((N−1)* sizeof(EMP))
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.
ALinked allocation of disk space allows only sequential access of data.
BIndexed allocation of disk space allows direct access to disk blocks.
CThere is no internal fragmentation in contiguous allocation of disk space.
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.
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 :
AOnly (b) is correct
BOnly (c) is correct
COnly (a) and (c) are correct
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.
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.
ASELECT * FROM MYSTUDENT ORDER BY DESC MARKS, ASC ROLLNO;
BSELECT * FROM MYSTUDENT ORDER BY MARKS DESC, ROLLNO ASC;
CSELECT * FROM MYSTUDENT ORDER BY MARKS; ROLLNO DESC, ASC;
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.
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 ?
ASELECT SEC, AVG (MARKS) FROM MYSTUDENT ORDER BY SEC;
BSELECT SEC, AVG (MARKS) FROM MYSTUDENT GROUP BY MARKS;
CSELECT *SEC, AVG (MARKS) FROM MYSTUDENT GROUP BY SEC;
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).
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.
Running time of a 'for' loop is ______ the running time of the statements inside the for loop times the number of iterations.
AAtleast
BAtmost
CEqual to
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.
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'.
ASound in wave form.
BWind frequency.
CLine of sight.
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.
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 ?
A5K
B10K
C15K
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.
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.
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.
AMoore' law.
BNewton Raphson method.
CBoyle's law.
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.
______ is the first Intel x86 microprocessor with a dual core, referring to the implementation of two processors on a single chip.
ACore
BCore 2 duo
CDual core
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.
Semaphores are used to solve the problem of ______.
AMutual exclusion
BRace condition
CProcess synchronization
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.
The logic circuit of binary adder which is used to add two 4-bits binary numbers, requires ______ half adder (s) and ______ full adder (s).
A4 , 0
B1 , 3
C2 , 2
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.
Which of the following memory improves the speed of execution of a program?
AVirtual memory
BPrimary memory
CSecondary memory
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.
Which of the following statements is false with respect to Relational DBMS?
AA disadvantage of highly normalized tables is that queries may require too many time consuming joins.
BForeign key constraints are referential integrity constraints.
CA primary key uniquely indentifies a row in a table.
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.
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.
A8
B5
C6
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.
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 :
AControl array
BPrimary array
CSecondary array
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.
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?
A6
B2
C3
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.
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 :
AControl array
BPrimary array
CSecondary array
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.
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?
A6
B2
C3
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.
File operations that manipulate the 'open-count' maintained for each entry in open-file table include:
AOpen, write
BRead, write
CWrite, close
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.
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
AA-(i), B-(iii), C-(ii)
BA-(ii), B-(i), C-(iii)
CA-(iii), B-(ii), C-(i)
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).
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
A(A) and (B)
B(B) and (C)
C(A) and (C)
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.
In which of the following, the density of the core remains constant from the center to the edges?
ASingle mode fiber
BMultimode step-index fiber
CMultimode graded-index fiber
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.
MPEG involves both spatial compression and temporal compression. The spatial compression is similar to JPEG and temporal compression removes ______ frames.
AVoice
BSpatial
CTemporal
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.
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?
A46, 42, 34, 52, 23, 33
B34, 42, 23, 52, 33, 46
C46, 34, 42, 23, 52, 33
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.
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 ?
ANeither (I) not (II)
B(I) only
C(II) only
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.
The five items P,Q,R,S and T are pushed in a stack, one after the other starting from P. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack, The popped item is :
AS
BP
CQ
DR
Show answerHide answer
Correct answer: (A) S
Explanation
After pushing P to T, popping four times sends T, S, R, Q to the queue, leaving P on the stack. Dequeuing two gives T and S, which are pushed back (stack P, T, S). The next pop returns S.
The unit receiving the data item responds with another control signal to acknowledge receipt of the data. This type of agreement between two independent units is known as ______.
AStrobe control
BMultitasking
CHandshaking
DPiggybacking
Show answerHide answer
Correct answer: (C) Handshaking
Explanation
In handshaking, the sender signals that data is ready and the receiver replies with an acknowledgement signal. Strobe control uses only one control signal.
What correction is required for following Java code snippet to compile?
int [] X = new int [10];
for (int P = 0; P<= X.length(); P++)
X [P] = 5;
AX [P] = 5 should be X (P) = 5
BP<= X.length() should be P< X.length()
CX.length() should be X.length
DP++ should be P+1
Show answerHide answer
Correct answer: (C) X.length() should be X.length
Explanation
In Java, length is a field of an array, not a method, so X.length() will not compile and must be X.length. The <= would only cause a runtime exception, not a compile error.
Which of the following is the most appropriate format for graphics that are to be embedded within an Internet documents?
AHTML
BBMP
CTIFF
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.
Which of the following MySQL query will display all the NAME from the table STUDENT, which are having maximum five characters and starting with the alphabet 'A'?
ASELECT NAME FROM STUDENT WHERE NAME LIKE 'A____';
BSELECT NAME FROM STUDENT WHERE NAME = 'A____';
CSELECT NAME FROM STUDENT WHERE NAME = 'A%%%%;
DSELECT NAME FROM STUDENT WHERE NAME LIKE 'A%%%%'
Show answerHide answer
Correct answer: (A) SELECT NAME FROM STUDENT WHERE NAME LIKE 'A____';
Explanation
LIKE with the wildcard _ matches exactly one character, so 'A____' matches names that start with A and have five characters. The = operator does not treat wildcards specially.
Which of the following components of pre-service teacher education program has greater scope for experiential learning?
APedagogy courses through use of critical thinking
BFoundation courses through critical exposure
CCritical reading based on great thinkiers' work
DInternship through school attachment
Show answerHide answer
Correct answer: (D) Internship through school attachment
Explanation
Internship through school attachment puts student-teachers into real classrooms, so it offers the most scope for experiential (learning by doing) learning.
Under NEP 2020, ABC stands for Academic Bank of Credit, a digital store of the credits a student earns so they can be transferred and counted toward a degree.
Select the correct output of the following C++ program segment assuming all necessary header files are correctly included:
void main( )
{
char *S = "MySQL";
S += 2;
cout << S <<endl;
}
ASQL
BQL
CMy
DMyS
Show answerHide answer
Correct answer: (A) SQL
Explanation
S points to "MySQL". S += 2 moves it past 'M' and 'y' to 'S', so cout prints the string from there: SQL.
How many times loop will be executed in the following flow chart ?
Flowchart: Start → U=70 → decision 'IS U>=0?' — NO: exit; YES: PRINT U → U=U−35 → back to the decision.
A1
B2
C3
D70
Show answerHide answer
Correct answer: (C) 3
Explanation
Corrected: the book's key says (b). U takes the values 70, 35 and 0 (all >= 0), so the loop body runs 3 times.
Which of the following flow charts will be most appropriate for finding sum of first 10 multiples of 5?
AS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
BS=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: I=I+5 → S=S+I → back to the decision.
CI=1 → S=0 → decision 'IS I<=10?' — NO: PRINT S; YES: S=S+5*I → I=I+5 → back to the decision.
DS=0 → I=1 → decision 'IS I<=10?' — NO: PRINT S; YES: I=I+1 → S=S+5*I → back to the decision.
Show answerHide answer
Correct answer: (A) S=0 → I=5 → decision 'IS I<=50?' — NO: PRINT S; YES: S=S+I → I=I+5 → back to the decision.
Explanation
The first 10 multiples of 5 are 5 to 50. Flowchart A starts at I = 5, adds I to S and then increases I by 5 while I ≤ 50. B increases I before adding, so it sums 10 to 55.
Which of the following is the correct code to create a framed webpage as in the figure below?
Figure: the window is split into two rows: the top row (25%) is Frame A; the bottom row (75%) is split into two equal columns (50% each): Frame B on the left and Frame C on the right.
The outer FRAMESET ROWS="25%,75%" makes two rows: Frame A in the first row, and a nested FRAMESET COLS="50%,50%" holding Frames B and C in the second. Options C and D swap FRAME and FRAMESET.
This question is based on the following C++ code segment and class FUN :
class FUN
{
int CODE ;
public :
FUN ( ); //Function1
FUN (int C); //Function2
FUN (FUN & F); //Function3
void DISP ( ); //Function4
~FUN ( ); //Function5
};
void main ( )
{
FUN F1 ;
______ // BLANK
______
}
Which of the following C++ command/ statement can be written in the line marked as BLANK to invoke the function whose prototype is marked as Function 3 ?
AFUN F2;
BFUN F2 (501);
CFUN F2 (F1);
DFUN F2 = F1;
Show answerHide answer
Correct answer: (C) FUN F2 (F1);
Explanation
Function 3, FUN(FUN &F), is the copy constructor, which runs when a new object is made from an existing one, as in FUN F2(F1). (FUN F2 = F1; also calls it, but C is the direct form.)
This question is based on the following C++ code segment and class FUN:
class FUN
{
int CODE ;
public :
FUN ( ); //Function1
FUN (int C); //Function2
FUN (FUN & F); //Function3
void DISP ( ); //Function4
~FUN ( ); //Function5
};
void main ( )
{
FUN F1 ;
______ // BLANK
______
}
Which of the following is called a destructor of the class FUN ?
AFUNCTION 1
BFUNCTION 2
CFUNCTION 3
DFUNCTION 5
Show answerHide answer
Correct answer: (D) FUNCTION 5
Explanation
A destructor has the class name with a tilde and no arguments, so ~FUN() (Function 5) is the destructor.
Which of the following is the correct order of Problem Solving steps?
(A) Algorithm Development
(B) Coding
(C) Analysis of problem
(D) Testing & Debugging
A(A), (B), (C), (D)
B(C), (A), (D), (B)
C(A), (C), (B), (D)
D(C), (A), (B), (D)
Show answerHide answer
Correct answer: (D) (C), (A), (B), (D)
Explanation
First analyse the problem, then develop an algorithm, code it, and finally test and debug it: (C), (A), (B), (D).
The term ______ is used for the larger, more powerful computers other than supercomputers. It supports a large database, has elaborate I/O hardware, and is used in a central data processing facility.
AMinicomputer
BSupercomputer
CMainframe
DMicrocomputer
Show answerHide answer
Correct answer: (C) Mainframe
Explanation
A mainframe is a large, powerful computer below a supercomputer that supports large databases and extensive I/O, and is used in central data processing.
The development of second language skills must be in ?
Asequential manner
Bsequential order and in an integrated manner
Cin isolation
Dintegrated manner
Show answerHide answer
Correct answer: (B) sequential order and in an integrated manner
Explanation
The skills of a second language develop in a natural sequence (listening, speaking, reading, writing), but they should be taught together in an integrated way rather than in isolation.
The teacher provides study material a day before teaching the same thing students read it according to their ability and use the time to complete the assignments in the class with the help of teacher what type of approach is highlighted in the statement?
ABlended learning
BDistance learning
CVirtual learning
DTraditional learning
Show answerHide answer
Correct answer: (A) Blended learning
Explanation
Studying the material before class and using class time for assignments with the teacher is the flipped-classroom model, a form of blended learning that mixes self-study with face-to-face teaching.
The teacher delivered her lesson plan in the classroom and uploaded the study material on Google drive. She gave the access of the link to all the students for their ease. Which type of ICT source did she use ?
ACloud computing
BBlended learning
CSocial media
DTraditional method
Show answerHide answer
Correct answer: (A) Cloud computing
Explanation
Google Drive stores files on remote internet servers and shares them by link, which is cloud computing.
Which of the following is not an advantage of ICT in education?
ACommunication the gap
Bpromotes traditional education
Ctime efficient
DAccess more information
Show answerHide answer
Correct answer: (B) promotes traditional education
Explanation
ICT changes and modernises teaching, so "promotes traditional education" is not one of its advantages. Bridging communication gaps, saving time and giving access to more information are advantages.
Assessments like unit test and class tests are covered under following ______
ASummative assessment
BPortfolio assessment
CFormative assessment
DCCE
Show answerHide answer
Correct answer: (C) Formative assessment
Explanation
Unit tests and class tests happen during teaching to check progress and give feedback, so they are formative assessment. Summative assessment comes at the end of a term.