NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new
avatar
yixuan.zhang97Jun 18, 2026

Anthropic OA, task manager design problem

Interview Experiences
anthropic

Result: Pending Number of Rounds: 1

Sharing the Anthropic OA problem. Design-heavy but not algorithmically complex.

You implement a TaskManager class with three operations: add a task by name and priority, update a task by ID, and retrieve a task's current state. addTask returns a sequentially assigned ID. Duplicates are allowed, two tasks with identical name and priority both get distinct IDs. getTask returns an empty string for missing IDs; updateTask signals whether the ID was found.

Each method accepts a timestamp parameter that isn't used in the base version. Interviewer mentioned it's scaffolding for a follow-up.

Follow-up I got: how do you make this thread-safe given multiple writers calling addTask simultaneously? I used an atomic counter for the ID and a concurrent map for storage. That seemed to land well. Interviewer also asked about search by priority, which would require an additional index structure.

Overall pretty approachable as an OA. The timestamp parameter being unused is probably a setup for follow-ups, so don't ignore it when it comes up.

Submitted last week, waiting to hear if I'm moving to phone screen.

11662k

Replies (4)

avatar
gracelin94Jun 19, 2026

AtomicInteger + ConcurrentHashMap is exactly what I would have said for thread safety. solid answer

67
avatar
lizheng1999Jun 18, 2026

waiting to hear back too after OA last week. is the OA a standalone filter before phone screen for you?

64
avatar
yixuan.zhang97Jun 18, 2026

yeah, recruiter said OA is the first filter before they decide on phone screen. not sure how long the decision takes

33
avatar
User-2c3efJun 18, 2026

did you have time pressure? 45 min for a design OA feels tighter than pure LC

45
avatar
yixuan.zhang97Jun 19, 2026

had maybe 10-15 mins left. reading the spec took a while before I could start coding

49
avatar
ddttt222Jul 29, 2026

did recruiter talked to you before the OA or after?

19
No more replies