This question evaluates a candidate's ability to design in-memory class interfaces and indices for a document–tag manager, specify duplicate handling and normalization policies, and extend the design with concurrency control while reasoning about time and space complexity.
You are designing an in-memory component that manages documents and tags. The component should expose a clear class interface, maintain efficient indices, and provide well-defined behavior regarding duplicates and normalization (e.g., case sensitivity). Later, extend the design to support safe concurrent reads and writes.
Assume documents and tags are small (e.g., IDs/strings and lightweight metadata), and the system runs on a single node process. Persistence, sharding, and distributed coordination are out of scope.
Login required