Google Phone Screen Round 28th August 2025
1112
Aug 28, 2025
Aug 28, 2025
You're tasked with designing a system that handles a real-time stream of item listings. Each listing consists of:
- seller_id
- price (ranging from ₹0.01 to ₹100)
- time (the system timestamp at which the item is listed)
Each seller can list the same item multiple times. Your system should support the following two operations:
- insertEntry(seller_id, price, time): This method is called whenever a seller lists a new item.
- getSellerId(): This method returns the seller_id of the listing with the lowest price and removes it from the system (meaning it is sold). In case of a tie (i.e., multiple listings with the same lowest price), return the one with the earliest timestamp.
- What should be the datatype of the variables seller_id, price, time. You can consider time as epoch time.
- What data structure(s) would you use to efficiently support these operations?
- What would be the time complexity of each method?
Comments (5)


