Google TR1 Question | New Grad
Company: Google
Role: L3 (SWE1)
Interview Stage: unknown
Location: unknown
Year: unknown
Original Post Content:
Hello LeetCode community,
I recently encountered a a job scheduling problem in a Google interview.
Problem:
We have a list of jobs, each with a SubmissionTime and ExecutionTime. Our task is to calculate the StartTime and EndTime for each job.
Input:
Job 1: SubmissionTime 0 ExecutionTime 5
Job 2: SubmissionTime 5 ExecutionTime 10
Job 3: SubmissionTime 17 ExecutionTime 5
Expected Output:
Job 1: StartTime 0 EndTime 5
Job 2: StartTime 5 EndTime 15
Job 3: StartTime 17 EndTime 22
Explanation:
Job 1 arrives at 0, so it starts immediately and finishes at 5 (0 + 5).
Job 2 arrives at 5, so it starts at the time it arrives and finishes at 15 (5 + 10).
Job 3 arrives at 17 and starts as soon as the previous job finishes at 17, completing at 22 (17 + 5).