Bidding System
Design Flipkart Plus's daily rewards bidding system — lowest-unique-bid wins, super coin wallet deductions, and past-winner history.
Flipkart Plus members get the chance to win a lavish item each day through BidBlitz — a rewards bidding system where members pledge Super Coins to bid on the day's item. Unlike a typical auction, the lowest bid wins, not the highest.
This one tests whether you can get the bid-evaluation and wallet-deduction rules exactly right — only the member's highest submitted bid is deducted (not the sum), ties break by submission order, and every rule around registration and bid uniqueness has to hold before a winner can even be declared.
Objective
The primary objective of this project is to design and implement an in-memory bidding system where members register for daily events, submit up to five unique bids in a single go, and the system correctly declares the member with the lowest bid as the winner — breaking ties by submission time — while tracking a browsable history of past winners.
Functional Requirements
Requirements are split into two tiers so you know what to prioritize under time pressure: build first, and build as a bonus.
Part 1 — Basic Requirements
Core functionality you must build and get working first.
1. Member Management
Add members to the system, each assigned a number of Super Coins by the system. The assigned coin count must be greater than zero.
2. Event Management
3. Registration
Members can register for an event; only registered members may submit bids for that event.
4. Submitting Bids
5. Declaring the Winner
Part 2 — Bonus Requirement
Extensibility check — can your design support browsing history without touching the core bidding logic.
Command Reference
Example Usage: Full Walkthrough
1. Add members
> ADD_MEMBER 1 akshay 10000
Akshay added successfully
> ADD_MEMBER 2 chris 5000
Chris added successfully
2. Add an event
> ADD_EVENT 1 BBD IPHONE-14 2023-06-06
BBD with prize IPHONE-14 added successfully
3. Register members
> REGISTER_MEMBER 1 1
Akshay registered to the BBD event successfully
4. Submit bids
> SUBMIT_BID 1 1 100 200 400 500 600
BIDS submitted successfully
> SUBMIT_BID 2 1 100 200 400 500
BIDS submitted successfully
5. An unregistered member tries to bid — rejected
> SUBMIT_BID 10 1 100 200 300 400 500
Member did not registered for this event
6. Declare the winner
> DECLARE_WINNER 1
Akshay wins the IPHONE-14 with lowest bid 100
Akshay's lowest submitted bid of 100 beats Chris's lowest of 100 as well — wait, both submitted 100, so the tie-breaker applies: Akshay is declared the winner because his bid of 100 was submitted first, exactly as the tie-breaking rule requires.
7. List past winners (bonus)
> LIST_WINNERS asc
[ { event_id: 1, winner_name: "Akshay", lowest_bid: 100, date: "2023-06-06" } ]
Guidelines
Input can come from a file, STDIN, or a coded driver method — no API, no UI. Output can go to a file or STDOUT. All interim and output data must live in in-memory structures; databases are not allowed. Internet use is restricted to syntax lookups. The language must be Java. Save the project under your own name, and email it or upload it to the provided Google Drive link — since it will run on another machine, explicitly list any dependencies in your email.