DescriptionQ036
Q036DVArchASIC interview problem
Retire out-of-order completions in order
TechniquesPythonRetirementReorder bufferWindow
DifficultyHard
TopicReference Models
LanguagePython
Requirements4 checkpoints
01
Problem
Model transactions issued with increasing IDs, completed out of order, and retired strictly in order through a 16-entry completion window.

Example input and output
Use this case to check your interpretationInput
issue IDs 0,1,2,3; complete in order 2,0,1,3Output
retired after each completion: [], [0], [1,2], [3]Explanation
Completion 2 waits in the 16-entry window until IDs 0 and 1 form a contiguous completed prefix.
02
Requirements (4)
- Issue monotonically increasing IDs starting at zero.
- Accept completion only for an issued, not-yet-retired, not-already-completed ID.
- Define the 16 legal slots as next_retire through next_retire + 15.
- After each completion, retire the longest contiguous completed prefix and return those retired IDs.
