Groww | SDE2 | Backend
Anonymous User
1081

Maching Coding Round

Design problem:
Splitwise Requirements
1 : Add/remove users -

  1. Add group + add/remove users to a group :
  2. Add expenses between 2 users.
  3. Add group expenses.(100 people)
    Extended : [Txn can be made within subset of people from group (ex: 10 people txn can be made within 2,3,4.....10 people]
    Extended 2 : Implement Equal split, keep code extensible for custom split.
  4. Should be able to settle the balance between 2 users. (it should mark settlement in all groups too) Ex: user_1 owes user_2 Rs 100 as P2P User_1 owes user_2 Rs 120 in group_1 User_2 owes user_1 Rs 130 in group_2 Net Balance: (100+120)-130 = 90 There is no partial settlement as an MVP product Extension if time allows: Split unequally/custom one person pays and custom cost for each participant in a group.
  5. Expectation: Write a clean code keeping in mind OOPS principle and extensibility of code.
  6. Use in memory data structures to keep track of records or use in-memory db if you are comfortable.
  7. Do run scenarios in a main method or test class to show the working code.

Design Round HLDLLD

PROBLEM STATEMENT

Design a Ride sharing application where drivers can offer rides based on origin , destination and number of seats

Basic Functionalities :-
i) Add Driver
ii) Add Rider
iii) Create Ride (id , origin , destination and number of seats)
iv) Update Ride (id , origin , destination and number of seats)
v) Withdraw Ride (id)
vi) Close Ride and show amount charged
vii) Upgrade Rider to preferred Rider if he/she has done more than 10 trips

Design a pricing strategy. Charge should be on the basis of kilometers covered and number of seats.Preferred rider should be charged less

Design a driver assignment strategy. Preferred rider should be assigned driver first

Draw a HLD diagram showing all the required components , classes , methods and their interaction. Draw an activity diagram to describe Rider journey

Design should be extensible and scalable . Should be easy to add/remove functionality

Comments (1)