Amazon·Software Engineer·Onsite - System Design / Architecture
- Design a system to manage documents and tags, including class interfaces, core data structures, and support for operations like creating/deleting documents and tags, adding/removing tags on documents, listing documents by tag, listing tags by document, and querying documents by the intersection of multiple tags.
- How would you extend the document and tag management design to be thread-safe under concurrent reads and writes? Cover locking granularity, consistency guarantees, deadlock avoidance, and how you'd test for concurrency correctness.
“I started with two hashmaps, one mapping document IDs to their tag sets and another mapping tags to document sets.”