PYQ Derived Drills
Dashboard Download PDF

tags: - cocubes - pyq - practice


Original PYQ-Derived Drills

These are original questions designed from recurring public themes, not copied previous papers.

Technical

  1. A process accesses a page that is not in RAM. What is this event called?
  2. A subnet is /28. How many traditional usable host addresses are available?
  3. Which data structure is appropriate for FIFO customer tickets?
  4. What is binary search's time complexity, and what input condition does it need?
  5. Which algorithm detects a linked-list cycle using slow and fast pointers?
  6. Which protocol normally resolves a domain name to an IP address?
  7. A channel has 3000 Hz bandwidth and SNR 30 dB. Which standard formula is used to calculate theoretical Shannon capacity?
  8. If two binary strings differ at four positions, what is their hamming distance?
  9. Which sort has O(nยฒ) worst case but O(n log n) average case?
  10. In a transaction schedule, what graph cycle indicates lack of conflict serializability?

Pseudocode

  1. What does this display?
SET n = 7, total = 0
WHILE n > 0
  SET total = total + n
  SET n = n - 2
END WHILE
DISPLAY total
  1. What does this display?
SET n = 153, sum = 0
WHILE n > 0
  SET sum = sum + (n MOD 10)
  SET n = n DIV 10
END WHILE
DISPLAY sum
  1. What is the output?
SET a = 2, b = 5
SET a = a * b
SET b = a DIV b
SET a = a DIV b
DISPLAY a, b

Coding

  1. For x = 3 and y = 45, what is the unit digit of x^y?
  2. You need the sum and maximum of n numbers. Which single-pass pattern should you use?

Answers

  1. Page fault.
  2. 14.
  3. Queue.
  4. O(log n), sorted sequence.
  5. Floyd's tortoise-and-hare algorithm.
  6. DNS.
  7. Shannon-Hartley theorem: C = B log2(1 + S/N).
  8. 4.
  9. Quicksort.
  10. A cycle in the precedence/serialization graph.
  11. 16: 7+5+3+1.
  12. 9.
  13. 5, 2.
    1. Cycle length of 3 is 4; 45 MOD 4 = 1.
  14. A linear scan maintaining running sum and current maximum; O(n), O(1) extra space.

[[07_PYQ_Research/Public_PYQ_Patterns|PYQ patterns]] ยท [[10_Templates/Error_Log|Error log]]