Imc

Interview Question

Software Developer Interview
Imc

People are waiting for an elevator in a hotel that has floors numbered 0 to M. The elevator has a limit of X people and a weight limit of Y. There are N people standing in a queue at the ground floor. You are given two arrays: A[N], where each element is the weight of a person, and B[N], where each element is the floor each person wants to go to. The elevator goes up, stopping at each requested floor, then returns to the ground floor. Write a solution to determine how many times the elevator will stop.

Unlock the Full Solution

Enter your email to get instant access to the complete solution, explanation, and similar practice problems.

Insights on 100+ quant firms, understand where to apply, and maximize your chances.

Get the official 2025 QB Quant Firm Tier List

Check your email inbox — you should get the interview in 1-2 minutes!