Earliest Finish Time For Dependent Overnight Risk Batch Jobs

Last updated: November 29, 2026

Quick Overview

Given overnight risk jobs with durations and a list of prerequisite pairs, compute the earliest time all jobs can finish if independent jobs run in parallel, and raise an error if the dependencies contain a cycle.

Point72
Coding & Algorithms
Software Engineer
Point72
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Medium

0

0

0 solved


Given overnight risk jobs with durations and a list of prerequisite pairs, compute the earliest time all jobs can finish if independent jobs run in parallel, and raise an error if the dependencies contain a cycle.

Point72's risk and portfolio analytics depend on a nightly chain of jobs (pricing, factor exposures, VaR, reports) that must finish before the morning meeting. The interviewer wants topological sort plus longest-path reasoning on a DAG, and clean cycle detection since a bad config should fail loudly.

What the Interviewer Expects
  • Model jobs as nodes and prerequisites as directed edges
  • Use Kahn's algorithm with in-degrees to process in dependency order
  • Compute each job's finish time as its duration plus the max finish of its prerequisites
  • Detect a cycle when not all nodes are processed
  • Return the overall makespan and optionally the critical path
  • Analyze O(V + E)
Key Topics to Cover
topological sort
Kahn's algorithm
longest path in DAG
cycle detection
critical path
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 would you return the critical path so the team knows which job to optimize?
  • If only W workers are available, is the problem still easy? What heuristic would you use?
  • A job fails at 2 a.m.: how do you compute which downstream jobs must be rerun?
  • How do you report the exact cycle when one is found?
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

Jobs have durations; a pair (a, b) means b cannot start until a finishes. With unlimited parallelism, the earliest overall finish is the longest weighted path through the DAG. If the dependency graph ...

High-Level Design

Run Kahn's algorithm. Start with all zero in-degree jobs, whose finish time equals their own duration. When a job is popped, relax each successor: its finish is at least the predecessor's finish plus ...


Submit Your Answer
Markdown supported

Related Questions