š Computer Networks ā Master Interview & Revision Guide
Targeted for: Juspay Elimination Round, Hackathon Part B System Discussion & Backend Engineering Interviews.
Core Focus: High-scale payment systems, network security, protocol internals, handshake mechanisms, idempotency, and client identification.
š Complete CN Module Index
| # | Document | Core Topics Covered | Juspay High-Yield Relevance |
|---|---|---|---|
| 01 | 01-dns-deep-dive.md | Recursive vs Iterative resolution, Root/TLD/Authoritative hierarchy, Record types (A, AAAA, CNAME, MX, NS, TXT, SOA, PTR), Caching & TTL, DNSSEC | āāā Asked directly in Part B final phase |
| 02 | 02-tcp-vs-udp-transport-layer.md | 3-Way Handshake, 4-Way Termination, TIME_WAIT vs CLOSE_WAIT leaks, Sliding Window (Flow Control), Congestion Control (Slow Start, AIMD, Fast Retransmit), UDP vs QUIC | āāā Critical for transport reliability & low-latency payments |
| 03 | 03-http-https-evolution.md | Methods (GET, POST, PUT, PATCH, DELETE, OPTIONS), Status codes (200, 201, 301, 400, 401, 403, 404, 409, 429, 500, 502, 503, 504), HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC) | āāā REST API semantics & microservice communication |
| 04 | 04-ssl-tls-and-certificates.md | TLS 1.2 vs 1.3 Handshake, Symmetric vs Asymmetric crypto, Certificate Authorities (CA), Local OS Trust Store validation, Digital Signatures, mTLS in Banking | āāāā Direct Juspay Part B interview question |
| 05 | 05-ip-addressing-and-routing.md | IPv4 Classes, Subnetting & CIDR calculations, IPv6, NAT / NAPT (PAT) translation tables, Public vs Private IP ranges (RFC 1918) | āāā Essential for networking & infrastructure routing |
| 06 | 06-idempotency-in-payments.md | Why payments demand idempotency, Double-debit prevention, Idempotency Keys (UUIDv4), Redis + DB locking state machines, In-flight concurrency & 409/429 handling | āāāāā CORE JUSPAY QUESTION (Payment Gateway LLD) |
| 07 | 07-session-management-and-identification.md | Client differentiation: 2 tabs on 1 laptop vs 2 laptops on 1 WiFi (NAT) vs 2 laptops on different networks; Cookies, JWT, SessionStorage, Security (CSRF, XSS, SameSite) | āāāā Direct Juspay Part B interview question |
| 08 | 08-osi-and-tcp-ip-models.md | All 7 OSI Layers, PDUs, Encapsulation/Decapsulation, OSI vs TCP/IP mapping, Hub vs Switch vs Router, L4 vs L7 Load Balancers, MAC vs IP | āāāā Foundational Networking & Systems Architecture |
| 09 | 09-vpn-tunneling-cryptography-and-encoding.md | VPN Internals (TUN/TAP, Encapsulation, WireGuard/IPsec), Symmetric vs Asymmetric Crypto, Encoding vs Encryption vs Hashing vs Tokenization, RBI Payment Card Tokenization, JWT Deep Dive, npm for frontend | āāāāā Direct Juspay Systems & Security Interview questions |
| 10 | 10-web-security-attacks-and-defenses.md | SOP & CORS Deep Dive (Preflight OPTIONS, Headers), XSS (Stored, Reflected, DOM), CSRF (Synchronizer tokens, SameSite), SSRF (AWS IMDS exploit), Clickjacking, Payment Replay attacks | āāāāā Critical Web & Payment Gateway Security Gauntlet |
| 11 | 11-rest-api-architecture-and-design.md | Roy Fielding's 6 Constraints, Richardson Maturity Model (L0-L3), HTTP Semantics (RFC 9110), Idempotency Filters & Lock, OCC (ETags), Keyset Pagination, Distributed Rate Limiting, Versioning & Webhooks | āāāāā CORE JUSPAY QUESTION (REST API Architecture & Design) |
ā” 10-Minute Rapid Pre-Interview Cheat Sheet
1. DNS Record Quick Matrix
- A: Maps hostname $\rightarrow$ IPv4 address (
api.juspay.in$\rightarrow$13.235.12.45). - AAAA: Maps hostname $\rightarrow$ IPv6 address (
api.juspay.in$\rightarrow$2404:6800:...). - CNAME: Alias mapping canonical name to canonical name (
pay.merchant.com$\rightarrow$secure.juspay.in). Cannot be on root zone (@). - MX: Mail exchange server with priority weighting (
10 mail.juspay.in). - NS: Nameserver authority delegating DNS zone (
ns1.awsdns.com). - TXT: Arbitrary text ā domain verification, SPF (anti-spam), DKIM, SSL domain validation.
2. TCP Handshake & State Essentials
HANDSHAKE: [Client] --- SYN (seq=x) ---> [Server]
[Client] <-- SYN-ACK (seq=y, ack=x+1) -- [Server]
[Client] --- ACK (ack=y+1) ---> [Server] (Can send data!)
TERMINATION: [Client] --- FIN ---> [Server]
[Client] <-- ACK --- [Server] (Server enters CLOSE_WAIT)
[Client] <-- FIN --- [Server]
[Client] --- ACK ---> [Server] (Client enters TIME_WAIT: 2 * MSL)- Why
TIME_WAIT(2MSL = ~60-120s)?- Ensure final ACK reaches server (if lost, server retransmits FIN).
- Prevent old delayed duplicate packets from colliding with a new incarnation of the same socket
(IP:Port).
3. How Computer Validates an SSL/TLS Certificate Locally
1. Server sends Leaf Certificate Chain (Leaf -> Intermediate -> Root CA).
2. Client inspects OS / Browser Root Trust Store to locate the Root CA Public Key.
3. Client verifies Digital Signature:
- Decrypts issuer's signature using issuer's Public Key -> gets Hash(Cert).
- Computes SHA-256 Hash of received certificate body independently.
- If computed_hash == decrypted_hash -> Certificate is authentic and untampered!
4. Checks: Expiration dates (NotBefore / NotAfter), Domain Name match (SAN/CN), Revocation status (OCSP / CRL).4. Idempotency in Payment Gateways
- Definition: $f(f(x)) = f(x)$. Executing the same operation multiple times produces the exact same side-effect as executing it once.
- Why Vital: Prevent double charging a customer when a bank timeout or mobile network retry occurs.
- Implementation:
- Client sends header
Idempotency-Key: <unique-uuid>. - Backend acquires a distributed lock (Redis) or uses DB unique constraint
UNIQUE(idempotency_key). - If key exists:
- If state ==
COMPLETED: Return cached response immediately. - If state ==
PROCESSING: Return409 Conflictor poll/wait.
- If state ==
- If new: Create record in state
PENDING$\rightarrow$ Execute payment with Bank/UPI $\rightarrow$ Update toSUCCESS$\rightarrow$ Cache response $\rightarrow$ Release lock.
- Client sends header
5. Client Differentiation Scenarios
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Scenario ā How the Server Differentiates ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Two Tabs on Same Laptop ā Same Public IP, Same Client Port (if sharing HTTP/2 conn), Same Cookie ā
ā ā -> Differentiated by: Unique Tab ID, sessionStorage, or custom header. ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Two Laptops on Same WiFi (NAT) ā Same Public IP (seen by server). Differentiated by: Unique NAT Source ā
ā ā Ports (Transport Layer) and Distinct Session Cookies / JWTs (App Layer).ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Two Laptops on Different Networks ā Differentiated at Layer 3: Distinct Public IP Addresses + Unique Auth. ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāšÆ How to Use These Notes
- Read each markdown file sequentially for conceptual mastery.
- Study the "Verbatim Interview Scripts" to learn how to structure your spoken answers under pressure.
- Review the "Juspay & Real-World Payment Context" callouts to stand out with production-grade architectural awareness.