Data Engineer • Mid-Level
Data Engineer • Mid-Level
High QualityInterview Summary
I had a technical interview with Meta involving an object-oriented Task Manager implementation. The problem started with filtering, deduplicating, and sorting tasks according to multiple conditions, then expanded into handling hierarchical parent-child relationships. The challenging part was not implementing a complex algorithm, but clarifying requirements, choosing appropriate data structures, and adapting the original sorting logic to support recursive task dependencies.
Interview Details
Round 1 — Coding: Task Manager With Multi-Level Task Hierarchies
Part 1 — Implement a Task Manager With Filtering and Prioritized Sorting
The interviewer asked me to implement a TaskManager class that accepts an initial collection of tasks and exposes a method called print_prioritized_tasks. Each task contains eight attributes:
id: Unique task identifier.description: Text describing the task.completed: Boolean indicating whether the task is finished.due_date: Optional deadline.parent_id: Optional identifier of the parent task.assignee: Optional person responsible for the task.high_priority: Boolean indicating whether the task is important.created_at: Task creation timestamp.
The goal was to filter the tasks, eliminate duplicates, sort the remaining tasks according to a set of prioritization rules, and print them in the required format.
-
Filtering and Deduplication Requirements
The first step was to determine which tasks should appear in the output. Only tasks satisfying both conditions were eligible:
- The task had not been completed.
- The task had no assigned owner.
After filtering, duplicate tasks needed to be removed. Two tasks were considered duplicates when they had the same
descriptionanddue_date. If multiple eligible tasks shared those values, only the first matching task from the original input should be retained. -
Multi-Condition Sorting Requirements
The remaining tasks needed to be sorted according to several rules, evaluated in order:
- Tasks with a due date must appear before tasks without one.
- Among tasks with different due dates, earlier deadlines come first.
- When deadlines are identical, high-priority tasks come first.
- When both deadlines and priority levels match, tasks created earlier come first.
- Tasks without a due date must appear after all tasks with deadlines.
The challenge was ensuring that the sorting behavior consistently respected the precedence of these conditions.
-
Output Formatting
The
print_prioritized_tasksmethod needed to print each task on a separate line. Each line had to include the task ID and its description. If a task had a parent, the output also needed to append the parent's description in the format:parent: <parent description>。 The parent information was determined using the task'sparent_id. -
Requirement Clarification
Unlock Full Details
Create a free account to unlock this interview experience report.