System Design | Online interview | Design a Limited Time Deals

📌---------------------------------------------------Problem Statement-----------------------------------------------------📌

You happen to be a budding entrepreneur and you have come up with an idea to build an ecommerce giant like amazon, flipkart, walmart, etc. As part of this ambition, you want to build a platform to duplicate the concept of Limited Time Deals.

Limited Time Deals

  • A limited time deal implies that a seller will put up an item on sale for a limited time period, say, 2 hours and will keep a maximum limit on the number of items that would be sold as part of that deal.
  • Users cannot buy the deal if the deal time is over
  • Users cannot buy if the maximum allowed deal has already been bought by other users.
  • One user cannot buy more than one item as part of the deal.

Task is to create APIs to enable following operations Create a deal with price and number of items to be sold as part of the deal

  • End a deal
  • Update a deal to increase the number of items or end time
  • Claim a deal

Guidelines

  • Document and communicate your assumptions in README.
  • Create a working solution with production quality code.
  • Use an external database like postgres/mysql or any noSQL database
  • Define and Create APIs to support the operations mentioned above
  • Define the associated entities related to inventory by creating relevant tables in Database. You do not need to create APIs to manage inventory
  • Write few unit tests for the most important code

What are we looking for?

  • Your approach towards the solution
  • How you write code in terms of readability and maintainability
  • Designing Database Schema
  • Usage of best practices
  • Testing skills

Out of scope : Handling at large scale

📌-------------------------------------Interview Tips from Udaan Team :---------------------------------------📌

Round 1: MACHINE CODING
Time : 90 minutes for Coding + 30 minutes for Evaluation/ Explanation

You will be given a problem statement. You will need to implement a Simple System (either as a service or as a web/mobile/command-line application). The system needs to demonstrate functionalities as given during the discussion and you are expected to cover all functionalities while writing a good, clean and extensible code.

At the end of 90 minutes, the interviewer will start the discussion on the problem statement. This will mostly be done by you, sharing your screen, and the interviewer going through your code and asking questions.

Interview Tips and How to prepare :

“Sample problem statement: Splitwise”

You are expected to be prepared to build an application like this from start to finish in the allotted time. So please have a dev environment setup ready in your laptop - Sample project in your IDE etc.
Prepare for the coding round by practicing the above-mentioned sample problem in a timed way.
When the interviewer is giving you the problem statement, in the beginning, ask questions if you do not understand some aspect. This time will not get counted in the 90 minutes.
Break down the problem and make progress by attacking the parts.
Expectations after 90 minutes:

Code should be executable (no compiler errors) and can demonstrate all the functionalities.
Clean and extensible code.
Good modeling.
Proper separation of concerns.
Code Completion - 70%
Ability to use language constructs effectively.

Comments (3)