Loading lesson…
Level 1 · Apprentice0 XP
List, Set, Map, Deque: what each is fast at, and which implementation to pick.
Step 1 / 6
ProblemA job checks list.contains(id) for each of 100,000 incoming ids. Each check walks the whole list. The job takes an hour.
← → step
Before this: equals, hashCode and collections
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Given a list of 100,000 orders, find duplicates by id, count orders per day in date order, and process them as a FIFO queue. Use the right collection for each and time the duplicate check with a List versus a Set.