This project is an auction-bid microservices system written in Go. The auction service gets all the bids from the bidding service and return back the bid with the best price.
make run
the project to run.
Run the following command to make a request to the auction server:
curl http://localhost:8000/
Run the test with make test
Design two services (Bidding & Auction) one which is bidding on an adrequest and another which is performing the auction from multiple bidders.
- Receives an AdRequest i.e http request for an ad object with an AdPlacementid, a unique string identifying an Ad Slot or Ad Spot.
- Every AdRequest should be responded with an AdObject that should contain at least an AdID (to uniquely identify an ad) and bidptice (random price for the AdPlacementid in USD).
- Incase the bidding service does not want to buy an ad slot, the service call should return a 204, this can also be in random order
- Incase the service bids for an AdRequest, it should return the AdObject on a 200 status code.
- The auction service shall call multiple bidding services at the same time (header bidding)
- The auction service gets all the bids available from associated Bidding Services as 200 status code responses for valid bids.
- Auction service should accept an AdPlacementid in an externally exposed API.
- The auction service selects the bid for an Ad Placement with the highest bidprice amongst different services
- Incase no eligible bids by the bidding service in an auction, the auction service returns a 204 status code
- The auction service should have a safety circuit to prevent bad bidding services from increasing latencies
- If a bidding service does not respond within 200ms, the auction service should not accept the bid for auction from that bidding service
Your code will be tested by making a call to an auction API exposed out. Since the circuit has been applied, the exposed API should always respond within 200ms You will be tested on code simplicity, design and concurrency. Write relevant test cases. Think about scalability, concurrency and functionality while running designing your code base. Create a docker compose file to get the services up and running.