The interview went smoothly, the hr responded rapidly, and the interviewers are friendly. The first 2 rounds focused heavily on the resume and fundamental knowledge, so be prepared for js/react/html/css questions.
I just completed the screening interview, which involved solving mid-level LeetCode problems. One of the key questions was a queue-based, real-world simulation of a supermarket checkout system. The task was to model how customers join the queue, get served by available cash registers, and how the system handles multiple queues or different processing speeds. It was a great test of algorithm design, data structure knowledge, and applying problem-solving skills to a realistic scenario.
Interview questions [1]
Question 1
Question:
You are tasked with simulating a supermarket self-checkout system.
The supermarket has N checkout counters, each with its own queue.
Customers arrive one by one, each with a certain number of items.
A counter processes one item per minute.
Rules:
1. A customer always chooses the counter with the shortest queue length (if there’s a tie, choose the one with the smallest counter ID).
2. When a customer is being served, their remaining items decrease by 1 each minute.
3. If a counter’s queue becomes empty, it is immediately available for the next arriving customer.
Input:
• N — number of checkout counters.
• A list of customers, where each customer is represented as (arrival_time, items).
Output:
• A list showing the finish time for each customer in the order they arrived.
N = 2
Customers = [(0, 5), (0, 2), (1, 3), (4, 1)]
Output: [5, 2, 6, 5]
Explanation:
• Time 0: Customer 1 goes to Counter 1, Customer 2 goes to Counter 2.
• Time 1: Customer 3 arrives, joins Counter 2 (shorter queue).
• Time 4: Customer 4 arrives, joins Counter 1 (shorter queue).
Uses an external site for testing your coding skills, you can only apply to two positions and the score on coding for one position will be used for the other one as well.
Interview questions [1]
Question 1
SQL script that takes the maximum of a value in one table, based on a join of data from another table