This question evaluates concurrent object-oriented design and large-scale systems architecture skills, covering thread-safety for document–tag relationships, many-to-many data modeling, consistency during deletes, API and storage choices, and scalability concerns for an online bookstore; it is categorized as System Design with strong OO and concurrency elements. Interviewers commonly ask this to assess reasoning about concurrency hazards, maintaining data integrity and invariants, and making trade-offs in consistency, availability, and fault tolerance, with a level of abstraction that spans both conceptual architectural thinking and practical application details such as APIs, storage and inventory consistency mechanisms.
Design object-oriented classes for documents and tags in a multi-threaded environment. Ensure thread-safe operations for:
Assume a many-to-many relationship between documents and tags and an in-memory implementation (you may also mention how this maps to a database if helpful).
Design a scalable online bookstore that supports:
Cover high-level architecture, data storage choices, critical APIs, consistency considerations (especially inventory), and mechanisms for scaling and fault tolerance.
Login required