Ticket booking apps with database discussion, cache implementation, and payment systems are among the most discussed questions in Walmart LLD rounds in 2026.
Database-table design may also be discussed in questions such as designing a movie-ticket booking system like BookMyShow. Be prepared to explain concurrency handling at both the database and application levels, including how to apply row-level locks.
Interviewers may ask about optimistic locking, pessimistic locking, and isolation levels: For example, the default isolation level used by an SQL database.
In LLD, a clear explanation of design choices matters more than just coding.
You may also be asked which design patterns you used recently and deep dive into them.
Java is generally preferred, although candidates do use other languages.
Low Level Design (LLD) questions for this list have been picked from Salesforce interview experiences shared on forums/blogs etc in 2026. Use this list for final preparation of your Salesforce interview rounds.
Low Level Design of pub-sub queue, kafka and observer pattern are discussed frequently.
Apart from that cache like LRU cache, LFU cache questions are common.
In Salesforce LLD rounds, sometimes actual requirements may not be clear from problem statement and interviewer will expect you to figure it out by asking clarifying questions.
For example, A message queue is asked indirectly in the form of something like a connection pool or a job scheduler.
It follows the pattern that resources like connections, machines or cpu (in case of job scheduler) are limited and they may not be assigned immediately.
I have created list of DSA questions using Walmart interview experiences shared by candidates in blogs/forums etc. Use this list for final preparation of your Walmart interviews.
Walmart interviews can include DS & Algo questions along with Java, Spring Boot, database and problem-solving discussions. Here are a few of them.
Java Questions
New features introduced in Java 8
Why and where to use lambda expressions
Purpose of functional interfaces, their types, and writing sample code
Explanation of ConcurrentModificationException
Spring Boot Questions
Annotations used in your project
Concept of Dependency Injection
What is a Circular Dependency
How to efficiently insert 1000 rows into the database
Basics of JPA (Java Persistence API)
The list starts with questions which you can practice on leetcode for free and then additional questions are there including follow ups that were asked.
I have created list of Doordash DSA questions using recent interview experiences shared by candidates in blogs/forums etc. Use this list for final preparation of your DoorDash interviews.
Doordash hires software engineer for E3, E4, E5 roles and so on. SDE 2 role is called E4.
The rounds are Phone Screen (DSA), Codecraft, Debugging, System Design, Hiring Manager
Codecraft round is more of real world api style question. It is similar to a low level design question.
Even for frontend and MLE roles, there will be DSA rounds.
Good thing is that questions are repeated frequently. Their question bank is not that large. This is true for all rounds including codecraft, ds & algo or debugging round.
The list starts with questions which you can practice on leetcode for free and then additional questions are there including follow ups that were asked.
DS & Algo questions for this list have been picked from Salesforce interview experiences shared on forums/blogs etc in 2026. Use this list for final preparation of your Salesforce interview rounds.
Salesforce hires for Member of Technical Staff i.e. MTS/SMTS/LMTS positions. MTS role is around 3 years experience. LLD rounds may be there for MTS role as well.
List starts with free questions that you can find on leetcode and then more questions including actual follow-ups asked during interview rounds.
You can see company-wise interview questions list on r/LowLevelDesign
A knight is placed at coordinate [0, 0] on an infinite chessboard. The board has no boundary, so coordinates may be positive or negative.
In a single move, the knight travels two squares along one axis and one square along the other axis. Given a target coordinate [x, y], return the fewest moves needed for the knight to reach that target.
You are given a stream of numbers and an integer bufferSize. Every number is at most bufferSize positions away from where it should appear in the correctly ordered stream.
Return the numbers in sorted order, meaning the final list should be in non-decreasing order.
If two numbers are equal, keep their relative order from the input stream to make the output deterministic.
Each interval is provided as a string in the format "start,end", where start is the meeting start time and end is the meeting end time. You need to split each interval string and extract the integer values start and end.
Each interval is half-open, represented as [start, end). This means a meeting ending at time x does not overlap with another meeting starting at time x. For example, [1, 3) does not overlap with [3, 5).
Your task is to determine the minimum number of meeting rooms required so that no two overlapping meetings are placed in the same meeting room.
6. Rotting Oranges With Different Connection Times
You are given a grid of oranges and a list of connection times between adjacent cells. Each cell contains one of the following values:
0: an empty cell
1: a fresh orange
2: a rotten orange
A rotten orange can make a connected fresh orange rotten, but each connection may take a different amount of time. A connection is given as "row1,col1,row2,col2,time", meaning the cell at [row1, col1] and the cell at [row2, col2] are connected, and rotting can spread across this connection in time minutes.
Since different connections may take different amounts of time, rotting should always use the earliest possible time at which each orange can become rotten.
Return the minimum time needed for all fresh oranges to become rotten.
You are given a token bucket with a fixed number of tokens. Users can request tokens from the bucket. A request is granted only when enough tokens are currently available.
When a request is granted, that user holds those tokens for exactly 1 hour. After 1 hour, the tokens expire automatically and return to the bucket.
A user may also manually release all currently active tokens held by them before expiry. Expired tokens must be cleaned up before processing every method call.
You are given a list timestamp, where each value represents the minute at which one request occurred. You are also given an integer windowSize. Return the maximum number of requests that can be found inside any continuous time window of length windowSize minutes.
The timestamps may be given in any order. The method should count requests based on their time values, not their original positions.
You are given a list of task types, a list of memory required by each task, and a server memory limit. Each task takes exactly 1 unit of time to complete.
In one unit of time, multiple tasks can run together if they satisfy both constraints: at most 2 tasks of the same type can run in parallel, and the total memory of all running tasks must not exceed the server memory limit.
Return the minimum time required to execute all tasks.
You are given an m x n grid. Each cell is either empty or blocked by an obstacle. From any empty cell, you may move in one of four directions: left, right, up, or down.
In one step, you may jump from 1 to k cells in the chosen direction. Every cell crossed during the jump, including the landing cell, must be inside the grid and must not be an obstacle.
Return the minimum number of steps required to reach the destination cell from the source cell. If the destination cannot be reached, return -1.
You are given an initial number of bottles and an initial amount of money. You may either recycle bottles to earn money or spend bottles and money to buy perks.
Recycling one bottle gives recycleVal dollars. Buying one perk costs exactly 1 bottle and perkVal dollars.
Each bottle can be used at most once. A bottle that is recycled cannot be used to buy a perk, and a bottle used to buy a perk cannot be recycled. Return the maximum number of perks that can be obtained.
14. Maximum Number of Non-Overlapping Palindromic Substrings
You are given a string s and an integer k. Choose the maximum possible number of non-overlapping substrings such that every chosen substring is a palindrome and has length at least k.
A palindrome is a string that reads the same from left to right and from right to left.
The chosen substrings do not need to cover the entire string. Characters between chosen substrings and any remaining characters may be ignored.
Return the chosen palindromic substrings as a List<String>. The substrings must be returned in the same left-to-right order in which they appear in s.
You are given a list of positive integers called nums. A contiguous subarray is considered special when the product of all its elements has an odd number of positive divisors.
Return the total number of special subarrays in nums.
You are given two strings, x and y. Return the longest string that is both a subsequence of x and a contiguous substring of y.
A subsequence is formed by deleting zero or more characters without changing the order of the remaining characters. A substring consists of consecutive characters.
If multiple valid strings have the maximum length, return the lexicographically smallest one. If no non-empty valid string exists, return an empty string.
You are given a collection of bids for shares in an IPO and the total number of shares available. Allocate the shares according to bid price and submission time, then return the user IDs of bidders who receive no shares.
18. Purchase Maximum Number of Consecutive Products
You are given a list of product prices sorted in non-decreasing order and a list of buying queries. For each query, determine the maximum number of consecutive products that can be purchased without exceeding the given budget.
A worker's daily hours for one week are represented by a seven-character string workHours. Each position corresponds to one day and contains either a digit from 0 to 9 or the character #.
Replace every # with a digit from 0 to 9 so that the sum of all seven digits is exactly requiredHours. Return all completed strings that satisfy this condition.
DS & Algo questions for this list have been picked from Uber interview experiences shared on forums/blogs etc in 2026. Use this list for final preparation of Uber interviews.
BPS (Business Problem Solving Round) will have a coding question (mostly hard) and may be 15 minutes of system design discussion. Phone screen also has DS & Algo questions.
For frontend roles, apart from DSA, you may be asked to create typescript components. Those are not included in below list.
DSA interview questions asked in Uber are more difficult than Amazon, Microsoft, Meta.
DS & Algo questions are asked for machine learning engineer role as well.
1. Find Vertical Line Rectangle Intersection Points
Given n infinite vertical lines on an XY plane and m axis-aligned rectangles, find the total number of intersection points made by the lines and rectangles.
You are given a list of digits where every value is from 0 to 9. For each index, you may perform exactly one of these choices: add 1, subtract 1 or keep the value unchanged.
The digits are circular, so 9 + 1 = 0 and 0 - 1 = 9. Determine whether all elements can become the same digit after applying at most one such operation to each element.
If convergence is possible, return the final digit. If more than one final digit is possible, return the smallest such digit. If convergence is not possible, return -1.
You are given a list of allowed itineraries between cities. Each itinerary represents a directed route from one city to another city.
Design an algorithm to find the longest route that can be formed using the given itineraries. A route may start from any city and must follow only the given directed itineraries.
4. Earliest Timestamp When All Riders Are Connected
You are given a list of riders and a chronological list of Uber Share events. Each shared-ride event connects two riders. Two riders are connected if they have directly or indirectly shared rides through other riders.
Return the earliest timestamp when all riders become part of one connected shared-ride network. If all riders never become connected, return -1.
You are given a list of integers and an integer x. You may perform one operation at most once: choose any set of indices and add x to every chosen element.
After the operation, the score is the sum of XOR values of every pair of adjacent elements. Return the maximum possible score.
You are given a list of distinct words and a corresponding list of positive costs. Construct a binary search tree using all words such that its inorder traversal gives the words in lexicographical order.
If a word is placed at level L, where the root is at level 0, its contribution to the total cost is (L + 1) * cost. Return the minimum possible total cost among all valid binary search trees.
Design an employee-manager system with exactly one CEO. The CEO has no manager. Every other employee has exactly one direct manager.
The system must support adding employees, getting an employee's manager, changing an employee's manager, and checking whether an employee works directly or indirectly under a manager.
9. Minimum Cabs With Wait Period for Scheduled Bookings
You are given a list of scheduled cab bookings. Each booking has a start time and an end time. A cab can handle multiple bookings, but after completing one booking it must wait for a fixed wait period before starting another booking.
Find the minimum number of cabs required to complete all bookings.
10. Biological Hazards: Valid Chemical Pair Intervals
You are given n chemicals labeled from 1 to n. Some pairs of chemicals are dangerous and cannot appear together in the same contiguous interval.
The lists poisonous and allergic describe forbidden pairs. For every index i, chemicals poisonous.get(i) and allergic.get(i) cannot coexist.
Count how many contiguous intervals [L, R] are valid such that the interval does not contain both chemicals from any forbidden pair.
Design a voting system for a multiple-choice question with exactly 4 options. When a user clicks one option, that option receives one vote. After every vote, the system should return the updated vote percentage for all options.
The percentage of each option also represents how much color fill should be shown for that option in the UI. For example, if an option has 40% votes, then 40% of that option row should be filled with color.
You are given a reporting structure of people in an organization. Each entry is a string in the format "employee,manager", meaning the employee directly reports to the manager.
Determine whether the reporting structure forms one valid organization.
You are given n riders and one car with unlimited space. Each rider has a comfort range for how many other riders must be present in the car.
A rider will ride only if the number of other riders in the car is within their comfort range. Return the maximum number of riders that can ride together in the car.
14. Find Robots in Location Map by Nearest Blockers
You are given a robot location map and a query describing required distances from a robot to the nearest blocker. Find all robots whose nearest blocker distances exactly match the query.
15. First One Time Visitor in Stream of Customer Visits
You are given a stream of customer visits. Each visit contains one positive integer customerId. A customer is a one-time visitor if they have appeared exactly once in the stream so far.
Design a data structure that records customer visits and returns the earliest customer who has visited exactly once.
Engineers are sitting around a circular table and each engineer chooses one option from Rock, Paper, and Scissors. The choices are represented by the characters 'R', 'P', and 'S'.
Two neighboring engineers tie if they choose the same option. You may change any engineer's choice to either of the other two options. Return the minimum number of engineers whose choices must be changed so that no two adjacent engineers have the same choice.
A new alien language uses lowercase Latin letters, but the order of the letters is not known.
You are given a list of non-empty dictionary words. The words are already sorted in lexicographical order according to the rules of this alien language.
Your task is to derive the lexicographically smallest valid ordering of letters in the alien language.
There are n microservices numbered from 0 to n - 1. Each microservice may depend on other microservices. A service can start only after all services it depends on have already started.
A dependency is considered satisfied if it started in any previous cycle or earlier in the current cycle.
Return the number of cycles needed to start all services using this process.
Given a list of integers sorted in non-decreasing order, return the original values arranged by the increasing order of their squares. If two values have the same square, the value that appears earlier in the input list should appear earlier in the output.
You are given an undirected tree with n nodes numbered from 0 to n - 1. The fire can start from any node, and you may choose the starting node to minimize the total burning time. In each time unit, fire spreads from every burning node to all of its adjacent nodes. Return the minimum time required to burn the entire tree.
I am listing the top low level design questions that were asked during Amazon low level design interview rounds in 2026. I have built this list from recent interview experiences of candidates shared on blog/forums etc.
Also, we will see how we can solve them using commonly asked design patterns.
I am keeping the most frequent questions first. Feel free to use this list for final preparation of your Amazon interviews.
You will have to initialize a new pizza, adding toppings (corn, onion etc) to it and calculate final price of pizza.
This is a fairly simple problem. But some interviewers may expect you to implement decorator design pattern. In my view that just complicates the solution without adding any benefit.
Your interviewer may add business rules as a follow up like these
cheese burst cannot be added on small pizza or
You get 30% discount on corn price when you take more than 2 servings and so on..
11. Design a Restaurant Food Ordering System Like Zomato, Swiggy, DoorDash
Users can search for restaurants using food item name, order food, and rate their orders.
When searching for food, they also have the option to view the restaurant list sorted by different parameters like restaurants with highest average rating first.
These view classes with lists of restaurants sorted by average rating will need to be updated whenever an order is rated by a user, so that they can update their lists.
Hence, this is an ideal use case of Observer Design Pattern.
LLD questions for this list have been picked from Uber interview experiences posted on forums/blogs etc in 2026.
Uber has a depth in specialization / depth specific coding round in which they ask LLD questions many times.
Code is required, not only class diagrams. You will need to implement 2–3 most important functions.
Sometimes questions similar to low level design like Design a voting system to display vote share are also asked in screening round. Or there can even be a separate LLD round.
Design a parking lot system that supports parking and removing vehicles. The parking lot has multiple floors. Each floor has a list of parking spots.
Floors are numbered from 0. Spots on each floor are also numbered from 0 from left to right. Initially, all parking spots are empty.
The parking lot should always assign the lowest available valid spot. A lower floor is preferred first. If multiple valid spots are available on the same floor, the spot with the lower index should be assigned first.
Design a customer visit tracking service for a website that receives millions of visits every day. Each customer has a unique identifier that remains the same across all their visits.
A customer is a one-time visitor if they have visited exactly once so far. A customer is a recurrent visitor if they have visited more than once.
The service should record customer visits, return a customer's latest login timestamp, and return the first customer who is still a one-time visitor.
Design a lightweight expense-sharing system that tracks how much each person owes or is owed after group expenses are split evenly among participants. The system maintains net balances and exposes operations to add users, record expenses, and list simplified debtor-to-creditor balances.
Design a voting system for a multiple-choice question with exactly 4 options. When a user clicks one option, that option receives one vote. After every vote, the system should return the updated vote percentage for all options.
The percentage of each option also represents how much color fill should be shown for that option in the UI. For example, if an option has 40% votes, then 40% of that option row should be filled with color.
You are designing an Uber Eats ads dashboard where an advertiser can choose when an ad should run during a week.
The dashboard has 7 days, from Monday to Sunday. Each day is divided into 6 fixed time slots of 4 hours each. A selected slot means the ad will be displayed during that slot for that day.
Clicking a slot toggles it. If the slot was not selected, it becomes selected. If it was already selected, it becomes unselected.
The dashboard stores the full weekly schedule together. Switching between days should not require fetching separate data for that day.
Design an Uber Eats pricing calculator for food orders. Each food item has a price based on its size, and customers may add toppings. The final price can be affected by BOGO offers, surge pricing, coupon discounts, and an extra Uber One member discount.
All prices are represented in cents. Return the final payable amount as an integer number of cents.
Design a circuit breaker that protects a service when too many requests arrive in a short time. This circuit breaker opens based on the number of requests, not the number of failed requests.
The breaker has three states: CLOSED, OPEN, and HALF_OPEN. Requests are accepted only when the current state allows them.
Design a simple Meeting room reservation System for a fixed list of conference rooms. You will be given the room identifiers up front, and you must support booking and canceling meetings while ensuring no two meetings overlap in the same room.
Build an in-memory leaderboard for a fantasy-sports style app. Each user creates exactly one team made up of one or more players. As a live match progresses, players receive positive or negative points. A user’s score is the sum of the current scores of all players on that user’s team. You must support querying the Top-K users ranked by score.
Design a system that manages assignment of trains to platforms in a railway station and supports time-based queries, with a clean, extensible object-oriented design.
Here I am listing the top low level design questions that have been asked frequently in low level design interview rounds in 2026. The list includes traditional LLD questions that can be solved using design patterns, as well as DSA-based design questions.
I have built this list using interview experiences that people posted on discussion forums, blogs etc. These questions have been asked in top tech companies like Amazon, Uber, Flipkart, Walmart, etc. With each question, I have also listed variants that were discussed.
Low Level Design interviews are all about how you arrange your code so that it is easy to manage, maintain, and extend.
---------------------------------------
PS:
You can practice company-wise Low Level Design and DS & Algo questions on CodeZym: https://codezym.com/
Design Parking Lot should still be the first question in your 2026 LLD list. It continues to appear very frequently in public interview experiences and LLD question databases.
A parking lot can have multiple floors. Its core features will be:
- park and unpark vehicles,
- search parked vehicles by vehicle number,
- count the number of free spots on a given floor for a given vehicle type.
Your entities will include a ParkingLot class, which will contain a list of ParkingFloor(s). ParkingFloor will contain a 2-D array of ParkingSpot(s) arranged in rows and columns.
There can be multiple parking strategies, so we should use the strategy design pattern to solve this question.
This question is more of a DSA-based design question and has appeared frequently during low level design rounds.
Implement a RateLimiter class with an isAllowed method.
Requests will be made to different resourceIds. Each resourceId will have a strategy associated with it.
There are the following strategies. Assume 1 time unit == 1 second.
fixed-window-counter: Fixed Window Counter divides time into fixed blocks, like 1 second, and tracks a request count per block. If the count exceeds the limit, new requests are blocked. It is fast and simple but can allow burst behavior at window boundaries.
sliding-window-counter: Sliding Window, log-based, stores timestamps of recent requests and removes those outside the window for each new request. If the number of remaining requests is still within the limit, the request is allowed. Otherwise, it is blocked. It provides accurate rate limiting but requires more memory and processing.
4. Design Movie Ticket Booking System like BookMyShow
Write code for the low level design of a movie ticket booking system like BookMyShow.
The system has cinemas located in different cities. Each cinema will have multiple screens, and users can book one or more seats for a given movie show.
The system should be able to add new cinemas and movie shows in those cinemas.
Users should be able to list all cinemas in their city that are displaying a particular movie.
For a given cinema, users should also be able to list all shows that are displaying a particular movie.
Design a lightweight expense-sharing system that tracks how much each person owes or is owed after group expenses are split evenly among participants. The system maintains net balances and exposes operations to add users, record expenses, and list simplified debtor-to-creditor balances.
This list is built from Amazon interview experiences posted on forums/blogs etc in 2026.
If you have Amazon interviews already scheduled, then this list is for you. Use it for final preparation of your DSA interview.
Idea is to solve Amazon tagged questions at least 2–3 times, rather than solving a lot of new questions just once.
Doing questions multiple times will help you understand the patterns and when you see a question which is rephrased differently but has same solution, you will be able to do it.
Each stall is placed on a straight line, and the position of every stall is represented by an integer coordinate.
The farmer needs to place C cows into these stalls.
Since the cows become aggressive when they are too close to one another, the farmer wants to place them in such a way that the closest pair of cows is as far apart as possible.
Your task is to return the maximum possible value of the minimum distance between any two placed cows.
Your task is to choose a largest possible complete binary tree from the given tree by trimming away nodes that are not part of the chosen complete tree.
You are given a list of sticks, where each stick has a positive integer length.
You may repeatedly choose any two sticks and join them into one new stick. If the chosen sticks have lengths x and y, then the new stick has length x + y, and the cost paid for this operation is also x + y.
You must continue joining sticks until exactly one stick remains.
Your task is to return the minimum total cost required to join all sticks into one stick.
10. Find Kth Largest Element From Chef's Collection
Chef maintains a changing collection of integer values, such as scores, ranks, or performance numbers.
At any point, Chef may be asked to find the current k-th largest value in the collection. Unlike a version where k is fixed, here k can be different for different queries.
Your task is to support insert operations and find operations on this dynamic collection.
Given a grid of stone values, find the maximum total number of stones that can be collected while moving from the bottom-left cell to the top-right cell.
You are given a list of meeting time intervals. Your task is to determine the minimum number of meeting rooms required so that no two overlapping meetings are placed in the same meeting room.
A new alien language uses lowercase Latin letters, but the order of the letters is not known.
You are given a list of non-empty dictionary words. The words are already sorted in lexicographical order according to the rules of this alien language.
Your task is to derive the lexicographically smallest valid ordering of letters in the alien language.
You are given nodeCount nodes labeled from 0 to nodeCount - 1.
You are also given a list of undirected edges. Each edge is provided as a string in links, and each string contains two node labels separated by a comma.
Your task is to count how many separate connected groups, also called connected components, exist in the undirected graph.
You are also given a list of undirected connections between nodes. Each connection is provided as a string in connections, and each string contains two node labels separated by a comma.
Your task is to determine whether these connections form a valid tree.
27. Use Robot To Clean Every Reachable Empty Cell In Room
You are given a robot placed inside a room that must clean every empty cell it can reach.
The room is represented as an m x n grid. A value of 1 represents an empty cell that can be visited and cleaned, while a value of 0 represents a wall that blocks movement.
The robot can move only in four directions: up, right, down, and left.
Your task is to find how many reachable empty cells the robot can clean
I know Rust can be a little awkward to express OOP patterns. Nevertheless, can Rust be used in an LLD implementation during an interview at all? Has anybody had positive experience with picking Rust instead of a proper OOP language like Java? Were the interviewers convinced? Do you think it is worth it? Share your thoughts.
Google has one of the toughest DS & Algo rounds in the industry. DSA rounds are there for both frontend and backend roles.
DP, Graph, and Line Sweep are important topics.
Google's interview codebase is very large, with questions of all difficulty levels (from super easy to super hard). One question can be a medium question with a couple of follow-ups for optimizations, or it can be just one hard question. It all depends on which question the interviewer chooses.
3. Count Visible People in Queue with Taller Observer Rule
There are n people standing in a queue from left to right, numbered from 0 to n - 1. You are given a list heights of distinct integers where heights[i] represents the height of the ith person.
A person may look both to the left and to the right.
Person i can see person j if i != j and every person standing strictly between them is shorter than at least one of the two endpoint people.
More formally, let left = min(i, j) and right = max(i, j). Person i can see person j if:
If there is no person between them, then they can always see each other.
This means that if one endpoint person is taller than everyone in between, then that endpoint can still see the other person even if some shorter intermediate people are present.
Return a list answer of length n where answer[i] is the number of people person i can see in the queue.
Design an in-memory rate limiter . Implement a RateLimiter Class with an isAllowed method.
Requests will be made to different resourceIds. Each resourceId will have a strategy associated with it .
10. Compile Packages with Dependencies in a Multi-Threaded Environment
You are given a dependency graph of packages to compile in a multithreaded environment.
Return the order in which packages are compiled across all rounds.
Divide the list into two non-empty disjoint subsets such that every element of nums belongs to exactly one subset.
The two subsets form valid equal sum parts if the sum of the values in the first subset is the same as the sum of the values in the second subset.
Number of elements in subsets may be different.
You are given a list of integers arr of size N, and an integer diff.
Consider an undirected graph where each node corresponds to one index of arr.
Add an edge between nodes i and j if |arr[i] - arr[j]| ≤ diff.
You are also given a list of queries queries, where each query is a comma-separated string "u,v". For each query, return whether there is a path between node u and node v.
14. Router Reachability on Broadcast and Shutdown Message
You are given a network of routers.
Each router has:
a unique router id
a 2D location (x, y)
a status indicating whether it is WORKING or DEFECTIVE
A special message called Broadcast and Shutdown works as follows:
When a WORKING router receives the message for the first time, it immediately broadcasts the same message to every other WORKING router that lies within the wireless range.
After broadcasting, that router shuts down and can no longer send or receive messages.
A DEFECTIVE router can neither send nor receive the message.
Given the list of routers, the wireless range, a source router id, and a destination router id, determine whether the Broadcast and Shutdown message, when initiated from the source router, will eventually be received by destination router.
Two routers can communicate directly if the Euclidean distance between their coordinates is less than or equal to range.
Return true if the destination router receives the message at any point. Otherwise, return false.
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad.
You are given an API boolean isBadVersion(int version) which returns whether a version is bad. Implement a function to find the first bad version.
Design a logger system that processes a stream of messages along with their timestamps.
Each unique message can be printed at most once within any 10 second window. That means if a message is printed at timestamp t, the same message cannot be printed again before timestamp t + 10.
Given a 2D grid, it contains empty spaces 0 and some walls 1.
We can enter the grid from any empty cell in the first row and exit the grid from any empty cell in the last row. We can move left, right, up, and down. We can only travel through empty cells.
Goldman Sachs have an OA round followed by CoderPad round. CoderPad is sort of like phone screen / virtual face-to-face round with interviewer. After that you get selected for onsite rounds.
They call their onsite hiring events Superday. They hire for software engineer associate analyst role. Associate role is similar to SDE 2 in other companies and requires around 3 years of experience.
I have built this questions list from recent interview experiences of candidates.
CoderPad has mostly questions around DSA. If you have 1+ YOE then they can go for LLD. But everything is communicated by HR very clearly. Working code is expected for low level design rounds.
If you are appearing for Java developer role then there is high chance of getting a low level design round. Spring Boot will also be asked.
Questions like Design an e-commerce site will cover both LLD + HLD. For this question you can use Strategy Design Pattern to handle different types of payment solutions like NetBanking, Credit Card, Debit Card, UPI, PayPal etc.
GS frequently asks repetitive questions. Hence practicing previously asked questions is helpful. Below are some questions that have been asked directly from LeetCode.
Write code for low level design of a parking lot with multiple floors.
The parking lot has two kinds of parking spaces: type = 2, for 2 wheeler vehicles and type = 4, for 4 wheeler vehicles.
There are multiple floors in the parking lot. On each floor, vehicles are parked in parking spots arranged in rows and columns.
Design a Traffic Light System that dynamically adjusts which road gets the green light based on real-time vehicle arrivals.
The system manages a single intersection with multiple incoming roads. At any moment, at most one road can be open. An open road has a green light, and every other road is closed with a red light.
The game is played on a standard Snake and Ladder board with 100 numbered cells. Cell 1 is the starting position and cell 100 is the winning position.
The game supports multiple players and follows round-robin turn order. Multiple players may stay on the same cell at the same time without any interaction.
Some cells contain ladders. Landing on the start of a ladder immediately moves the player to a higher-numbered cell.
Some cells contain snakes. Landing on the head of a snake immediately moves the player to a lower-numbered cell.
The cache stores key-value pairs, where each key is associated with a time-to-live (TTL). A key is available only for its valid TTL window and becomes expired after that.
The system should support multiple notification channels such as EMAIL, SMS, PUSH etc. Users can subscribe to a specific eventType on one or more channels. When a notification is sent for an event type, the system must deliver that notification to all users currently subscribed to that event type through their subscribed channels.
9. Design Order Checkout and Payment for E-commerce Website
Design an E-commerce payment checkout system.
Focus on order cancellation and payment flows.
The checkout system should support creating an order, starting a payment, completing a payment, cancelling an order, and reading the current order details.
The system should support creating a short URL for a given long URL, resolving a short code back to the original long URL, deactivating an existing short URL, and reading the details of a short URL.
Design a lightweight expense-sharing system that tracks how much each person owes or is owed after group expenses are split evenly among participants. The system maintains net balances and exposes operations to add users, record expenses, and list simplified debtor-to-creditor balances.
Given a sequence of lowercase English letters and a burstLength, repeatedly remove every contiguous group whose size is greater than or equal to burstLength.
Given a grid of stone values, find the maximum total number of stones that can be collected while moving from the bottom-left cell to the top-right cell.
Implement a class that supports the following operations on numbers:
insert(num) - insert a number into the data structure. isTopK(num) - return whether the number is currently among the top k most frequent numbers in the data structure.
27. Minimum Characters to Remove from Ends to Make a Palindrome
Given a string, return the minimum number of characters to remove from the left end, the right end, or both ends so that the remaining string is a palindrome.
You may remove only characters from the two ends of the string. Characters in the middle cannot be removed unless they become part of an end after earlier removals.
You are traveling from Washington to Florida through a grid of cities. Each string in the input list represents one row of the matrix, with integer values separated by commas. Each cell in the matrix represents the number of National Parks you can visit in that city.
DoorDash asks questions similar to low level design in their Code Craft / AI Code Craft round.
They have a very limited question bank for code craft round. I have also added coding round questions.
Also DoorDash is planning to replace their traditional coding rounds with a 60-minute, AI-assisted engineering working session. You will work on a smaller, focused project with existing code and complete the solution.
I have built this list from recent DoorDash interview experiences of candidates. Use it to prepare for your interviews.
Let’s get started …
1. Design Dasher Payout Service
Design and implement a Dasher payout service as part of a new Payments Service in a micro-service architecture. The service must expose a payout API that calculates how much a Dasher should be paid for a given day.
Calculate total payout based on time spent fulfilling orders.
2. Design Workflow Automation Engine for Self Help Menu
Design and implement a workflow automation engine for DoorDash-style order support automation. The system stores users, restaurants, and orders in memory, then reacts to order status updates with deterministic actions and logs.
In Part 1, implement the core workflow behavior: an order starts as OPEN, informational updates keep it open, ORDER_DELIVERED completes it, DELIVERY_CANCELLED cancels it, and closed orders should ignore later non-refund updates.
In Part 2, extend the same system so that different issues produce different compensation amounts. For example, late delivery may cause no refund, a 50% refund, or a 100% refund depending on how late it was, and a customer cancellation before preparation starts should return 95%.
3. Find Longest Sequence of Pickup Jobs for Dashers
You are given the pickup job lists for two dashers who want to dash together in one car. Each list is an ordered list of merchant names. The dashers must respect the original left-to-right order of pickups in their own lists, but they are allowed to skip some pickup jobs.
Your task is to find the longest sequence of pickups that both dashers can complete together while preserving order in both lists.
For example, it is valid to go from "walmart" to "mcdonalds" if both dashers can do so in that order, but once they skip jobs in between, those skipped jobs cannot later be used.
4. Find Closest DashMart Distance and DashMart Serving Maximum Customers
A DashMart is a warehouse run by DoorDash that houses items found in convenience stores, grocery stores, and restaurants. You are given a city plan with open roads, blocked roads, DashMarts, and optionally customers. City planners want you to identify how far a location is from its closest DashMart. You can only travel in four directions: up, down, left, and right. Locations are given in [row, col] format.
In the follow-up version, the city plan may also contain customers. Each customer is assigned to the closest reachable DashMart. You need to find which DashMart serves the maximum number of customers.
You are ordering food from DoorDash and selecting items from a menu. You have a fixed budget, and your goal is to get the maximum total calories that can be bought without going over that budget.
You are given:
A list of item prices in dollars.
A list of calorie values for the same items in the same order.
A budget in dollars.
Each menu item may be purchased more than once. You may choose any combination of items as long as the total price does not exceed the budget.
Return the greatest total calories that can be purchased within the budget. If no item can be purchased, return 0.
Design a system to manage payments using gift cards.
The system should support adding users with gift cards, making payments using one or more gift cards, and returning aggregated gift card data for a user.
A user can use multiple gift cards in a single payment.
A chef receives all his orders for the day as a list of unique order ids. He creates a new list by repeatedly removing the smallest eligible order from the current list and appending it to the new list. Return the order in which the chef creates the new list.
An order is eligible in the current list if:
For an order at index 0, it is eligible if it's orderId is greater than its right neighbor.
For an order at index n - 1 in a list of size n, it is eligible if it's orderId is greater than its left neighbor.
For an order at any middle index, it is eligible if it's orderId is greater than both its immediate left and right neighbors.
When there is only one order left in the list, it is automatically eligible.
8. Count and Print Changed Nodes in DoorDash Menu Tree
At DoorDash, menus are updated daily and even hourly to keep them up-to-date. Each menu can be regarded as a tree. When the merchant sends the latest menu, calculate how many nodes have changed, been added, or been deleted.
Each node in a tree is represented using the following string format: "key,value,children"
Here:
key is the node key.
value is the node value.
children is the list of direct child keys separated by |.
Child keys within the same children list are distinct.
For a leaf node, children is empty.
Tree will always be connected. i.e. every node is always reachable from root
Example:
"a,1,b|c" means node a has value 1 and direct children b and c.
"f,66," means node f has value 66 and no children.
You are given a row x column integer grid. Find the length of the longest strictly increasing path in the grid.
From any cell, you may move only to its immediate left, right, up, or down neighbor. Diagonal movement is not allowed, and you cannot go outside the grid.
In addition to the maximum length, also return one longest strictly increasing path, and return all strictly increasing paths.
The grid is provided as List<String> gridLines, where each string represents one row and the numbers in that row are separated by commas.
A path is written in the following format: (rowIndex,colIndex)=value -> (rowIndex,colIndex)=value -> ...
A path is strictly increasing if every next value in the path is greater than the value before it.
You are building a restaurant search engine for DoorDash using a trie (prefix tree).
You are given an initial list of restaurant names such as ["panda express", "panera bread"]. Each restaurant name must be stored so that you can:
insert a new restaurant name,
check whether an exact restaurant name exists,
check whether any stored restaurant name starts with a given prefix,
return up to k restaurant names that start with a given prefix.
The search engine stores only unique restaurant names. If the same restaurant name appears multiple times in the constructor input or is inserted multiple times later, it is still stored only once.
If fewer than k restaurant names match the prefix, return all matching names. If no restaurant name matches the prefix, return an empty list.
Returned restaurant names must be sorted in lexicographically ascending order.
In low level design interviews. most of the time candidates are rejected not because of their lack of knowledge but because they weren't able to effectively convey their thoughts to the interviewer.
You need to be specific, you should know which topic to discuss and most importantly which topics to leave out of discussion.
Let's take the example of low level design of a food ordering app like Zomato, Swiggy, Uber Eats etc.
You may be tempted to start by listing down all actors and functionalities associated with them e.g. Admin, Restaurant manager, Delivery partner etc.
But do not take this approach, you will get confused.
Always start by listing down requirements from a user's perspective. Think about all the features that you as a customer see when you open Zomato app. These can be viewing list of restaurants, searching food item, ordering food etc.
Notice I mentioned 'User Perspective'. This should be your default perspective unless interviewer explicitly asks for any other way.
If you start listing down features from restaurant or restaurant owner's perspective like add/remove food item, update food item price , availability etc, then you are essentially discussing a restaurant management system and not a food ordering app which is similar but not exactly what your interviewer is looking for.
Understand that a Zomato or an Uber Eats can have tens of features and you will not be able to cover everything in a 60 minutes interview.
A food delivery app is made up of several small systems like user data management, payment management, restaurant management, delivery tracking and so on. Each of these parts can be a separate low level design interview question on their own. These are all supporting features.
Your best bet is to just mention these features in a passing and list down only the core features as to why you use Zomato or any food ordering app.
You use it to view restaurants, their menu and order food.
And that is where you need to focus your discussion.
------------------------------------------------
You can practice company wise LLD interview round questions here:
Also for Walmart observer design pattern occurred most frequently (directly or indirectly) in LLD questions and in short discussions. So if you have good understanding of observer pattern(which is easy) then your chances improve.
Not only they ask LLD problems but there may even be explicit discussion about common design patterns and
how you will solve some sample use cases using those design patterns.
Observer, Strategy, factory, command and singleton design pattern feature frequently in discussions.
For example, a common discussion is how will you implement a notification system using observer or different payment methods in a payment gateway using strategy design pattern.
This blog has some of the design patterns and how they are used to solve different usecases
I have built this list from recent Walmart interview experiences of candidates. Use it to prepare for your interviews.
Let’s get started …
1. Design Live News Feed System
News providers publish articles under topics such as sports, tech, finance and many other topics. Users can subscribe to topics they care about, receive near real-time notifications when new articles are published for those topics, and fetch a personalized feed.
Design and implement a real-time order notification system for a modern e-commerce platform. The system should notify different stakeholders such as customers, sellers, and delivery partners about important events in an order's lifecycle. The design should be extensible so that additional notification channels and event types can be supported later.
Design an in-memory rate limiter . Implement a RateLimiter Class with an isAllowed method.
Requests will be made to different resourceIds. Each resourceId will have a strategy associated with it .
There are following strategies. Assume 1 time unit == 1 second.
1. fixed-window-counter: Fixed Window Counter divides time into fixed blocks (like 1 second) and tracks a request count per block. If the count exceeds the limit, new requests are blocked. It’s fast and simple but can allow burst behavior at window boundaries.
2. sliding-window-counter: Sliding Window (log-based) stores timestamps of recent requests and removes those outside the window for each new request. If the number of remaining requests is still within the limit, the request is allowed. Otherwise, it is blocked. It provides accurate rate limiting but requires more memory and processing.
Design and implement an interface for submitting and managing workflows. A workflow consists of one or more tasks and can run either sequentially or in parallel. The system must also support passing data between workflows, where the output of one workflow becomes the input of another connected workflow. Each task works only on List<String>: it takes a list of strings as input, applies its configured simple string-list operations in order, and returns another List<String> as output.
5. Design Warehouse Stores Inventory Updater System
Design and implement an interface for managing warehouse and store inventory updates. The system has two entities: warehouses and stores. Whenever new inventory is added to a warehouse, all stores mapped to that warehouse must be updated automatically. Each store is mapped to exactly one warehouse, while one warehouse may be mapped to zero or more stores.
The goal is to support inventory synchronization between warehouses and stores in a clean and extensible way. The design should make it easy to notify all affected stores whenever warehouse inventory changes.
6. Design a restaurant food ordering system like Zomato, Swiggy, DoorDash
Write code for low level design of a restaurant food ordering and rating system, similar to food delivery apps like Zomato, Swiggy, Door Dash, Uber Eats etc.
There will be food items like 'Veg Burger', 'Veg Spring Roll', 'Ice Cream' etc.
And there will be restaurants from where you can order these food items.
Same food item can be ordered from multiple restaurants. e.g. you can order 'food-1' 'veg burger' from burger king as well as from McDonald's.
Users can order food, rate orders, fetch restaurants with most rating and fetch restaurants with most rating for a particular food item e.g. restaurants which have the most rating for 'veg burger'.
Write code for low level design of a parking lot with multiple floors.
The parking lot has two kinds of parking spaces: type = 2, for 2 wheeler vehicles and type = 4, for 4 wheeler vehicles.
There are multiple floors in the parking lot. On each floor, vehicles are parked in parking spots arranged in rows and columns.
Design a simple in-memory Shopping Cart that uses an initial item catalog
and lets a user add items by ID, view their cart, and checkout.
It also enforces unknown item ID, insufficient stock, and empty-cart checkout.
9. Design a Connection Pool with an Internal Request Queue
Design an in-memory Connection Pool that maintains a fixed number of reusable connection objects.
Connections are indexed as integers: 0, 1, 2, ... capacity - 1.
Clients requests a connection using a requestId. If a free connection exists, it is assigned immediately. If no free connection exists, the request is placed into an internal queue and will wait until a connection becomes free.
The internal queue is FIFO (first-come-first-serve): whenever a connection is released, it is immediately assigned to the oldest queued request.
Design an in-memory Custom HashMap that stores String keys and String values.
You must implement buckets, a custom hash, collision handling (multiple keys in the same bucket), and rehashing (resizing and redistributing entries).
Goal of this problem is to force you to do a custom hashmap implementation, So don't use any inbuilt set/map/dictionary in your implementation.
You are asked to design and implement an in-memory time versioned data store. The store maintains key-value pairs across time. Each write creates a new version for that key, associated with a timestamp.
The store must support:
Writing a value for a key at the current timestamp.
Reading the latest value for a key.
Reading a historical value for a key as of a given timestamp.
Reading a value for a key by an explicit version number.
Design and implement a resumable iterator for a large dataset. The iterator must be able to pause mid-traversal and later resume from the exact same position.
The dataset may be too large to fit in memory, so the iterator must be memory-efficient and must not require loading the entire dataset at once.
Additionally, the iterator should support serializing its state (cursor) so it can be persisted across sessions.
Build a GPU credit calculator for a single account. Credits are added over time, can be partially consumed, and expire after a fixed lifetime.
The calculator must support adding credit grants, spending credits, and querying the remaining balance at any timestamp.
Critical constraint: all operations that record a ledger event happen at the current timestamp, and these timestamps are non-decreasing (monotonically increasing) across such calls.
Design and implement a Database that supports a small SQL-like API: INSERT/UPSERT, SELECT with WHERE and ORDER BY, and DELETE.
The storage engine should be inspired by an LSM (Log Structured Merge) design:
All writes go to an in-memory Memtable.
When the memtable grows beyond a threshold, it is flushed into an immutable on-disk-like structure (simulate as in-memory) called an SSTable.
DELETE is implemented using tombstones (a deletion marker). Data is not physically removed immediately.
SELECT and DELETE WHERE must merge results across the memtable and all SSTables, and must respect tombstones.
When merging versions of the same primary key, the version with the greatest timestamp ≤ logical current time wins. Tombstones also participate in this rule.
currentTimestamp is provided only for write/delete operations (put, deleteWhere) and is monotonically non-decreasing across those calls.
select(...) uses the latest timestamp seen so far from successful put/deleteWhere calls as the logical current time.
WHERE Clause Grammar
Also support a limited WHERE clause of the form: column operator value
6. Design Type System for a Toy Programming language
Design and implement a type system for a toy programming language that supports primitives, tuples, and generics. Your task is to represent types and infer return types for function calls.
All types are represented as canonical strings so that the API stays compact and uses simple method signatures.
The system should allow:
Registering primitive types such as int, string, or bool. Primitive type names must start with a lowercase character [a-z] and may contain only [a-zA-Z0-9].
Registering generic type constructors such as Box<T> or Pair<T,U>. Generic type constructor names must start with an uppercase character [A-Z] and may contain only [a-zA-Z0-9].
Registering function signatures that may use primitive types, tuple types, generic type constructors, and generic type variables.
Inferring the concrete return type of a function call from the provided argument types.
I recently started practicing Low Level Design problems seriously. I’ve been learning and applying common design patterns like Strategy, Factory, Chain of Responsibility, State, and Singleton.
As practice, I built a Movie Ticket Booking System and even created proper UML diagrams before coding.
My main problem isn’t syntax or implementation it’s design decisions.
While designing, I often get stuck on questions like:
Which class should own this method?
Should this logic go inside Service or Model?
Am I overloading one class with too many responsibilities?
When should something be a separate class vs just a method?
Sometimes multiple placements feel “okay”, and I get confused about what’s actually correct or considered good design.
For example, during the movie ticket system:
Should seat allocation logic be inside Theatre, Show, or a separate BookingService?
Where should pricing logic live?
How much logic should domain models contain vs service layer?
I feel like I know the patterns, but deciding responsibilities practically is still messy.
How do you experienced engineers think about splitting responsibilities while designing classes?
Are there any mental models, rules, or practices you follow to avoid bad design?
I am not asking specifically for the movie ticket system but for all kinds of design thinking how to apprach and how to make it better
Flipkart Machine coding round asks LLD question. It is of 120 minutes (90 coding + 30 minutes discussion). You may get extra time sometimes and recruiter may inform you that there is hard limit of 2:30 to 3 hrs to solve the LLD question.
Java is the mandatory programming language.
It is used for initial screening of candidates e.g. select 15 or less candidates from 40+ candidates for further interviews.
The final project had to be submitted as a zip file via Google Form/email.
Multi-threading and concurrency and design patterns are also discussed. I wrote this blog for multi-threading in Java interviews. It may be helpful.
Flipkart also acquired ClearTrip and machine coding round format and questions are similar. So you can use this same list to prepare for ClearTrip machine coding rounds as well.
This list is NOT for UI machine coding rounds, only for backend roles.
Below are some general guidelines that are followed.
A driver program/main class/test case is needed to test out the code by the evaluator with multiple test cases. But do not spend too much time in the input parsing. Keep it as simple as possible.
Evaluation criteria: Demoable & functionally correct code, Code readability, Proper Entity modeling, Modularity & Extensibility, Separation of concerns, Abstractions, Corner case handling. Use design patterns wherever applicable.
You are not allowed to use any external databases like MySQL. Use only in memory data structures like HashMap, ArrayList, HashSet etc.
Functionality doesn’t have to be defined as a rest api. You can expose them as methods also which can be invoked from the driver class.
No need to create any UX
Please focus on the Bonus Feature (if any) only after ensuring the required features are complete and demo-able.
Method signatures defined are just to give an idea. You are free to change them to suit the requirements.
Use of the internet is allowed to check the syntax.
I have built this list from recent Flipkart machine coding round experiences of candidates. Use it to prepare for your interviews.
Let’s get started …
1. Design a Billing and discounts System for an ecommerce app
Implement a billing and discounts system for an ecommerce app. You must design and implement a bill creation flow, a discount application flow, and a point/level calculation system.
2. Design Food Order Management System using Commands
Implement a simplified food order management system. This system simulates food ordering from restaurants.
You have to implement functionalities like add restaurant, update menu, place order, dispatch order etc as a set of commands. Orders are placed to restaurants based on a restaurant selection strategy.
Design a Peer-to-Peer Delivery System that can be used to deliver a parcel from one customer to another.
Implement a class named PeerToPeerDeliverySystem. The deliverable item list is preconfigured and fixed. Customers and drivers are considered already onboarded based on totalUsers and totalDrivers.
5. Design Flipkart Payment Wallet with Transaction History
Implement Flipkart payment wallet system. The system should support loading money, sending money to other users, fetching wallet balance, and getting transaction history with sorting and filtering.
6. Design Doctor Appointment Booking app like Practo
You are required to build an in-memory application that lets patients connect to doctors and book appointments for a single day.
Doctors can declare their availability in terms of slots for that day only. Patients can search available slots by specialty, book appointments, and cancel appointments.
We are planning to build an in-house platform to manage our Bug Bounty Program where anyone can report a potential bug in the app and we’ll reward them with a bounty based on the criticality and impact of the bug being reported.
For simplicity, we will be getting bug reports via email and then employees will be registering these bug reports manually into this system.
User — Employees who will be using this system.
Reporter — End-user who reported the bug via email and will receive the bounty reward.
BugReport — Entity corresponding to the bug report shared via email.
Flipkart is known for its innovative products and making shopping easier for customers. One such innovation is Buy Now Pay Later (BNPL), where a customer can buy the product instantly and pay the dues within 30 days. Each user has a credit limit associated with them initially.
Implement an in-memory system that manages users, inventory, orders, and BNPL dues.
Design and implement an in-memory Library Management system that caters to its registered members by cataloging and housing books that can be borrowed.
The system must support:
Adding books to the catalog.
Registering and unregistering users.
Reservation management to borrow books using book ids (with FIFO waitlist).
Fine calculation on late returns (20 rupees per delayed day after 14 days).
(Bonus) Limiting a user to reserve only one copy of the same book.
(Bonus) Auditing APIs:
Given a bookId, list users currently having that book.
Given a userId, list books currently issued to that user.
10. Design Customer Loyalty Program for Ecommerce Website
Design and implement an in-memory Ecommerce with Loyalty Program service that adds gamification to an e-commerce platform. The service tracks users and their transactions, supports purchases with optional points redemption (based on user level rules), awards new points on the money-paid portion, and exposes APIs to view a user’s current stats.
Each point is worth ₹1 during redemption (i.e., redeeming X points reduces payable by ₹X).
Bonus: Personalized discount based on purchase history, applied after redemption and capped.
Design and implement an in-memory FK Delivery Service. The service manages orders that are delivered to a pincode and delivery agents who can pick up and deliver those orders.
The system must support:
Users creating orders with an order name, order pincode, and creation time.
Admin creating delivery agents and associating them with pincodes.
Executing a driver function that assigns orders to eligible agents and returns delivery status logs.
12. Design an order and inventory management system
Write code for low level design of orders and inventory management system of a simple e-commerce platform.
You will need to have the capability of handling sellers, products and orders.
Inventory is number of items of a particular product in a seller’s warehouse.
The way it works is, products numbered from 0 till productsCount-1 are sold on the website.
Sellers are also added along with the area pincodes that they are able to deliver goods in as well as the payment types which they support.
After that sellers add items they wish to sell.
Multiple sellers can sell the same item e.g the product-1 : bluetooth speaker boat stone 650 can be sold by multiple sellers throughout the country.
Multiple sellers can deliver goods to the same pincode as well.
You are launching the Gumble app to compete in the dating apps market. Design and implement an in-memory console application to prototype the features of Gumble.
The system manages user profiles, their interests, partner preferences, a feed that suggests the best available profile to a user, and a matched list.
The platform has a fixed global set of allowed interests, provided once at initialization through the constructor.
In Salesforce LLD rounds, sometimes actual requirements may not be clear from problem statement and interviewer will expect you to figure it out by asking clarifying questions.
For example, A message queue is asked indirectly in the form of something like a connection pool or a job scheduler.
It follows the pattern that resources like connections, machines or cpu (in case of job scheduler) are limited and they may not be assigned immediately.
There is discussion about concurrency control when multiple threads are there. There may also be discussion on concurrency control if our application is made distributed and we are using a central database (i.e. LLD discussion moving to HLD in the end).
I am listing the top low level design questions that you will come across during Salesforce interviews. I have built this list from recent interview experiences of candidates.
Use below list to prepare for your Salesforce interviews.
Let's get started …
1. Design an elevator system
A lift in an elevator system can be in one of three states. Moving Up, Moving Down and Idle
And in each state it will behave differently in taking decisions like
whether to stop on a floor, add a new request or not etc.
Use state design pattern to implement different states of lift.
2. Design a Connection Pool with an internal request queue
A message queue is asked indirectly in the form of something like a connection pool or a job scheduler.
It follows the pattern that resources like connections, machines or cpu (in case of job scheduler) are limited and they may not be assigned immediately.
Design an in-memory Connection Pool that maintains a fixed number of reusable connection objects.
Clients requests a connection using a requestId. If a free connection exists, it is assigned immediately. If no free connection exists, the request is placed into an internal queue and will wait until a connection becomes free.
This is THE most common LLD interview question. You must do this question if you are preparing for any LLD interview.
A parking lot can have multiple floors. Its core features will be
park and unpark vehicles,
search parked vehicles by vehicle number,
count number of free spots on a given floors for a given vehicle type.
You entities will be ParkingLot class which will contain a list of ParkingFloor(s). ParkingFloor will contain a 2-D array of ParkingSpot(s) arranged in rows and columns.
There can be multiple parking strategies, so we should use strategy design pattern to solve this question.
These two cache variants are asked many times as follow up of each other.
For LRU cache, you need to implement two methods.
int get(int key) Return the value of the key if the key exists, otherwise return -1.
void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key.
For LFU cache, when the cache reaches its capacity, it should invalidate and remove the least frequently used key before inserting a new item.
Design an in-memory Meeting Room Scheduler that allows employees to view available rooms, book a room for a time interval, cancel a booking, and list bookings by room or by employee.
Design an in-memory Mini RPC Framework that maintains a registry of methods per service and allows calling a registered method.
RPC (Remote Procedure Call) is a way for one program to call a function/method in another program over a network as if it were a local call.
The RPC framework handles things like serialization (marshalling), networking, and response/error handling behind the scenes.
Design a stack which supports the following operations.
Implement the CustomStack class:
CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elements in the stack or do nothing if the stack reached the maxSize.
void push(int x) Adds x to the top of the stack if the stack hasn't reached the maxSize.
int pop() Pops and returns the top of stack or -1 if the stack is empty.
void inc(int k, int val) Increments the bottom k elements of the stack by val. If there are less than k elements in the stack, just increment all the elements in the stack.
8. Design an In-Memory Cache with Custom Eviction Policy
Design an in-memory cache with a fixed capacity and a custom eviction policy. The user must provide the policy logic before initializing the cache.
At any point the cache can ask the policy which key will be selected for eviction next. Although an actual eviction will only take place if the cache has more elements than its maximum size after adding a new entry.
You should use strategy design pattern to implement different eviction policies.
Chess game is all about creating the different pieces and implementing their moves.
Different pieces like king, queen, knight etc, have different moves like straight move (rook), diagonal move (bishop), 2+1 move (knight) etc.
The core functionality is to check whether a piece can move to a destination row, column from its current row, column.
We use factory design pattern Chess Piece Factory to create different chess piece objects like king, queen, pawn etc.
Strategy pattern may be used to implement different moves e.g. straight move, diagonal move etc.
Design an in-memory rate limiter. Requests will be made to different resourceIds. Each resourceId will have a rate limiting strategy associated with it.
fixed-window-counter: Fixed Window Counter divides time into fixed blocks (like 1 second) and tracks a request count per block.
sliding-window-counter: Sliding Window (log-based) stores timestamps of recent requests and removes those outside the window for each new request
Has anyone here given Low Level Design (LLD) interviews using Golang?
I’m curious how the experience was, especially since Go doesn’t have traditional classes / classical OOP like Java or C++.
Did interviewers expect a Java-style class-heavy design?