Data Structures & AlgorithmsHardTCS NQT · Accenture

A bank of 4 workers each processes one task per minute, and tasks arrive as a queue. In a single pass over the array of task lengths [3, 1, 2, 5, 4, 1], each task goes to the worker who is free earliest. What is the finishing time of the whole job in minutes?

  1. A. 6
  2. B. {C+5}
  3. C. 5
  4. D. 8

Correct answer: C. 5

Assign each task in turn to the earliest-free worker, then take the maximum finish time. The makespan is not the sum divided by four.

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

Exams that ask this topic