Facebook |Onsite |Minimum number of drone to deliver package

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-03-10Added By Anonymous
Source: Link

Company: Meta
Role: e3, e4
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

Got a very weird question, just one sentence, "Given a warehouse with drones, determine minimum number of drones to deliver packages at the end of day". No example, no input and no output. I think the interviewer was trying to see how I complete detail of the question.

Here is my proposal of the question, let's say time cost of package delivering will be stored in an array, so it will be [3, 1, 5, 4, 7, 9], so first package will be delivered in 3 hours and so on.

The interviewer didn't say yes or no and just say you can do whatever you want, it's your question.

My first solution is Brute force,
Step 1: Start the number of drones from one
Step 2: Add all time cost to see if it is smaller than 24, if yes, return the current drone number, if not, add one to current drone number.

And then the interviewer asked "do you think it will work?", I was not sure because it was a signal that means your direction is wrong. So I denied my solution and finally didn't work it out.

After the interview, I was trying to think about this question, didn't find same question online, it is similar with 875. Koko Eating Bananas, but not totally same. So I was wondering how can I complete detail of the question and is my thoughts right? Or any thoughts from you?

Comments