We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design and AI Engineering, by Roni Das. 984 interactive lessons.
Start LearningSystem design interview guide
Short answer
Lenskart system design treats every order as a small manufacturing job. The prescription is checked before payment: ranges, 0.25 steps, and AXIS whenever CYL is set. A routing step picks the lens path. Common powers come from stock, and the rest go to a lab queue. A job service tracks the pair through stations as a state machine. The states are frame picked, lenses ready, cut, fitted, checked, packed and shipped. A failed check goes back one step. One customer profile and one stock service serve stores, app and website. So a store eye test can turn into an online order.
in this guide
8 parts open to everyone · 3 with a free account · 3 with the course
You can read 8 of 14 parts. A free account opens the deep dive; the course opens all of it.
It moves the interview past the shopping cart. Payment is the easy part. The hard part starts after it. A design that treats the order as one database row breaks here. The order goes through a lab and a quality check, and some steps can fail and repeat. The question tests whether you can model a long-running job as a state machine. It also tests validating medical input, and routing work to the right site. And it tests serving one customer across stores, app and website as one person.
This page is the free part.
₹1,111 in India$25 everywhere elseonce, for the whole course
The System Design course covers the Lenskart design across a run of lessons, not one page. These 4 alone are about 93 minutes of step-by-step reading, 2 of them with code you run in the browser, all with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 6 lessons. Each one teaches one piece of the Lenskart design above, step by step.
Lifetime access for ₹1,111 in India or $25 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $25 elsewhere, once
Get System DesignYou own this course
214 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
Lenskart's July 2025 draft prospectus lists 2,723 stores. 2,067 are in India and 656 are abroad. In the year to March 2025 its revenue from operations was Rs 6,652.5 crore. It makes frames and lenses in its own plants in Bhiwadi and Gurugram. So a pair of glasses is not picked off a shelf like a T-shirt. Most orders are a small manufacturing job. A frame, two lenses ground to one person's prescription, cut to that frame's shape, fitted and checked.
Lenskart sells glasses, sunglasses and contact lenses in India and abroad. It sells online and in its own stores. A design like Lenskart's has three parts that a normal shop does not. First, the prescription. It is medical data with a strict format, and a wrong number means glasses that give headaches. Second, the lens. Common powers are kept in stock. Unusual powers and special lenses must be made in a lab. So each order must decide which path it takes. Third, the order is a job with many steps. Pick the frame, get the lenses, cut, fit, check, pack and ship. Every step can fail and must be tracked. On top sits omnichannel. A customer may get an eye test in a store, then buy online, or try frames at home first.
Where it shows up
A natural question for retail, D2C and supply-chain roles in India. Think of Lenskart, Titan Eye+ and Warby Parker. The general forms are: design a made-to-order shop, or an order pipeline with manufacturing steps. Another is stores and online sharing stock.
Spec sheetLenskart
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: State Machine, Event Sourcing and Priority Queue.
Model system behavior as a finite set of states and transitions, the foundation of distributed protocols.
Store events instead of state, rebuild any point in time from the log of what happened.
Not all messages are equal, process the urgent ones first.
Decouple producers from consumers with a buffer that holds messages until they're processed.
all part of
System Design Masterclass
770 lessons · about 287 hours · 18 free to read
₹1,111in India, by UPI
$25everywhere else, by PayPal
You own this course
Continue with State Machinepay once,
yours for life
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Stores
2,723 (2,067 in India)
The July 2025 draft prospectus, as reported by Business Standard, lists 2,723 stores: 2,067 in India and 656 abroad. 2,723 minus 2,067 is 656. Every store is a place where an order can start and where stock sits.
Revenue per day
~Rs 18.2 crore
Revenue from operations in FY25 was Rs 6,652.5 crore. Divided by 365 days, that is about Rs 18.2 crore a day. This includes all countries.
Orders per day (estimate)
~73,000
Assume an average order of Rs 2,500. Rs 18.2 crore divided by Rs 2,500 is about 72,900 orders a day. The order value is my assumption, not a Lenskart figure. So treat this as the right size, not a count.
Orders per peak hour
~9,100
About 72,900 orders a day is about 3,040 an hour on average. Assume the busiest hour runs at 3 times that. That is about 9,100 orders in the peak hour.
Stock lens types
1,105 per lens type
Assume stock lenses cover SPH from -10.00 to +6.00 and CYL from -4.00 to 0.00. Powers move in 0.25 steps. That is 65 SPH values and 17 CYL values. 65 times 17 is 1,105 SKUs per lens design. The axis is not a separate SKU, because the lens is rotated when it is cut.
Lab jobs per day (example)
~21,900
Assume 30% of orders need lenses made in a lab, because of high power, progressives or special coatings. 30% of about 72,900 is about 21,900 lab jobs a day. The rest use stock lenses and skip the lab.
Model the order as a job, not a row. The shop front is normal: a catalog, a try-on feature, a cart and payment. The difference starts with the prescription. A prescription service stores each prescription with its source, such as a store test, an uploaded photo or typed values. It checks every value against allowed ranges and steps before payment. Then a routing step decides the lens path. If the power and lens type are in stock, lenses are picked from a store or a warehouse. If not, a job goes to a lab. A job service tracks every order through its steps as a state machine. The steps are frame picked, lenses ready, cut, fitted, checked, packed and shipped. Each step is a scan at a station, recorded as an event. A failed check sends the job back one step, not back to the start. Stores are both shops and stock points. They can sell frames from central stock and have them made and shipped. One customer profile holds prescriptions, past frames and orders, for every channel.
In a real interview, sketch this on the whiteboard before diving into any single box.
A customer had an eye test in a store last month. Now she orders a new frame on the app.
Her store eye test is already in her profile. She picks it. The service checks its date and its values against allowed ranges.
Her powers are SPH -2.25 and CYL -0.75, inside the stock range. So the lenses are picked from stock. No lab job is needed.
Payment succeeds. The job service creates a job in the state frame picked. It goes to the warehouse that has both the frame and the lenses.
Each lens is cut to the frame's shape and rotated to her axis. Each step is a scan, so the job moves to cut, then fitted.
A checker measures the finished lenses against the prescription. One lens is off. The job goes back to cut for that lens only, then passes.
The job moves to packed and shipped. She sees each step in the app as it happens.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Frames with measurements: lens width, bridge and temple length. Try-on uses the phone camera to place a frame on the face. It only needs the frame's images or 3D model, served from a CDN.
Stores each prescription with its source and date. Checks every value against allowed ranges and 0.25 steps. Flags combinations that need a person to review, such as a big difference between the two eyes.
Decides if the lenses come from stock or from a lab, and which site does the work. It looks at power range, lens type, coatings and where the frame is.
Tracks each order through its steps. Each scan at a station is an event. A failed check sends the job back one step. Jobs stuck too long in a step raise an alert.
Lab jobs wait in a queue per lab and per machine type. Rush jobs can go first. A slow lab only delays lab jobs, not stock-lens orders.
Frames and stock lenses per site: warehouses, labs and stores. A store can sell a frame it does not hold, from central stock.
One profile across stores, app and website. It holds prescriptions, past frames, face measurements and orders. Prescriptions are encrypted and every read is logged.
prescriptions. OD is the right eye and OS the left. Values are checked against ranges and 0.25 steps. Health data: encrypted at rest.
Every table for Lenskart, its keys, and which store fits it and why.
A prescription is data that must be checked. A prescription has a few numbers for each eye. SPH is the main power. CYL corrects astigmatism, and AXIS is its angle from 1 to 180. ADD is extra power for reading, and…
6 deep dives on the parts that break at scale, with 2 diagrams: A prescription is data that must be checked; Stock lenses or a lab job; The order is a job with many steps.
Stock lenses versus making every lens in a lab. Making every lens to order needs no lens stock and covers every power. But it is slow and costly for common powers. Stocking common powers gives a fast path for most…
4 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
What if the customer uploads a photo of a prescription?
3 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design Lenskart with the AI tutor.
Lenskart has not published how its systems are built in the sources read for this page. So the design here fits public facts; it is not a description of Lenskart's code. Business Standard reported the July 2025 draft prospectus. It lists 2,723 stores, 2,067 in India and 656 abroad, and FY25 revenue from operations of Rs 6,652.5 crore. It also lists plants in Bhiwadi and Gurugram with regional hubs in Singapore and the UAE. Nearly 45% of India revenue came from customers who engaged digitally within 90 days before purchase. The order count, lens ranges and lab share on this page are interview assumptions.
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
State Machine
advanced / distributed systems core
Event Sourcing
advanced / distributed systems core
Priority Queue
intermediate / messaging event systems
Message Queues
intermediate / messaging event systems
PII Handling
intermediate / data governance compliance
Content Delivery Network (CDN)
foundation / load balancing proxies
Audit Logging
intermediate / data governance compliance
Idempotency Keys
intermediate / api design protocols
28 walkthroughs of the products Indian interviewers ask about, each with the real scale numbers, the architecture and the trade-offs that company had to make.
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
India: UPI, cards or netbanking through Razorpay. Elsewhere: card or PayPal. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
free tool
Check these numbers yourself
Put in your own guesses for Lenskart and see requests per second, storage, bandwidth and servers, with every sum written out.
Open the Capacity EstimatorIt is really nice and good Please join the course