The rounds were basically scheduled one per week.
1st round, coding:
Use round-robin scheduling to process tasks. Each task has a task_id, seller_id, tier (VIP or STANDARD), and priority (1 is high and 3 is low).
Within one seller's backlog, tasks with smaller priority numbers must be processed first. Tasks with the same priority follow their arrival order, using FIFO.
Across sellers, use weighted round-robin scheduling. When it is a seller's turn, a VIP seller may have up to two tasks processed consecutively in that round, while a STANDARD seller may have only one task processed. Processing then moves to the next seller.
The two methods to implement were:
receive_task(task)
process_next_task()
process_next_task() returns the next (seller_id, task_id) to process.
The structure was an outer weighted round-robin Deque, with a minimum heap for each seller on the inside.
2nd round, coding:
A variation of LeetCode 269, Alien Dictionary. Build an adjacency list and use topological BFS.
3rd round, hiring manager:
Behavioral questions plus a coding problem, LeetCode 435. The approach was greedy, sorting by end time.
Discussion
Loading comments…