Cleartrip SDE Interview Experience

Anonymous4 weeks ago

Role: Backend Engineer
Result: Could not proceed to the next rounds

Hi everyone,

I recently interviewed with Cleartrip for a Backend Engineer role. The process involved a machine coding round focused on Low-Level Design (LLD), followed by a discussion on my implementation and concurrency handling.

I couldn't make it to the next rounds, but the experience gave me a good idea of the kind of design and backend questions to prepare for. Sharing the details below.

Round 1: Low-Level Design (90 minutes)

The problem was to design a simplified food ordering system similar to Swiggy or Zomato.

The entire implementation had to use in-memory data structures, without a database. We also had to write a driver program to demonstrate the functionality through multiple test cases.

The main requirements were:

  • Register users and restaurants.

  • Allow restaurants to manage their menus.

  • Search for food items and sort the results by price.

  • Place orders and maintain order history for each user.

  • As a bonus, implement order cancellation.

I structured the solution around entities such as User, Restaurant, MenuItem, Order, OrderStatus, Catalog, and FoodOrderingService. I used HashMaps for lookups and collections to manage catalog data and order history.

Order placement also required updating item inventory, while cancellation involved restoring inventory and updating the order status correctly.

The cancellation flow needed to account for cases such as invalid order IDs, already-cancelled orders, and ensuring inventory wasn't restored more than once.

The focus wasn't just on getting the code to work. The interviewer was also interested in the class structure, separation of responsibilities, entity relationships, edge cases, and whether the implementation could be demonstrated properly.

Before finishing, I ran through the main flows using hardcoded test cases, including user and restaurant registration, menu creation, item search, order placement, order history, and cancellation.


Round 2: LLD Follow-up and Concurrency

The next day, I had a discussion based largely on the design and code from the first round.

We started with the design itself. The interviewer asked why I had chosen particular entities and class relationships, whether some classes could be broken down further, and where interfaces would make sense.

We also discussed how the design could evolve to support multiple restaurants, multiple items in a single order, database persistence, and a more production-ready architecture.

Concurrency was a major part of this discussion.

Some of the scenarios we discussed were:

  • Two users trying to order the last available item at the same time.

  • Preventing inventory from becoming negative.

  • Handling race conditions during order placement.

  • Whether a regular Java HashMap would be safe for concurrent access.

  • Choosing between item-level and restaurant-level locking.

  • Understanding optimistic vs. pessimistic locking.

  • Using concurrent collections where appropriate.

  • Ensuring that order placement and inventory updates happen atomically.

The questions were practical and closely related to real backend development. It wasn't enough to explain the concepts; I also had to think about how the design would behave when multiple requests arrived simultaneously.

Unfortunately, I couldn't proceed to the next rounds.

Recommended Reads

Post

Transitioning from DBA to Data Science

Hello Everyone, I hope you're doing well. My name is Saikiran Panthagani , and I have been working as a Database Administrator (DBA) . Over the last six mon

Post

Seeking Guidance

Hi everyone, I’m a MERN Stack Developer with 4+ years of experience, but lately, I’ve been struggling to get interview calls despite being confident in my devel

Post

Seeking guidance regarding JOB application.

Anyone with experience this post is in regards to learn a the way one's who are getting interview calls and getting hired for a person like me who is being

Post

Github account suspension

My github account got suspended how to recover Iam a student I had many repositories and I also did contributions I was preparing for GSOC since july and contri

Post

A weekly review that keeps prep honest

Preparation has a way of feeling productive while quietly going nowhere. You read a chapter, watch an explanation, skim three solutions, and at the end of the w

Comments0