AlgoViz
← All drills
🧠 Drill · Think it through

The face you've already seen

The problem

You're handing out wristbands at a door, reading ID numbers one by one as people arrive. Return the first ID that you've already let in earlier — the first repeat, by arrival order. The IDs are not sorted, and you only get to read the line once, front to back.

Don't jump to code. Walk the four questions an expert asks first — you'll build the habit, not just the answer.

1

Restate it

Before anything else — did you read what's actually being asked? Strip the story to the bare goal.

Strip away the story. What are we actually asked to return?