Problem statement
Design the object model and core APIs for a clipboard history manager that captures everything a user copies, keeps a bounded, searchable history, and lets them paste any earlier item back.
Operating context. A background capture source pushes an entry every time the user copies — plain text, a rich snippet, an image, or a file reference. History is capacity-bounded (say the last 200 unpinned items); when full, the oldest unpinned entry is evicted. The user can pin items to protect them from eviction, delete items, search the text of past entries, and select one to place back on the system clipboard. Copies can arrive rapidly and concurrently with the user browsing history, so the store must be thread-safe. Single process on one device.
Out of scope. The OS clipboard hooks and paste injection themselves (assume a capture source and a paste sink you are handed), cross-device clipboard sync, persistent encrypted storage, OCR of images, and the UI — model the in-memory store and its policies.
What to produce. The class hierarchy (the entry types, the bounded history store, an eviction policy, per-type handlers, a search index), the public API each exposes, and the lifecycle of an entry. Be explicit about: how a bounded store evicts under a pluggable policy while never dropping pinned items, how different content types are handled without a giant type switch, and how concurrent captures and reads stay safe and consistent.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Concurrency Locks
- Data Eviction
- Patterns Strategy