Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Minimize Project Timeline with Task Scheduling

MediumPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Minimize Project Timeline with Task Scheduling. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Given a list of tasks, each represented by a tuple (task_id, duration, dependencies) where task_id is a unique identifier, duration is the time required to complete the task, and dependencies is a list of task IDs that must be completed before this task, determine the minimum time required to complete all tasks.

You may assume that all tasks can be completed and there are no circular dependencies.

Constraints

  • 1 <= tasks.length <= 10^4
  • Each task_id is unique and positive.
  • 0 <= duration <= 1000

Function Signature

def min_project_time(tasks: list[tuple[int, int, list[int]]]) -> int:
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output