Choose Between a List and a Key-Value Map
Scenario
Assign each data problem to Ordered List (Input group) or Key-Value Map (Output group).
Try it yourself
Classify each campus data task into Ordered List or Key-Value Map.
Choose a category for every card.
Reveal the explanation
- Workshop waitlist where the first student who joined is promoted first
Ordered List — arrival order determines who is promoted next.
- Look up free seats immediately using a unique room code like "Room-204"
Key-Value Map — direct lookup by unique key avoids scanning every room.
- Question-by-question quiz answer key ["A", "C", "B", "D"]
Ordered List — each answer is matched by its exact question position.
Lists excel at ordered queues, answer sequences, and step logs. Maps excel at direct lookup by unique identifiers like room IDs or student IDs.
Your turn
Pick list or map for (a) storing each student’s remaining print quota by studentId, and (b) keeping the daily print job queue.
Common mistake Using a map for a queue where arrival order is the core rule.
Check your work
(a) Map keyed by studentId; (b) Ordered list for the print queue.
Quick check
This browser could not save your progress. Changes last until you leave the page.