Computer Science MCQs | Computer Science Multiple Choice Questions with Answers

Questions
1 You have to sort a list L, consisting of a sorted list followed by a few ‘random’ elements. Which of the following sorting method would be most suitable for such a task ?
A Bubble sort
B Selection sort
C Quick sort
D Insertion sort

Answer: Option [D]
2 The directory can be viewed as ________ that translates filenames into their directory entries.
A Symbol table
B Partition
C Swap space
D Cache

Answer: Option [A]
3 Consider an array A[20, 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of A[11, 5] ? Assume row major storage.
A 560
B 565
C 570
D 575

Answer: Option [A]
4 A full binary tree with n leaves contains
A n nodes
B log2 n nodes
C 2n –1 nodes
D 2n nodes

Answer: Option [C]
5 The period of a signal is 10 ms. What is its frequency in Hertz ?
A 10
B 100
C 1000
D 10000

Answer: Option [D]
6 In a classful addressing, first four bits in Class A IP address is
A 1010
B 1100
C 1011
D 1110

Answer: Option [Z]
7 Which of the following algorithms is not a broadcast routing algorithm ?
A Flooding
B Multidestination routing
C Reverse path forwarding
D All of the above

Answer: Option [D]
8 An analog signal has a bit rate of 6000 bps and a baud rate of 2000 baud. How many data elements are carried by each signal element ?
A 0.336 bits/baud
B 3 bits/baud
C 120,00,000 bits/baud
D None of the above

Answer: Option [B]
9 How many distinct stages are there in DES algorithm, which is parameterized by a 56-bit key ?
A 16
B 17
C 18
D 19

Answer: Option [D]
10 Shift-Reduce parsers perform the following :
A Shift step that advances in the input stream by K(K > 1) symbols and Reduce step that applies a completed grammar rule to some recent parse trees, joining them together as one tree with a new root symbol
B Shift step that advances in the input stream by one symbol and Reduce step that applies a completed grammar rule to some recent parse trees, joining them together as one tree with a new root symbol
C Shift step that advances in the input stream by K(K = 2) symbols and Reduce step that applies a completed grammar rule to form a single tree
D Shift step that does not advance in the input stream and Reduce step that applies a completed grammar rule to form a single tree

Answer: Option [B]
11 Which of the following is true ?
A Canonical LR parser is LR (1) parser with single look ahead terminal
B All LR(K) parsers with K > 1 can be transformed into LR(1) parsers
C Both (A) and (B)
D None of the above

Answer: Option [C]
12 In a two-pass assembler, symbol table is
A Generated in first pass
B Generated in second pass
C Not generated at all
D Generated and used only in second pass

Answer: Option [A]
13 Debugger is a program that
A allows to examine and modify the contents of registers
B does not allow execution of a segment of program
C allows to set breakpoints, execute a segment of program and display contents of register
D All of the above

Answer: Option [C]
14 The following Context-Free Grammar (CFG) : S → aB | bA A → a | as | bAA B → b | bs | aBB will generate
A odd numbers of a’s and odd numbers of b’s
B even numbers of a’s and even numbers of b’s
C equal numbers of a’s and b’s
D different numbers of a’s and b’s

Answer: Option [Z]
15 Consider the following justifications for commonly using the two-level CPU scheduling : I. It is used when memory is too small to hold all the ready processes. II. Because its performance is same as that of the FIFO. III. Because it facilitates putting some set of processes into memory and a choice is made from that. IV. Because it does not allow to adjust the set of in-core processes. Which of the following is true ?
A I, III and IV
B I and II
C III and IV
D I and III

Answer: Option [D]
16 A specific editor has 200 K of program text, 15 K of initial stack, 50 K of initialized data, and 70 K of bootstrap code. If five editors are started simultaneously, how much physical memory is needed if shared text is used ?
A 1135 K
B 335 K
C 1065 K
D 320 K

Answer: Option [B]
17 Which of the following conditions does not hold good for a solution to a critical section problem ?
A No assumptions may be made about speeds or the number of CPUs
B No two processes may be simultaneously inside their critical sections
C Processes running outside its critical section may block other processes
D Processes do not wait forever to enter its critical section

Answer: Option [C]
18 For the implementation of a paging scheme, suppose the average process size be x bytes, the page size be y bytes, and each page entry requires z bytes. The optimum page size that minimizes the total overhead due to the page table and the internal fragmentation loss is given by
A x 2
B xz 2
C 2xz
D xz 2

Answer: Option [C]
19 In a demand paging memory system, page table is held in registers. The time taken to service a page fault is 8 m.sec. if an empty frame is available or if the replaced page is not modified, and it takes 20 m.secs., if the replaced page is modified. What is the average access time to service a page fault assuming that the page to be replaced is modified 70% of the time ?
A 11.6 m.sec
B 16.4 m.sec
C 28 m.sec
D 14 m.sec

Answer: Option [B]
20 __________ are applied throughout the software process.
A Framework activities
B Umbrella activities
C Planning activities
D Construction activities

Answer: Option [B]