Company: Zomato
Difficulty: medium
Problem Description An auction web service uses a "bid over starting price" model. Buyers can increase the starting price of a lot an unlimited number of times by a fixed bid step predetermined by the seller. The buyer who places the last bid wins. The QA department reported a bug where buyers were able to bid against themselves, meaning they placed consecutive bids on the same item. The development team is working on a fix and needs to identify and eliminate all duplicate bids. Write a query that returns a list of all affected lots alongside an aggregated list of duplicate bid IDs for each buyer. Schema buyers Column Type Description id INT Buyer ID (Primary Key) username VARCHAR(255) Buyer username lots Column Type Description id INT Lot ID (Primary Key) name VARCHAR(255) Lot name starting_price DECIMAL(6,2) Lot starting price amount bid_step DECIMAL(6,2) Lot bid step amount bids Column Type Description id INT Bid ID (Primary Key) buyer_id INT Buyer ID (Foreign Key) lot_id INT Lot ID