HLD Interview Prep India: A Method with UPI-Scale Numbers

How to run an HLD round in India, with a UPI-scale payment switch sized on the whiteboard and the RBI data storage and CERT-In log rules built in.

By · · 7 min read

Illustration for the System Design Interview Framework guide

India edition. Written for HLD rounds at Indian product companies and banks: how HLD differs from LLD and machine coding, estimates at UPI scale, the RBI's 2018 payment data storage direction and FAQ, the CERT-In directions of April 2022, and the Indian cloud regions. US edition

In Indian interview loops the system design round is often called "HLD": high-level design of services, data stores, APIs and scale. It is a different round from LLD (classes, interfaces and design patterns for one component) and from machine coding (a small working program in a fixed time), so check which one you are preparing for. This edition is for the HLD round: a timed method, a worked example at UPI-like scale, and the two Indian rules that change where data lives and what you must store. Practise with the prompts in the System Design Interview Framework (India).

HLD, LLD and machine coding

RoundWhat you produceTypical prompt
HLDServices, data stores, APIs, data flow, scale and trade-offsDesign a payment switch, a food delivery backend, a ticket booking system
LLDClasses, interfaces, relationships, design patternsDesign a parking lot, an expense splitter, a rate limiter class
Machine codingA working, tested program in a fixed time slotBuild a snake and ladder game or a cab booking console app

Ask your recruiter which of these your loop includes. The rest of this edition covers HLD.

The four steps, timed

StepMinutesOutput
Requirements and estimates8 to 10Features, non-goals, QPS, storage, peak multiplier, regulatory constraints
High-level design10 to 15Main flow, APIs, data model
Detailed design15 to 20One or two components in detail: schema, partition key, idempotency, failure handling
Scale and trade-offs8 to 10Bottlenecks at peak, what you would monitor, what you chose not to build

Peaks can come with salary days, sale events and festivals, so ask the interviewer for the peak multiplier rather than assuming the usual two or three times average.

Two Indian rules to raise during requirements

Payment data stays in India. The Reserve Bank of India's direction on storage of payment system data (RBI/2017-18/153, 6 April 2018) requires system providers to ensure that the entire data relating to payment systems operated by them is stored in a system only in India. The RBI's FAQ on the direction says payment data includes customer details, sensitive account information, payment credentials such as OTPs, PINs and passwords, and transaction records; if processing happens abroad, the data should be deleted there and brought back to India not later than one business day or 24 hours from processing, whichever is earlier.

CERT-In's logging and clock rules. The CERT-In directions of 28 April 2022 require entities to:

  • connect to the NTP servers of the National Informatics Centre (NIC) or the National Physical Laboratory (NPL), or servers traceable to them, for time synchronisation;
  • report listed cyber incidents to CERT-In within 6 hours of noticing them;
  • enable logs of all their ICT systems and maintain them securely for a rolling period of 180 days within Indian jurisdiction.

Each one is a design input: a time source, a detection and alerting requirement, and a log storage budget.

Worked example: a UPI-scale payment switch

Prompt. Design a switch that routes person-to-person and merchant payments between banks.

Requirements. Initiate a payment, route it to the payer's bank for debit and the payee's bank for credit, return a final status, allow status checks and reversals. Non-goals: dispute workflows, analytics. Non-functional: no double debits; every transaction traceable; payment data in India.

Estimates. These are premises to agree with the interviewer, not published figures; check NPCI's monthly statistics before quoting a real volume.

volume:   20 billion payments a month
average:  20,000,000,000 / (30 x 86,400) ≈ 7,716 per second
peak:     x3 ≈ 23,148 per second
ledger:   ~1 KB per record → 20 TB a month, 60 TB with three copies

Two things follow. Throughput needs partitioning from the start: plan to spread 23,000 writes a second across shards rather than rely on one database. Storage grows by 60 TB a month, all of it in India, so partition by time and payer and plan where cold data goes.

High-level design. API gateway, a stateless routing tier, a transaction store partitioned by transaction ID with a secondary index by payer, a queue between the switch and each bank's connector, and a status service the apps can poll.

Detailed design: idempotency and timeouts. A bank connector can time out after it has debited the payer. The switch must not retry blindly. Give every payment a unique ID, make each bank call idempotent on that ID, and move the transaction into a pending state with a status check before any reversal. Raising this unprompted is a strong signal in a payments HLD.

Logs. With an API tier at 5,000 requests a second and one 1 KB log line per request, logs are 5,000 x 86,400 x 1 KB = 432 GB a day, or about 77.8 TB over the rolling 180 days CERT-In requires, before compression. That is a second large store to size and pay for, and it too must sit in an Indian region.

Offshore processing. If a fraud model runs outside India, the RBI FAQ's window becomes a design rule: a 24-hour time-to-live on the offshore copy and a job that proves deletion.

Regions in India

The AWS regions list shows two Indian regions, Asia Pacific (Mumbai) ap-south-1 and Asia Pacific (Hyderabad) ap-south-2, each with three availability zones; Hyderabad is opt-in. A design that keeps the primary in Mumbai and disaster recovery in Hyderabad keeps payment data in India and gives geographic separation. Name the replication mode: synchronous across zones within a region, asynchronous between the two regions, and the data loss that implies.

Other prompts worth rehearsing for Indian companies

  • Food or grocery delivery with live tracking: geospatial indexing and location updates from riders every few seconds.
  • Ticket booking for a flash sale or a big match: contention on limited inventory, holds that expire, queues to protect the database.
  • OTP and SMS notification service: third-party rate limits, retries without duplicate messages, and fallback providers.
  • A news or video feed: fan-out on write against fan-out on read, and caching at the edge.

Common mistakes in Indian HLD rounds

  • Preparing class diagrams for an HLD round, or boxes and arrows for an LLD round.
  • Forgetting that payment data residency applies to backups and disaster recovery copies too.
  • Treating logs as free. At 180 days of retention they are a storage and cost decision.
  • Skipping the timeout case in payments. "What if the bank debits but does not respond?" is a question to expect.

Tools for this job

Frequently asked questions

What is the difference between HLD and LLD?

HLD covers services, data stores, APIs, scale and trade-offs for a whole system. LLD covers the classes, interfaces and patterns inside one component. Machine coding asks for working code in a fixed time.

Do I need to mention RBI data localisation in a payments HLD?

Yes, if the system stores payment data. The RBI's 2018 direction requires the entire payment data to be stored only in India, and its FAQ allows processing abroad only if the data is deleted there and brought back within one business day or 24 hours.

How do the CERT-In directions change a design?

They add a time source (NIC or NPL NTP servers, or ones traceable to them), a 6-hour incident reporting requirement, and logs of all ICT systems kept for a rolling 180 days within Indian jurisdiction.

How do I estimate QPS for an Indian consumer app?

Divide daily requests by 86,400 for the average, then apply the peak multiplier the interviewer confirms. Sale days and festivals can be far above average, so ask rather than assume.

Sources and further reading

Open the System Design Interview Framework

More Interview Prep

Every tool in the Interview Prep section, free and in your browser.