Hardware interview practice
Score legal packet drops without hiding errors
Implement a scoreboard for a design allowed to drop 7 through 13 packets in each completed 100-packet outcome window. Duplicate, replayed, invented, and missing-undecided packets remain illegal.
Reviewed example
Work through one case
Input
input IDs 0..99; explicit drops={2,15,28,41,54,67,80,93}; deliver every other ID; then try output ID 101Expected output
100-outcome window PASS with 8 legal drops; output 101 is rejected as inventedEight drops lie inside the allowed 7..13 range, every input gets one explicit outcome, and the next invented delivery cannot be hidden by drop tolerance.
What to cover
Requirements
- Record every unique input ID as pending before accepting a delivery or drop outcome.
- Require a separate deadline or policy layer to declare a packet dropped; absence at the output is not immediately a drop.
- Reject output IDs that were never input and IDs already completed by delivery or drop.
- Check the drop count only after 100 explicit outcomes, then begin a fresh window.
