Simulate a Human Data Pipeline With Dependent Tasks

Last updated: November 29, 2026

Quick Overview

Tasks in an AI-training data project (writing, review, gold-set creation, audit) have durations, priorities and dependencies; with W identical experts, simulate list scheduling where free experts always start the highest-priority ready task, and return the makespan and each task's start and end, detecting cycles.

Micro1
Coding & Algorithms
Software Engineer
Micro1
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


Tasks in an AI-training data project (writing, review, gold-set creation, audit) have durations, priorities and dependencies; with W identical experts, simulate list scheduling where free experts always start the highest-priority ready task, and return the makespan and each task's start and end, detecting cycles.

Project leads at a human-data company need to promise AI lab clients a delivery date for multi-stage work. The interviewer checks Kahn-style dependency tracking combined with an event-driven simulation, correct handling of simultaneous completions, and cycle detection.

What the Interviewer Expects
  • Validates dependencies reference known tasks
  • Combines in-degree tracking with a ready priority queue
  • Uses an event heap of running tasks keyed by end time
  • Releases all tasks that finish at the same time before scheduling
  • Detects cycles by counting scheduled tasks
  • States that greedy list scheduling is not optimal and why
Key Topics to Cover
Topological sort
Priority queues
Discrete event simulation
Cycle detection
Scheduling heuristics
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How far from optimal can greedy list scheduling be, and what bound applies?
  • How would you model experts with different domains or speeds?
  • How would you use this simulation to answer: how many extra reviewers do we need to ship by Friday?
  • What if durations are random? How would you estimate a P90 delivery date?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: tasks = {id: (duration, priority)}, deps = [(before, after)], workers = W. Any free worker takes the ready task with the highest priority, ties by id. A task is ready when all predecessor...

High-Level Design

Keep in-degrees and a children list. The ready set is a heap of (-priority, id). Running tasks sit in a heap of (end, id). The loop alternates two phases: fill every free worker from the ready hea...


Submit Your Answer
Markdown supported

Related Questions