← 返回 rippling 的题目列表Task Manager Filter / Sort / Dedupe
类型:qbank
Given a list of tasks, remove duplicate tasks by description plus due date, filter to open unassigned work, sort by due date, high-priority flag, and creation age, then print each task in a specified display format with an optional parent-task suffix. A follow-up adds parent IDs and requires parent-before-child execution, with each child run immediately after its parent completes.
Requirements
Input is an unsorted list of task records. Each task can include id, description, due_date, created_at, is_high_priority, assignee, is_done, and optional parent-task metadata.
Treat tasks with the same description and due_date as duplicates; keep only the first such task in the result.
Filter to tasks with no assignee and not yet done.
Sort the remaining tasks by:
earliest due_date;
then high-priority tasks before non-high-priority tasks;
then oldest created_at.
Print tasks in priority order using exactly:
Task ID: {id}, Description: {description}
If the task has a parent task, append:
, parent: {parent_task_description}
Part 2 adds a parent_id. Execute each parent before its child, run the child immediately after the parent completes, and print the resulting task execution list.
Notes
The prompt is deceptively simple. The main risk is writing filters and sort keys before confirming whether duplicate detection happens before or after filtering, how null dates compare, and whether the first duplicate means input order or creation time.
In AI-assisted rounds, interviewers can default to AI tools without asking for opt-out. Own the data model, comparator, and output contract before asking the tool to generate helper code.
A stable sort or explicit tuple key is cleaner than repeated custom comparison logic; preserve original input index so duplicate retention is deterministic.
For the parent-child follow-up, clarify how to order multiple children of one parent and what to do when a parent is missing or already complete.
One onsite variant contains three parts and sets the expected completion target at two. The working sequence is read and clarify the prompt, explain the approach, prompt the AI, review the generated code, walk through test cases, and explain what would differ in a hand-written implementation.
Preparation
Implement the task pipeline as separate stages: normalize records, dedupe, filter, sort, format. Unit-test each stage independently.
Practice comparator edge cases: same due date with different priority, missing parent, duplicate after filtering, duplicate before filtering, and tasks with equal sort keys.
Run one timed version with AI assistance and one without; in the AI version, restrict prompting to small helpers and review every branch before running tests.