Panda Guru LogoPanda
Guru

Flipkart | SDE-2 | Machine Coding Round

Machine Coding Round

Questions: The problem involves creating an Online Auction System for a company FooBar where users can participate in auctions. The system must handle the following functionalities:

Highest Unique Bid Definition: For example, if users A, B, C, D, E, F participate in auction A1 with the following bids:

Here, 70 is the highest unique bid, making E the winner. If no unique highest bid exists, there is no winner.

Sample Test Cases: Test case 1:

Test case 2:


Candidate's Approach

The candidate designed a class structure to represent Buyers, Sellers, and Auctions. Each auction maintains a list of bids, and the system checks for the highest unique bid when closing an auction. The profit/loss calculation for sellers is implemented based on the provided formula. The candidate ensured that the code is modular and adheres to object-oriented principles, allowing for easy extension and maintenance.

Interviewer's Feedback

The interviewer appreciated the candidate's approach to modular design and the clear implementation of functionalities. However, they suggested adding more edge case handling, especially for bid limits and auction closures. The interviewer also recommended improving the documentation within the code for better clarity.