This is a verified interview question from Persistent-systems. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "SQL: Auction Web Service Lot Winners" covers key patterns like Other.
"SQL The auction web service uses a "bid over starting price" model where buyers can increase the starting price of a lot an unlimited number of times with a fixed bid amount predetermined by the seller. The buyer who left the bid last wins. Create a query that returns a list of all available lots with the number of bids, the current lot price, and the current lot winner. The result should have the following columns: name / starting_price / bid_step / bids / current_price / current_winner . * name - lot name * starting_price - lot starting price * bid_step - lot bid step * bids - total number of bids for a specific lot * current_price - current price of the lot, calculated as start_price + (bid_step * number_of_bids) * current_winner - username of the buyer who made the last bid on a specific lot The result should be sorted in ascending order by name. Note: * Some lots may not have bids * Buyers can outbid their own bids despite no competition SCHEMA and OUTUPT Format  "
Join thousands of developers practicing for Persistent-systems.