Plain record or config shape
Use a plain object
Best fitUse a Map
ReasonableTRADEOFF BATTLE
You are not looking for the universal winner. You are picking the strongest answer for this prompt.
Pick the option you would defend, then reveal the stronger interview framing for this prompt.
STRONG ANSWER
Watch how the answer changes as the scenario changes. This is where tradeoff thinking starts to feel real.
Use a plain object
Best fitUse a Map
ReasonableUse a plain object
ReasonableUse a Map
Best fitUse a plain object
Best fitUse a Map
ReasonableOnce the answer is revealed, compare all options. The selected card stays highlighted so you can pressure-test your own instinct.
Alternative
Alternative
A strong answer survives follow-up pressure. These are the questions most likely to expose shallow reasoning.
Pushback
Pushback
Pushback
This is often the fastest way to internalize the difference between opinions and interview-grade reasoning.
Weak answer
I would use Map because it is more advanced than object.
What it is missing
Decent answer
I would probably use Map because there will be add and delete operations.
What it is missing
Strong answer
For this prompt I would use Map because the state behaves like a live keyed collection: I need to add entries, remove them, test membership, iterate them, count them, and clear them. If the value were really just a plain JSON-style record with predictable string keys, I would keep it as an object. Here the collection behavior is the deciding signal, not just the fact that keys exist.
Why it works
These are the dimensions that make your answer feel senior instead of generic.
Use this structure if you want your answer to sound calm and easy to follow.
Avoid these shortcuts if you want the answer to feel grounded in engineering tradeoffs.