Open In App

Flipkart Interview Experience For SDE-2 (Off-Campus)

The interview rounds kick-started around 1st week of March 2024 and the details are as below:

Round 1: Machine Coding/LLD

(90 mins: 30 mins problem statement discussion +1 hr for coding)



In this round, the Question was to design a vehicle rental service such as Zoomcar. The functional requirements were like these:

Features:



  1. Rental services have multiple branches throughout the city. Assume one city for now.
  2. Each branch has a limited number of different types of vehicles.
  3. Each vehicle can be booked with a predefined price. For simplicity, assume fixed pricing.
  4. Each vehicle can be booked in multiple 1-hour slots. a. For simplicity, assume slots of a single day. b. For simplicity: assume slots to be from 00-59 i.e.: 9 am-10 am, 10 am-11 am, 11 am-12 noon and so on 5. No past bookings should be allowed.

Requirements:

  1. Onboard a new branch with an available vehicle
  2. Onboard new vehicle(s) of existing type to a particular branch
  3. Rent a vehicle for a time slot and a vehicle type(lowest price as the default choice extendable to any other strategy).
  4. 4. Display available vehicles for a given branch

Also, you can’t use any database here and have to use in-memory data structures for all operations which makes the CRUD operations a bit more annoying and this would be a CLI-driven system.

You have only 1 hour to complete these. But there is no need to panic here. Remember functionality is king, so make sure to get proper coverage of your requirements before thinking about design patterns. To ensure that your code is modular, extensible and follows good design principles you can use any language that provides proper project structure, boilerplate code and build tools to make your life easier. Due to familiarity, I used Gradle and Java 17.

Also make sure your driver code is ready to demo the functionality you built, so be sure to give it a few dry runs beforehand.

Just from a high level, this is how I proceeded:

Analyzed the requirements and identified the entities Created the Model/POJO and DTOs classes for these entities. It is not necessary to create complete models at the first attempt. You can always add/remove stuff later.

So start with some basic fields first Identify the interaction points of the user along with the system and create services and controllers respectively. It is also a good idea to make these loosely coupled and perform dependency injection which is otherwise handled by frameworks such as Spring.

You could also create repositories but since all CRUD operations are memory-based, I decided to not create one.- Created exception classes including a Global Exception handler and a minimal exception hierarchy which includes client-based, server-based exception classes(Optional and should be on low priority)

In service methods, I used Collections and Stream API extensively to satisfy all functional requirements. Recommend to split code in multiple lines as readability can be compromised by excessive chaining in streams. Since the database state would be persisted in these collections I made them thread-safe (completely optional).

With all that being said, it is completely ok if you are unaware of how to do some of these steps given that you create a working system. Remember this Design principle- KISS?

Knowledge of DSA can easily help you to simplify your CRUD operations. For example, Requirement 3 sounds complex to implement but you can do it easily if you use a min Heap and take an Overhead on insert_vehicle queries because insert_vehicle queries will be less often than book_behicle queries. Hence the complexity of book_vehicle is greatly reduced. For Requirement 4, I had to simply override the toString method of Java Object. For entities such as Slots, you need to design this data structure by wrapping around some objects which would both maintain the state info for display as well as be comparable with each other. Again, if you are unable to create these data structures, you should make acceptable assumptions and move on.

In the end, I refactored some code to make it readable and used dependency Inversion to make the code extensible.

After I designed this, I had an evaluation round with a panel of SDE2s at Flipkart, where certain use cases were tested. Make sure you have already written most of the driver code. The interviewer gave me certain use cases to run the system against and satisfied almost 99% of them. Then followed up with questions on design patterns which I had used a few in my system.

Also received Questions on the schema design and how would I handle certain relationships in my schema and some database storage and Query pattern-related questions

Round 2: DSA/PSDS

(1 hr for solution discussion, optimization and coding)

In this round, I was asked 2 LC-Medium problems and the panel were all SDE-2s working at Flipkart.

Problem 1: Although I don’t remember the exact problem, I could reduce the question to finding overlapping intervals based on certain scenarios which can be solved by the line sweeps approach:

https://leetcode.com/discuss/study-guide/2166045/line-sweep-algorithms

Problem2: Standard problem: Print Level order traversal of a binary tree using Given Inorder and Preorder Traversal

https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/

Code should compile and execute all test cases and should be neat. Explain your intuition and logic clearly.

Concepts used in the above problems- Sorting, TreeSet, Binary Trees, Recursive Subproblems

I had solved around 120 medium problems in Leetcode, so this was an easy one.

Round 3: Design(LLD+HLD)-60 mins

In this round, I was interviewed by some SDE3s at Flipkart

Question: Design Bookmyshow

Started by Gathering certain Functional Requirements of the system.

Took them through a user journey to consolidate a set of targeted system behaviours.

Identified entities that will be involved in every screen of the flow and were asked to design a class diagram for the same. Was also asked questions on associations and use cases for certain objects which I was able to justify.

This is the sample user journey I created:

First I created APIs for each of these scenarios such as:

  1. GET /shows/queryKeyword=?&type=?&city=? (type, city etc would be filter params)
  2. GET /shows/selectSeats/showId=? (for seat select screens)
  3. POST /shows/confirm/showId=? (validates the availability of selected seats and takes to confirmation screen for review and checkout)[acquires soft row lock on db here]

Request body: {

Seats:[],

Total price: xx,

Additional Services:[],

Status: ENUM_STATUS

Category: xx

}

POST /shows/checkout/showId=? -> checks for idempotency, completes payment and returns Tickets Info

GET /bookings/bookings/sortby=? -> To retrieve a list of bookings

Discussed how different objects would be used by each of the APIs and how the operations would be handled internally up to the DB. Also discussed in detail, are the use cases of multiple users trying to book the same seats for shows, failure scenarios, Datastore, race conditions resource contention at the db level etc.

For HLD:

Crunched some numbers to come up with user base, bandwidth, traffic and storage requirements

Here Questions were on NFRs, sharding, load balancing and caching and I highly recommend going through these topics once before sitting for the round.

Round 4 : Techno-Managerial Round(60 mins)

In this round, I was interviewed by a Senior EM at Flipkart, where we discussed my profile and experience.

I was asked to discuss a problem statement in one of my projects and the technical solution for it in granular mode. Hence it turned into a technical discussion about the scope of the problem, business case, coding, deployment etc. Was asked some questions related to solving it differently, what could’ve been done better, enhancements and all. Since this was a complete microservices project, I had to explain the entire ecosystem as well as where it fits.

Then followed some questions on NFRs and design to give an idea of the High-Level Architecture of the same. Also, some questions related to DevOps, pipelines and why a particular deployment setup was chosen.

Since I had mentioned working on Redis, some questions on Redis clustering and replication were asked.

Some scenario-based questions on both Technical and behavioural aspects were also being asked and the interviewer was pretty awesome and made me comfortable in conveying things the way I wanted to.

Some more questions about how I handled and fixed some incident/bug/ downtime issues and how I took ownership of certain tasks.

Finally a short discussion about my experience and role so far, and how I have developed over time.

This round was over around 10 mins before time but the interviewer was satisfied overall.

Round 5: HM Connect

This was just a normal connection with the hiring manager discussing the technical ecosystem, the LOBs, team structure, culture fitment and understanding of the role. I had a few follow-up questions and the manager was very well-spoken and responded very clearly. It was great to get some insights into the organization and understand the scale at which tech operates there. Also talked about individual progression, benefits and most importantly the Engineering culture.

Final Thoughts:

I had taken a gap for 2-3 days between every round and the last one happened after almost 3 weeks as there was some unexpected delay from the HR end. After the final connection, I got the offer letter 2 weeks later. I felt that the content across GFG, LeetCode and YouTube is more than sufficient to crack this role. I would also recommend taking mock System design interviews before sitting for the actual ones. Due to my experience, these were the first actual design rounds I had attempted and I felt there was a lot for me to learn even though I got through.


Article Tags :