- Software engineer
- Junior
- 20 min
Independent dispatch counters
Cedar Dispatch starts two independent ticket counters at 65 and 85. Call them in the order first, second, first, second. Return the four issued numbers. The factory must retain private state.
Skills and rubricIndependent dispatch counters
- Each closure retains its own next number; interleaving two counters cannot share state.
- Traces one concrete example before coding.
- Checks an empty input or the named boundary with an expected result.