Implement A Prioritized Task Scheduler With Parent Dependencies
Company: Rippling
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Implement a task scheduler. Each task has an id, due date, create time, high-priority flag, assignee, completion status, description, and optionally a parent id. The scheduler should filter out tasks that already have an assignee and tasks that are complete. It should output runnable tasks ordered by due date, then high priority, then create time. In the follow-up, if a task has a parent, the parent must run before the child and the output should include parent task descriptions.
<details>
<summary>Hint 1</summary>
Start by naming the core entities, constraints, and success criteria.
</details>
<details>
<summary>Hint 2</summary>
Make the trade-offs explicit before going deep on implementation details.
</details>
### Constraints & Assumptions
- The prompt is an in-memory coding design exercise.
- The base sort order is deterministic.
- Parent dependencies form a task graph unless the interviewer states they are always trees.
- AI assistance may be allowed, but the logic must be verified by the candidate.
### Clarifying Questions to Ask
- Are earlier or later due dates higher priority?
- Should high-priority tasks come before normal tasks for the same due date?
- Can parent chains be longer than one level?
- Can there be dependency cycles?
- Should a completed parent still be printed before a child?
### What a Strong Answer Covers
```premium-lock What a Strong Answer Covers
```
### Follow-up Questions
- How would you handle multiple children under one parent?
- How would you support incremental task updates?
- What if a parent is assigned but the child is not?
- How would you test AI-generated code for dependency bugs?
Quick Answer: Review a task scheduler implementation prompt with filtering, due-date ordering, high-priority tie-breaks, create-time ordering, and parent dependencies. The question targets comparator design, dependency traversal, cycle handling, and testing AI-assisted code.
Implement a task scheduler. Each task has an id, due date, create time, high-priority flag, assignee, completion status, description, and optionally a parent id. The scheduler should filter out tasks that already have an assignee and tasks that are complete. It should output runnable tasks ordered by due date, then high priority, then create time. In the follow-up, if a task has a parent, the parent must run before the child and the output should include parent task descriptions.
<details>
<summary>Hint 1</summary>
Start by naming the core entities, constraints, and success criteria.
</details>
<details>
<summary>Hint 2</summary>
Make the trade-offs explicit before going deep on implementation details.
</details>
Constraints & Assumptions
The prompt is an in-memory coding design exercise.
The base sort order is deterministic.
Parent dependencies form a task graph unless the interviewer states they are always trees.
AI assistance may be allowed, but the logic must be verified by the candidate.
Clarifying Questions to Ask
Are earlier or later due dates higher priority?
Should high-priority tasks come before normal tasks for the same due date?
Can parent chains be longer than one level?
Can there be dependency cycles?
Should a completed parent still be printed before a child?
What a Strong Answer Covers Premium
Follow-up Questions
How would you handle multiple children under one parent?
How would you support incremental task updates?
What if a parent is assigned but the child is not?
How would you test AI-generated code for dependency bugs?