Google | phone interview | time to wait for agent
Anonymous User
1375

Jessica wants to get auto insurance. When arriving at the insurance company, there are N agents (number 1 to N) serving nobody, and M people have already arrived with the same demand.
The company follows the rule of first arrived first served, and if more than 2 agents can serve a customer at the same time, the customer will always choose the one with the smallest number.
For agents, each of them has a constant serving time that the ith agent will take T[i] minutes to serve a customer. Assume Jessica arrived at time 0, and all the agents are idle and start to serve the customers.
The question is how many minutes will Jessica needs to wait before meeting with an agent?

couldn't answer the best time complexity.

Comments (7)