← 返回 anthropic 的题目列表Task Management System (CRUD + Priority Ordering + User Quota + History Query)
类型:online_judge
Problem: Task Management System (CRUD + Priority Ordering + User Quota + History Query)
Implement an in-memory task management system, progressively adding features by levels. You may use any programming language.
Level 1: Basic CRUD
Support basic operations on tasks:
Create a task
Read/query a task
Update a task
Delete a task
Each task should include at least:
task_id (unique identifier)
created_at (creation timestamp or monotonic creation sequence)
priority
Level 2: Sort by priority and creation order
When returning a list of tasks (or query results), support ordering:
Sort primarily by priority
Break ties by creation order/time
Level 3: User quota and task assignment
Introduce users and quotas:
Allow assigning a task to a user
Each user has a quota (e.g., max N assigned tasks)
If the quota would be exceeded, the assignment must fail / be rejected
Level 4: History queries
Add history query capabilities, e.g.:
Query the change history of a task (create/update/assign/delete)
Or query the historical state of a task/task list at a given time/version
Note: The original post does not specify exact I/O format, field details, or the precise quota/history semantics. Define reasonable APIs/data structures and ensure your implementation demonstrates each level’s requirements.
Example
Input
N/A
Output
N/A