Data Structures & AlgorithmsVery hardICPC regional · Amazon SDE OA

Four jobs given as (deadline, processing time) are (2, 3), (4, 2), (5, 6), (7, 4) and run one after another from time 0. Order them by earliest deadline. What is the maximum lateness (completion minus deadline, at least 0)?

  1. A. 10
  2. B. 15
  3. C. 8
  4. D. 16

Correct answer: C. 8

EDD order (2,3), (4,2), (5,6), (7,4) completes at 3, 5, 11, 15, with lateness 1, 1, 6, 8, so the maximum is 8. Shortest-processing-time order gives 10, 16 is the total lateness, and 15 the final completion time.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic