PYQ Derived Drills
tags: - cocubes - pyq - practice
Original PYQ-Derived Drills
These are original questions designed from recurring public themes, not copied previous papers.
Technical
- A process accesses a page that is not in RAM. What is this event called?
- A subnet is /28. How many traditional usable host addresses are available?
- Which data structure is appropriate for FIFO customer tickets?
- What is binary search's time complexity, and what input condition does it need?
- Which algorithm detects a linked-list cycle using slow and fast pointers?
- Which protocol normally resolves a domain name to an IP address?
- A channel has 3000 Hz bandwidth and SNR 30 dB. Which standard formula is used to calculate theoretical Shannon capacity?
- If two binary strings differ at four positions, what is their hamming distance?
- Which sort has O(nยฒ) worst case but O(n log n) average case?
- In a transaction schedule, what graph cycle indicates lack of conflict serializability?
Pseudocode
- What does this display?
SET n = 7, total = 0
WHILE n > 0
SET total = total + n
SET n = n - 2
END WHILE
DISPLAY total
- 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
- 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
- For x = 3 and y = 45, what is the unit digit of x^y?
- You need the sum and maximum of n numbers. Which single-pass pattern should you use?
Answers
- Page fault.
- 14.
- Queue.
- O(log n), sorted sequence.
- Floyd's tortoise-and-hare algorithm.
- DNS.
- Shannon-Hartley theorem: C = B log2(1 + S/N).
- 4.
- Quicksort.
- A cycle in the precedence/serialization graph.
- 16: 7+5+3+1.
- 9.
- 5, 2.
-
- Cycle length of 3 is 4; 45 MOD 4 = 1.
- 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]]