Design a generic application that presents lists of items organized by category. Define its data model and API so every attribute used by the UI has a clear meaning consistent with the overall design.
### Constraints & Assumptions
The source specifies lists, categories, and API/design consistency, without a particular product domain. For a concrete practice scope, use items belonging to one category, with stable IDs, titles, and optional descriptions. Discuss multiple-category membership as a changed requirement.
### Clarifying Questions
Can an item belong to several categories? Are categories hierarchical? Who can edit items? What ordering and pagination are needed? What happens when a category is deleted?
### What a Strong Answer Covers
Consistent resource identities and relationships, list/detail APIs, validation, pagination, client state, and explicit deletion semantics.
### Follow-up Questions
How do you prevent an API from returning category labels where the client expects IDs? What changes for many-to-many membership? How do edits interact with cached category lists?
Overview: Design a list-and-category application with consistent resource schemas, membership semantics, cursor pagination, validation, deletion policy, and client cache updates.
Design a generic application that presents lists of items organized by category. Define its data model and API so every attribute used by the UI has a clear meaning consistent with the overall design.
Constraints & Assumptions
The source specifies lists, categories, and API/design consistency, without a particular product domain. For a concrete practice scope, use items belonging to one category, with stable IDs, titles, and optional descriptions. Discuss multiple-category membership as a changed requirement.
Clarifying Questions Guidance
Can an item belong to several categories? Are categories hierarchical? Who can edit items? What ordering and pagination are needed? What happens when a category is deleted?
What a Strong Answer Covers Guidance
Consistent resource identities and relationships, list/detail APIs, validation, pagination, client state, and explicit deletion semantics.
Follow-up Questions Guidance
How do you prevent an API from returning category labels where the client expects IDs? What changes for many-to-many membership? How do edits interact with cached category lists?