Juspay · Final Two Rounds · SDE Interview

Interview prep
curriculum,
Nilashis.

Preparation for the last two Juspay interview rounds. Include all relevant concepts and practice problems.

8 modules Click any question → full answer
Progress
0 / 0
⌘ K
01
Solving coding problems
Pattern recognition, core structures, thinking under pressure
Algorithms
Situations to practice
Given orders arriving in a stream, find the most frequent order type in any window of last K orders.
Sliding window + frequency map
↗ click
Find two transaction amounts that sum to a fraud threshold — do it without sorting first.
Hash set lookup in one pass
↗ click
Find the median delivery time across all completed deliveries, updating as each new one arrives.
Two heaps — max-heap + min-heap
↗ click
Build a session cache that evicts the least recently used entry. Access and insert must both be O(1).
LRU Cache — linked list + hash map
↗ click
Find the deepest common folder between two files in a folder hierarchy represented as a tree.
Lowest Common Ancestor
↗ click
Tasks depend on each other. Find a valid execution order — or tell the caller there's a cycle making it impossible.
Topological sort (Kahn's BFS)
↗ click
Juspay-style problems — implement from scratch
  • Serialize a binary tree to a string and reconstruct it exactly — no library. Tree traversal + string encoding
    ↗ click
  • Given a dictionary of words and a sentence, split the sentence into valid words in all possible ways. Backtracking + memoization
    ↗ click
  • Merge K sorted lists of payment records into one sorted list. Heap-based merge
    ↗ click
  • In a matrix of 0s and 1s representing a city grid, count the number of isolated islands. BFS/DFS on a grid
    ↗ click
02
Operating Systems
How the machine underneath your code actually works
Processes & Memory
Situations to understand
Your Node.js server is slow despite low CPU. What are the possible causes?
Blocking I/O, context switching, memory pressure
↗ click
Two services wait for each other's resource and neither moves. Diagnose and fix it.
Deadlock — four conditions + lock ordering fix
↗ click
Your app uses 2GB RAM but the machine has only 1GB. It still runs. Why?
Virtual memory + demand paging
↗ click
How does epoll let a single thread handle 10,000 connections simultaneously?
Event-driven I/O notification from the kernel
↗ click
Questions an interviewer will ask
  • What happens step by step when you run a program? Start from the shell command.
    ↗ click
  • Why is creating a thread cheaper than creating a process? What do they share?
    ↗ click
  • What is a page fault and when is it normal vs a problem?
    ↗ click
  • How does Node.js handle thousands of connections without spawning thousands of threads?
    ↗ click
03
Computer Networks
How data moves from your app to the other side of the world
HTTP & TCP
Situations to walk through until you can do it eyes closed
A user types "https://juspay.in" and presses Enter. Walk through every network event until the page loads.
DNS → TCP → TLS → HTTP — the full journey
↗ click
A video call degrades quality when the network gets busy, but doesn't freeze entirely. Why?
UDP accepts packet loss — TCP would stall
↗ click
A WebSocket chat app works fine locally but drops messages after 30 seconds of silence in production. Why?
Load balancer idle timeout — fix with heartbeat pings
↗ click
A mobile client retries a failed payment 3 times. The server receives all three. What should the server do?
Idempotency key deduplication
↗ click
Things you've already practiced — go deeper
  • WebSocket upgrade: describe the exact HTTP headers exchanged and what the server must return.
    ↗ click
  • Resumable download: a client downloaded 60MB of 100MB and the connection dropped. What HTTP feature lets you resume?
    ↗ click
  • DNS: a fresh browser with no cache looks up "api.juspay.in" — what series of servers does it contact?
    ↗ click
  • HTTP/2 sends 6 requests at once on one connection. If there's packet loss, what goes wrong? How does HTTP/3 fix it?
    ↗ click
04
Concurrency & thread safety
Making code that runs correctly when multiple things happen at once
Threads & Locks
Juspay's most common concurrency question: "here's code you wrote — now make it thread-safe." Practice writing the broken version first, then fixing it.
Code scenarios — implement from scratch
Two payment workers both read ₹500, both deduct ₹300, both write back ₹200. The real balance should be −₹100. Fix this.
Race condition — mutex around read-modify-write
↗ click
Build a job queue where producers add jobs and workers pick them up. Workers should sleep when empty, not spin in a loop.
Blocking queue — condition variable
↗ click
A config object is read by 100 threads constantly but written only once every 5 minutes. Locking every read is too slow.
Read-write lock
↗ click
Thread A holds lock 1, waits for lock 2. Thread B holds lock 2, waits for lock 1. Nothing moves. Fix it.
Deadlock — always acquire locks in the same order
↗ click
Take your LRU Cache. Make it safe for 10 threads reading and writing simultaneously.
Thread-safe LRU — the classic Juspay combo question
↗ click
Build a rate limiter allowing 100 API calls per minute, shared across multiple server threads.
Token bucket with mutex
↗ click
10 lakh customers try to buy the same product at once, but only 2 units are in stock. How do you prevent overselling and stop the rest from placing an order?
Atomic stock reservation with a conditional update
↗ click
Event loop situations — your Node.js background
  • Three async functions must all finish before you proceed. How do you run them concurrently without sequential await?
    ↗ click
  • A setTimeout with 0ms delay runs after your synchronous code. Why? Explain the exact execution order.
    ↗ click
  • Your Node.js server blocks for 500ms on a CPU-heavy calculation. What happens to all incoming requests?
    ↗ click
05
System Design
Designing things that handle millions of users without falling over
Architecture
Every time you design a system, go through five steps out loud: clarify requirements → estimate scale → draw the diagram → go deep on one component → name the trade-offs. Don't skip steps.
Full systems to design end-to-end
  • Design WhatsApp — you've done this. Now: how does it handle message ordering when two people send at the exact same time?
    ↗ click
  • Design the Juspay payment gateway. Walk through every system a charge request touches until money moves.
    ↗ click
  • Design a URL shortener handling 10,000 redirects per second. A redirect must resolve in under 5ms.
    ↗ click
  • Design a notification system that sends 50 million push notifications within 10 minutes of a product launch.
    ↗ click
Component-level situations
You deploy and 1,000 requests all miss the empty cache simultaneously, hammering the DB. Fix it.
Cache stampede — mutex per key or early expiry
↗ click
You add a new server. How do you move only 1/N of the keys instead of rehashing everything?
Consistent hashing
↗ click
Your DB has one writer and five read replicas. A user writes a record then immediately reads it but gets a 404. Why?
Replication lag
↗ click
A service calls another service which calls another. One timeout cascades and takes down everything. Fix it.
Circuit breaker pattern
↗ click
06
Real-world engineering discussions
Systems the interviewer might bring up — reason about them confidently
Payments & Scale
Payments — Juspay's actual domain
  • A customer pays ₹10,000. The network drops after the bank approves but before Juspay confirms to the airline. How do you prevent a double charge?
    ↗ click
  • Move ₹500 from Account A to B. The debit succeeds but the credit fails. How do you make sure neither account ends up wrong?
    ↗ click
  • How does UPI route a payment from a customer's HDFC app to a merchant's Paytm account? What's in the middle?
    ↗ click
  • Design a merchant dashboard that shows real-time transaction success rates, failure reasons, and latency — for 10,000 merchants simultaneously.
    ↗ click
  • A payment that was approved yesterday needs to be refunded. The original bank authorization has expired. How do you handle this?
    ↗ click
  • Juspay routes payments through multiple banks. Bank A has 99% success rate, Bank B has 92%. How do you decide which bank to try first for each transaction?
    ↗ click
Caching & data consistency
  • Your cache shows a user's old balance for 30 seconds after they top up. Fix this without slowing things down.
    ↗ click
  • A search feature queries the cache first. Attackers query millions of non-existent keys to hammer the DB. Fix it.
    ↗ click
Distributed systems
  • The network between two data centres splits. Both sides keep accepting writes. When the split heals, what do you do with conflicting data?
    ↗ click
  • You deploy to 1 out of 10 servers. A user hits the new server, then the old one. Their session breaks. Why?
    ↗ click
  • Your microservice calls three downstream services. One is slow. How do you stop that slowness from bringing down your entire service?
    ↗ click
  • Walk me through all four patterns that protect a system from cascading failures — and explain why each one is necessary even when the others are in place.
    ↗ click
07
Defending your own projects
They'll go deep on Scribe, Delivery Hub, the DICOM app — be ready
Project Depth
For every project: what problem it solves → how it's architected → why each technical choice → hardest thing you debugged → what breaks at 100x scale → what you'd change if starting over.
Scribe — real-time chat (Flask + Socket.io)
  • Your resume says "5 concurrent users per room." Why that limit? What would break at 500?
    ↗ click
  • If I close my laptop mid-conversation and reopen it, what happens to my messages? Do I see what I missed?
    ↗ click
  • How would you make Scribe work across multiple servers without users losing messages?
    ↗ click
Delivery Hub — logistics platform (Node.js + MySQL)
  • Your resume mentions simulating race conditions in tests. Give me a concrete example of one you found and how you fixed it.
    ↗ click
  • If Delivery Hub had 100,000 active orders, what's the first thing in your current architecture that breaks?
    ↗ click
UCC DICOM app — AES-256 encryption (Flask)
  • Explain what a timing attack is to someone who's never done security work.
    ↗ click
  • Why does every encryption operation use a different IV? What goes wrong if you reuse one?
    ↗ click
08
Thinking live in the interview
How to handle questions you haven't seen before
Reasoning
Juspay's open-ended round evaluates how you think, not what you know. Staying calm and reasoning out loud beats knowing the answer and panicking when a follow-up catches you off guard.
Open-ended questions — practice these out loud, record yourself
  • Your payment service processes 1M transactions per minute. At 10am on Monday it slows to a crawl. How do you find the cause?
    ↗ click
  • A customer says "I was charged but my order didn't go through." Debug this with me live.
    ↗ click
  • Build a system that sends an SMS exactly once when a user's balance drops below ₹100 — even if the system crashes mid-send.
    ↗ click
  • How would you make a system highly available if you only have one database?
    ↗ click
  • Design a webhook delivery system. Merchants register URLs and you must notify them of payment events — reliably, at scale, with retries.
    ↗ click
  • You're asked to add a new payment method (say, BNPL — Buy Now Pay Later) to Juspay's existing gateway. Walk me through how you'd architect it.
    ↗ click
  • A new engineer joins and accidentally deploys broken code that causes 30% of payments to fail. Walk me through how you detect, respond, and recover.
    ↗ click
  • How would you build a system that can replay any payment event from the last 30 days? Why would you need this?
    ↗ click
  • You need to migrate a live payment database from MySQL to PostgreSQL with zero downtime. How do you do it?
    ↗ click
  • A merchant complains their settlement (money transferred to their account) is delayed by 2 hours compared to what the contract says. How do you investigate and fix it?
    ↗ click
  • Design a system that lets Juspay A/B test two different payment flows on 5% of traffic each, measure conversion rates, and roll back instantly if something goes wrong.
    ↗ click
The "derive it" drill — for when you blank on something
  • If you forget why TCP needs a 3-way handshake: reason from "what problem does it solve?" and derive the mechanism.
    ↗ click
  • If you forget database indexing: start from "scanning 10M rows is too slow" and build up from there.
    ↗ click
Juspay SDE Interview Syllabus · Nilashis Saha · Final Two Rounds