This is the final phase. Networks, System Design, and SDLC complete the technical picture. Every application you build runs over networks. Every application that needs to scale requires system design thinking. Every project you join follows an SDLC model. These three topics appear in every Infosys interview, across every role.
🌐 Why This Phase Completes the Picture
Networks explain how data moves. System Design explains how large systems are structured. SDLC/Agile explains how teams build them. Together these three topics transform a candidate who can write code into one who can reason about distributed systems, communicate requirements, and deliver software in a professional team.
"The internet is not a thing you can hold in your hand. It is a set of agreements — protocols — between machines. Understanding those agreements is what makes you a network engineer, not just a user."— Vint Cerf · Co-creator of TCP/IP · "Father of the Internet" · Google VP
🔎 OSI Model & TCP/IP Architecture
The OSI model is the universal language of networking interviews. Every network question is answered with OSI knowledge. Know all 7 layers, their functions, real protocols at each, and the two classic mnemonics cold.
| Layer | Name | Function | Real Protocols / Devices |
|---|---|---|---|
| 7 | Application | User-facing services, data formatting for apps | HTTP, HTTPS, FTP, SMTP, DNS, SSH, WebSocket |
| 6 | Presentation | Encryption, compression, encoding/decoding | TLS/SSL, JPEG, MP3, ASCII, UTF-8 |
| 5 | Session | Manage sessions: open, maintain, close connections | NetBIOS, RPC, SIP |
| 4 | Transport | End-to-end delivery, segmentation, flow control, error recovery | TCP, UDP — ports live here |
| 3 | Network | Logical addressing and routing between networks | IP, ICMP, ARP, Router |
| 2 | Data Link | Frame delivery within same network, MAC addressing, error detection | Ethernet, Wi-Fi (802.11), Switch, MAC |
| 1 | Physical | Raw bit transmission over physical medium | Cables, Fiber, Radio waves, Hubs, NIC |
The TCP/IP model (Internet model) is the practical 4-layer model governing the internet. OSI is the 7-layer theoretical reference model used for understanding and troubleshooting.
| TCP/IP Layer | OSI Layers Covered | Key Protocols |
|---|---|---|
| Application | 7 + 6 + 5 (Application + Presentation + Session) | HTTP, HTTPS, FTP, SMTP, DNS, SSH, WebSocket |
| Transport | 4 (Transport) | TCP, UDP |
| Internet | 3 (Network) | IP, ICMP, ARP |
| Network Access / Link | 2 + 1 (Data Link + Physical) | Ethernet, Wi-Fi, MAC, cables, fiber |
-- Data encapsulation going DOWN the stack (sending): Application: "GET /index.html HTTP/1.1" (HTTP message) Transport: [TCP header | HTTP message] (segment: adds port numbers) Internet: [IP header | TCP segment] (packet: adds IP addresses) Link: [MAC header | IP packet | FCS] (frame: adds MAC addresses) Physical: 10101010110101... (raw bits on wire) -- Going UP the stack (receiving): each layer strips its header -- Encapsulation going down, Decapsulation going up
This is the most comprehensive network question — it tests OSI, DNS, TCP, TLS, and HTTP all at once.
1. BROWSER CACHE CHECK: Does browser have cached IP for google.com? If yes, skip DNS. 2. DNS RESOLUTION (Application layer): Browser asks OS resolver -> checks /etc/hosts OS asks recursive DNS resolver (ISP or 8.8.8.8) Resolver queries: Root NS -> .com TLD NS -> google.com authoritative NS Returns: 142.250.190.46 (Google IP) 3. TCP 3-WAY HANDSHAKE (Transport + Network layers): Browser -> Google: SYN (seq=x) Google -> Browser: SYN-ACK (seq=y, ack=x+1) Browser -> Google: ACK (ack=y+1) -- Connected! 4. TLS HANDSHAKE (HTTPS -- Presentation layer): Client Hello: supported ciphers + random nonce Server Hello: chosen cipher + certificate (public key) Client verifies cert against trusted CAs Key exchange: Diffie-Hellman -> shared session key Encrypted communication begins 5. HTTP REQUEST (Application layer): GET / HTTP/1.1 Host: www.google.com 6. SERVER RESPONSE: HTTP/1.1 200 OK [HTML body] 7. BROWSER RENDERS HTML, fetches CSS/JS/images (additional requests)
| Device | OSI Layer | Address Used | How it forwards | Use case |
|---|---|---|---|---|
| Hub | Layer 1 (Physical) | None | Broadcasts ALL frames to ALL ports. No intelligence. | Obsolete. Created collision domains. |
| Switch | Layer 2 (Data Link) | MAC address | Learns which MAC is on which port. Sends frame ONLY to destination port. | Connect devices within a LAN. Efficient. |
| Router | Layer 3 (Network) | IP address | Routes packets between DIFFERENT networks using routing table. | Connect your LAN to the internet. Connect offices. |
-- Switch MAC address table (learned dynamically by watching traffic): Port 1: 00:1A:2B:3C:4D:5E (laptop) Port 2: 00:AA:BB:CC:DD:EE (printer) Port 3: 00:11:22:33:44:55 (NAS) -- When laptop sends to printer: Switch: dest MAC = 00:AA:BB:CC:DD:EE -> send ONLY to Port 2 -- Printer receives. Laptop and NAS do NOT see this frame.
| Property | MAC Address | IP Address |
|---|---|---|
| Layer | Data Link (Layer 2) | Network (Layer 3) |
| Scope | Local network only (same subnet) | Global (identifies host anywhere on internet) |
| Format | 48-bit hex: 00:1A:2B:3C:4D:5E | 32-bit IPv4: 192.168.1.1 or 128-bit IPv6 |
| Assignment | Burned into NIC by manufacturer (can be spoofed) | DHCP (dynamic) or manual (static) |
| Changes per hop? | YES -- changes at every router hop | NO -- stays same end-to-end |
| Used by | Switches (within LAN) | Routers (between networks) |
-- Packet from laptop to google.com: IP header: Source=192.168.1.5 (your IP) Dest=142.250.190.46 (Google) MAC header: Source=laptop_MAC Dest=router_MAC -- At your router (first hop): IP header: Source=192.168.1.5 (unchanged) Dest=142.250.190.46 (unchanged) MAC header: Source=router_MAC (changed) Dest=next_isp_router_MAC (changed) -- IP stays the same end-to-end. MAC changes at EVERY hop. -- ARP maps IP -> MAC within each local network segment.
-- ARP: resolves IP address to MAC address within a local network -- Needed because switches forward by MAC, but apps use IP -- Example: laptop (192.168.1.5) wants to reach printer (192.168.1.10) -- Laptop does not know printer MAC 1. ARP REQUEST (BROADCAST to all devices): "Who has 192.168.1.10? Tell 192.168.1.5" Sent to: FF:FF:FF:FF:FF:FF (broadcast -- all devices receive) 2. ARP REPLY (UNICAST from printer): "192.168.1.10 is at AA:BB:CC:DD:EE:FF" Sent only to laptop MAC 3. Laptop caches mapping in ARP table (TTL ~20 min): 192.168.1.10 -> AA:BB:CC:DD:EE:FF -- View your ARP table: -- Windows/Linux: arp -a -- 192.168.1.1 00-14-22-01-23-45 (router) -- 192.168.1.10 AA-BB-CC-DD-EE-FF (printer)
📶 TCP vs UDP & Transport Protocols
TCP vs UDP is the transport layer equivalent of Process vs Thread — a fundamental trade-off question. Every real-time system, streaming service, and game makes this choice. Know it cold: what TCP guarantees, how it achieves them, what UDP sacrifices and why.
| Property | TCP | UDP |
|---|---|---|
| Connection | Connection-oriented: 3-way handshake | Connectionless: fire and forget |
| Reliability | Guaranteed delivery: ACKs, retransmission on loss | No guarantee: packets may be lost, duplicated, reordered |
| Ordering | Guaranteed in-order delivery | No ordering guarantee |
| Flow control | Yes (sliding window) | No |
| Congestion control | Yes (slow start, AIMD) | No |
| Speed | Slower — overhead of connection + reliability | Faster — minimal overhead (8-byte header) |
| Header size | 20 bytes minimum | 8 bytes |
| Use when | Accuracy critical: web, email, file transfer, DB | Speed critical: gaming, video streaming, VoIP, DNS |
| Examples | HTTP/HTTPS, FTP, SMTP, SSH, MySQL | DNS, DHCP, video calls, online gaming, live streaming |
-- TCP 3-Way Handshake: establishing a reliable connection Client Server | | |------ SYN (seq=x) --------------->| "I want to connect, my seq starts at x" | | |<----- SYN-ACK (seq=y, ack=x+1) --| "OK, my seq starts at y, got your x" | | |------ ACK (ack=y+1) ------------->| "Got your y. Connection established!" | | |<======= DATA TRANSFER ============>| -- Sequence numbers are random (ISN: Initial Sequence Number) -- This prevents old packets from previous connections being mistakenly accepted -- 4-Way Connection Termination: Client -> Server: FIN "I am done sending" Server -> Client: ACK "Got it" Server -> Client: FIN "I am done sending too" Client -> Server: ACK "Got it. Closing." -- Client waits in TIME_WAIT state (2 x MSL) before fully closing
Why 3 steps and not 2? Two steps would let the server know the client is ready, but the client would have no confirmation the server received its sequence number. The third step (client ACK) confirms to the server that the client received the server sequence number. Both sides must confirm they can send AND receive — 3 steps is the minimum.
Flow Control: Prevents sender from overwhelming the RECEIVER. Uses sliding window.
-- Receiver advertises its window size (rwnd) in every ACK -- Sender cannot have more than rwnd bytes "in flight" (sent but not ACKed) -- When receiver buffer fills: Window Size = 0 (sender must pause) -- When buffer drains: receiver sends Window Update TCP Header: Window Size = 65535 (receiver has 65535 bytes of buffer available)
Congestion Control: Prevents overwhelming the NETWORK. TCP infers congestion from packet loss.
-- Slow Start: begin with cwnd (congestion window) = 1 MSS -- Double cwnd every RTT until ssthresh (exponential growth) -- Congestion Avoidance: grow linearly (+1 MSS per RTT) above ssthresh -- On packet loss (timeout): ssthresh = cwnd/2, restart slow start -- On 3 duplicate ACKs (Fast Retransmit): ssthresh = cwnd/2, cwnd = ssthresh -- Effective send rate = min(rwnd, cwnd) / RTT
-- Port: 16-bit number (0-65535) identifying a specific application/service -- Together with IP: (IP, Port, Protocol) = socket = unique endpoint -- Port ranges: -- 0-1023: Well-known / System ports (require root/admin to bind) -- 1024-49151: Registered ports (application services) -- 49152-65535: Ephemeral / Dynamic ports (clients use these for outgoing) -- Well-known ports (MUST know for interviews): -- 20/21 FTP (data/control) -- 22 SSH (Secure Shell) -- 23 Telnet (insecure, avoid) -- 25 SMTP (email sending) -- 53 DNS -- 80 HTTP -- 110 POP3 (email retrieval) -- 143 IMAP (email retrieval) -- 443 HTTPS -- 3306 MySQL -- 5432 PostgreSQL -- 6379 Redis -- 27017 MongoDB -- 8080 HTTP alternate (common for dev servers)
| Property | IPv4 | IPv6 |
|---|---|---|
| Address size | 32-bit (4 bytes) | 128-bit (16 bytes) |
| Format | Dotted decimal: 192.168.1.1 | Colon-hex: 2001:0db8:85a3::8a2e:0370:7334 |
| Address space | ~4.3 billion (exhausted in 2011) | ~340 undecillion — effectively unlimited |
| NAT required? | Yes — NAT extends addresses | No — every device gets globally unique address |
| Header | 20 bytes (variable with options) | 40 bytes (fixed, simpler processing) |
| Broadcast | Yes | No — replaced by multicast and anycast |
| Configuration | Manual or DHCP | Auto-config (SLAAC) + DHCPv6 |
| Security | IPSec optional | IPSec built-in (mandatory in spec) |
| Adoption | ~96% of traffic | ~36% and growing (dual-stack common) |
| Attack | How it works | Mitigation |
|---|---|---|
| DDoS | Flood server with traffic from many sources until unavailable | Rate limiting, CDN absorption, traffic scrubbing, anycast |
| Man-in-the-Middle | Intercept communication between two parties (ARP spoofing, rogue AP) | TLS/HTTPS, certificate pinning, HSTS, VPN |
| DNS Spoofing | Inject fake DNS records to redirect users to malicious IP | DNSSEC, DNS over HTTPS (DoH), DNS over TLS (DoT) |
| Packet Sniffing | Capture unencrypted packets on shared network | Encrypt all traffic (TLS), use switched networks, VPN |
| SYN Flood | Send many SYNs but never complete handshake, exhausting server connection table | SYN cookies, firewall rate limits |
| IP Spoofing | Forge source IP to impersonate another host | Ingress filtering at ISPs, TLS mutual authentication |
🌐 HTTP, HTTPS & DNS
HTTP is the protocol of the web and most APIs. DNS is the internet phone book. Every backend developer needs both. Understanding status codes, HTTP methods, and the HTTP/1.1 vs HTTP/2 vs HTTP/3 progression sets you apart from candidates who only know that HTTP exists.
| Method | Purpose | Body? | Idempotent? | Safe? | Use case |
|---|---|---|---|---|---|
| GET | Retrieve resource | No | Yes | Yes | Fetch user profile, search results |
| POST | Create new resource | Yes | No | No | Submit form, create new order |
| PUT | Replace entire resource | Yes | Yes | No | Update entire user object |
| PATCH | Partial update of resource | Yes | No | No | Change only email field |
| DELETE | Remove resource | Optional | Yes | No | Delete a post |
| HEAD | Like GET but headers only | No | Yes | Yes | Check resource exists, get content-length |
| OPTIONS | List supported methods | No | Yes | Yes | CORS preflight request |
Idempotent: calling same request N times produces same result as calling once. GET/PUT/DELETE idempotent. POST is not — two identical POSTs create two resources.
Safe: does not modify server state. GET/HEAD/OPTIONS are safe.
| Class | Meaning | Key Codes |
|---|---|---|
| 1xx Informational | Request received, processing | 100 Continue, 101 Switching Protocols (WebSocket upgrade) |
| 2xx Success | Request succeeded | 200 OK, 201 Created (POST success), 204 No Content (DELETE success) |
| 3xx Redirection | Further action needed | 301 Moved Permanently, 302 Found (temp redirect), 304 Not Modified (cached) |
| 4xx Client Error | Request has client-side error | 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests |
| 5xx Server Error | Server failed on valid request | 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout |
| Property | HTTP/1.1 | HTTP/2 | HTTP/3 |
|---|---|---|---|
| Transport | TCP | TCP | QUIC (UDP-based) |
| Connections | Multiple per domain (6-8) | Single multiplexed TCP connection | Single QUIC connection |
| HOL Blocking | Yes (request queue) | TCP level still. Request level solved. | Solved at both levels |
| Headers | Plain text, repeated | HPACK binary compression | QPACK compression |
| Server Push | No | Yes | Yes |
| TLS | Optional | Practically required | Built-in (0-RTT resumption) |
| Adoption | Universal | ~50% | ~30% and growing |
HTTPS = HTTP + TLS. TLS provides: encryption (no eavesdropping), authentication (talking to real server), integrity (no tampering).
-- TLS 1.3 Handshake:
Client -> Server: ClientHello
- TLS version 1.3
- Supported cipher suites (e.g., AES-256-GCM-SHA384)
- Client random nonce
- DH public key share
Server -> Client: ServerHello + Certificate + Finished
- Chosen cipher suite
- Server DH public key
- Digital certificate (contains server public key + CA signature)
- Already encrypted (TLS 1.3 = 1-RTT handshake)
Client: verifies certificate chain against trusted CAs
- Checks: domain matches, not expired, signed by trusted CA
- Derives shared session key via Diffie-Hellman:
Both sides compute same secret without ever transmitting it!
Client -> Server: Finished (encrypted)
=> Encrypted data exchange begins
-- Why DH (Diffie-Hellman)?
-- Client has: client_private + server_public -> shared_secret
-- Server has: server_private + client_public -> SAME shared_secret
-- Eavesdropper has: only public keys (cannot derive shared_secret)
-- This provides Forward Secrecy: past sessions cannot be decrypted
-- DNS Resolution: browser types "api.infosys.com" 1. CHECK LOCAL CACHE: Browser cache -> OS cache -> /etc/hosts If found and not expired -> done! (sub-millisecond) 2. RECURSIVE RESOLVER (ISP DNS or 8.8.8.8): Your system asks the configured resolver 3. ROOT NAMESERVER (13 root server clusters globally): Resolver: "Where is .com?" Root NS: "Ask .com TLD server at 192.5.6.30" 4. TLD NAMESERVER (.com): Resolver: "Where is infosys.com?" TLD NS: "Ask ns1.infosys.com (their authoritative NS)" 5. AUTHORITATIVE NAMESERVER (infosys.com): Resolver: "What is api.infosys.com?" Auth NS: "api.infosys.com = 103.22.14.5, TTL=300" 6. Resolver caches result for TTL=300 seconds, returns to browser 7. Browser connects to 103.22.14.5 -- Cost: ~50-100ms cold. ~1ms cached. -- DNS Record Types (must know): -- A: hostname -> IPv4 address (api.infosys.com -> 103.22.14.5) -- AAAA: hostname -> IPv6 address -- CNAME: alias -> canonical name (www -> infosys.com) -- MX: mail server for domain (infosys.com -> mail.infosys.com) -- TXT: arbitrary text (SPF, DKIM, domain verification) -- NS: authoritative nameservers for domain -- SOA: start of authority (zone metadata, TTL policies)
🔒 Subnets, NAT, Firewalls & Advanced Networking
CORS, WebSockets, CDNs, and firewalls appear constantly in real Infosys project work. CORS is something every frontend-backend integration developer hits immediately. WebSockets are in every real-time system. CDNs are in every large-scale deployment.
-- CIDR notation: IP/prefix_length -- /24 means first 24 bits are NETWORK portion -- Remaining 8 bits (32-24) are HOST portion -- 192.168.1.0/24: -- Network: 192.168.1 (24 bits, fixed for all devices in this subnet) -- Hosts: .0 to .255 (8 bits, 256 values) -- Usable: .1 to .254 (254 hosts -- .0=network address, .255=broadcast) -- Subnet mask: 255.255.255.0 -- Common CIDR blocks: -- /32 = 1 IP (single host, firewall rules) -- /30 = 4 IPs (2 usable, point-to-point links) -- /28 = 16 IPs (14 usable) -- /24 = 256 IPs (254 usable, typical LAN) -- /16 = 65,536 IPs (large corporate network) -- /8 = 16M IPs (ISP or cloud region) -- Private ranges (RFC 1918 -- NOT routable on public internet): -- 10.0.0.0/8 (10.x.x.x) -- 172.16.0.0/12 (172.16.x.x to 172.31.x.x) -- 192.168.0.0/16 (192.168.x.x -- your home router)
-- NAT (Network Address Translation): -- Maps multiple private IPs to one public IP -- Exists because IPv4 exhausted (4.3B addresses not enough for every device) -- Home router NAT example: -- Laptop: 192.168.1.5:54321 (private, not routable on internet) -- Router: 203.0.113.10 (one public IP from ISP) -- Outgoing (laptop -> Google): -- Original: src=192.168.1.5:54321 dst=142.250.190.46:443 -- Router rewrites: src=203.0.113.10:40001 dst=142.250.190.46:443 -- Router stores mapping: port 40001 -> 192.168.1.5:54321 -- Reply (Google -> router): -- Google sends to: 203.0.113.10:40001 -- Router looks up: 40001 -> 192.168.1.5:54321 -- Router rewrites dst, delivers to laptop
NAT limitation: devices behind NAT cannot be directly reached from the internet — complicates P2P (VoIP, gaming). IPv6 eliminates NAT by giving every device a globally routable address.
| Firewall Type | Inspects | Intelligence | Example use |
|---|---|---|---|
| Packet Filter (Stateless) | IP, port, protocol in each packet | Low — no session awareness | Block all traffic except ports 80/443 |
| Stateful Inspection | Packet + tracks connection state | Medium — knows if packet is part of established session | Allow responses to outgoing; block unsolicited inbound |
| Application Layer (WAF) | Full HTTP payload up to Layer 7 | High — understands HTTP, SQL, JavaScript | Block SQL injection, XSS, CSRF in HTTP bodies |
| Next-Gen (NGFW) | All above + deep packet inspection + IDS/IPS | Very high — identifies apps not just ports | Block specific apps, detect malware, threat intelligence |
-- CORS: Cross-Origin Resource Sharing -- Same-Origin Policy: JavaScript on site-A cannot read responses from site-B -- UNLESS site-B explicitly allows it via CORS headers -- Origin = protocol + domain + port -- Same: https://app.com/api and https://app.com/data (same origin) -- Different: https://app.com and https://api.app.com (different subdomain!) -- Simple GET request flow: Browser -> api.infosys.com: GET /data Origin: https://myapp.com (browser adds automatically) Server responds if allowed: HTTP 200 OK Access-Control-Allow-Origin: https://myapp.com Access-Control-Allow-Methods: GET, POST Access-Control-Allow-Headers: Content-Type, Authorization -- Preflight (for POST/PUT/DELETE with custom headers): Browser -> Server: OPTIONS request first Origin: https://myapp.com Access-Control-Request-Method: POST Access-Control-Request-Headers: Content-Type Server approves -> browser sends actual POST
-- HTTP (request-response): client MUST ask first. Server cannot push.
-- Problem: real-time apps (chat, live scores, trading) need server to push data
-- Without WebSockets (painful alternatives):
-- Short Polling: client asks every 1 second -> 99% empty responses, wasteful
-- Long Polling: client asks, server holds open until data -> one response per TCP connection
-- WebSocket: full-duplex persistent connection over single TCP
-- Starts as HTTP then upgrades:
GET /chat HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Server:
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
-- Now it is a raw TCP connection, no more HTTP overhead
-- After upgrade: EITHER side can send frames ANYTIME:
Server -> Client: {"type":"message","text":"Hello!","user":"Alice"}
Client -> Server: {"type":"typing","user":"Bob"}
-- Frame overhead: 2-14 bytes (vs 800+ bytes HTTP headers per message)
-- Used in: chat (WhatsApp Web), dashboards, multiplayer games, stock tickers
-- CDN (Content Delivery Network): globally distributed servers (PoPs) -- cache and serve content from the location closest to the user -- Without CDN (origin in Mumbai only): -- User in New York: Mumbai and back ~200ms -- User in London: Mumbai and back ~150ms -- With CDN (Cloudflare: 300+ PoPs worldwide): -- User in New York: Newark PoP ~5ms -- User in London: London PoP ~3ms -- Cache HIT: CDN returns cached copy (no origin contact) -- Cache MISS: CDN fetches from origin, caches it, returns to user -- What CDNs provide: -- Static asset caching (JS, CSS, images, video, fonts) -- TLS termination at the edge (encryption closer to user) -- DDoS mitigation (absorb traffic at edge before it hits origin) -- HTTP/3 and HTTP/2 at edge even if origin uses HTTP/1.1 -- WAF and bot detection (Cloudflare WAF) -- Cache-Control headers: Cache-Control: public, max-age=31536000 (1 year -- immutable static assets) Cache-Control: no-cache (revalidate with server each time) Cache-Control: private (user-specific, CDN must NOT cache) ETag: "abc123" (content hash for conditional requests)
🌏 System Design — Scalability Fundamentals
Infosys now asks freshers basic system design questions — not 'design WhatsApp' but 'what is horizontal scaling' and 'how does caching work'. These test whether you think about systems at scale, not just code correctness. The 5-step framework below is what every strong fresher answer uses.
Clarify Requirements
Functional (what it does) + Non-functional (scale, latency, availability). Never design before understanding these.
Estimate Scale
Users, requests/sec, data volume. Back-of-envelope math determines if you need caching, sharding, CDN.
High-Level Design
Draw: client -> load balancer -> app servers -> cache -> DB. Identify major components.
Deep Dive
Pick 2-3 critical components, explain them in detail. Show trade-offs you considered.
Identify Bottlenecks
SPOF, hot spots, scaling limits. What breaks first at 10x load? How do you fix it?
| Dimension | Vertical (Scale Up) | Horizontal (Scale Out) |
|---|---|---|
| What it means | Bigger machine: more CPU, RAM, disk | More machines: add servers to a pool |
| Code changes | None needed | Stateless design required |
| Cost | Expensive at high end (diminishing returns) | Cheaper: commodity hardware |
| Hard limit | Yes — biggest server available | No — add servers indefinitely |
| Downtime for scaling | Usually requires restart | No — add while running |
| State handling | Easy — all state on one machine | Hard — shared state needs Redis/DB |
| Failure | Single point of failure | Redundant: losing one server is OK |
| Best for | Databases (hard to shard), quick wins | Web/app servers, stateless microservices |
| Algorithm | How it works | Best for |
|---|---|---|
| Round Robin | Rotate through servers in order | Servers with similar capacity, uniform request duration |
| Weighted Round Robin | Proportional traffic (Server1=70%, Server2=30%) | Servers with different capacities |
| Least Connections | Route to server with fewest active connections | Long-lived connections, variable request duration |
| IP Hash | Hash(client IP) -> always same server | Session affinity (sticky sessions) |
| Least Response Time | Route to fastest responding server | Latency-sensitive applications |
Layer 4 vs Layer 7 Load Balancing: L4 (TCP level): routes by IP/port, very fast, cannot inspect content. L7 (HTTP level): routes by URL path, headers, cookies — smarter routing. Examples: L4 = AWS NLB. L7 = AWS ALB, nginx, HAProxy. Use L7 to route /api/* to API servers and /static/* to CDN origin.
-- CACHE-ASIDE (Lazy Loading) -- most common:
result = cache.get("user:42")
if result is None:
result = db.query("SELECT * FROM users WHERE id=42")
cache.set("user:42", result, ttl=300)
return result
-- Only caches what is actually requested
-- Cache miss = 3 trips (check cache + hit DB + write cache)
-- WRITE-THROUGH: write to cache AND DB simultaneously
cache.set("user:42", data)
db.update(data)
-- Always in sync. Every write hits both cache and DB.
-- WRITE-BACK (Write-Behind): write to cache only, flush DB async
cache.set("user:42", data)
# background worker: flush to DB every N seconds
-- Fastest writes. Risk: data loss if cache crashes before flush.
| Eviction Policy | What gets evicted | Best for |
|---|---|---|
| LRU (Least Recently Used) | Item not accessed for longest time | General purpose (Redis default) |
| LFU (Least Frequently Used) | Item accessed fewest times | When access frequency matters more than recency |
| TTL (Time To Live) | Items after fixed expiration | Stale data: DNS, sessions, rate limits |
| Random | Random item | Simple, surprisingly effective |
-- Sharding: split data across multiple DB instances (each = a shard) -- Required when: single DB cannot handle write volume or storage -- HASH-BASED: shard = hash(user_id) % num_shards -- user_id=1001: hash % 4 = 1 -> Shard 1 -- user_id=1002: hash % 4 = 2 -> Shard 2 -- Pros: even distribution. Cons: resharding moves most data! -- RANGE-BASED: user_id 1-1M on Shard1, 1M-2M on Shard2 -- Pros: simple, easy range queries. Cons: hot spots (newest users on last shard) -- DIRECTORY-BASED: lookup table: user_id -> shard_id -- Pros: flexible, easy resharding. Cons: lookup table is a bottleneck
-- Message Queue: async communication between services
-- Producer puts message in queue, Consumer processes independently
-- WITHOUT queue (synchronous):
User: "Send password reset email"
App: calls email service -> waits 500ms -> responds to user
-- User blocked waiting for email!
-- WITH queue (asynchronous):
User: "Send password reset email"
App: puts {email_task} in queue -> responds "Check your inbox!" immediately
Email worker: picks task from queue -> sends email 500ms later
-- User gets instant response!
-- Queue benefits:
-- 1. Decoupling: producer and consumer scale independently
-- 2. Buffering: absorbs traffic spikes without losing requests
-- 3. Reliability: messages persist if consumer crashes (reprocessed)
-- 4. Load leveling: 10,000 req/sec burst -> queue absorbs -> process at 100/sec
| Property | RabbitMQ | Kafka |
|---|---|---|
| Model | Traditional message broker (push) | Distributed event log (pull) |
| Message retention | Deleted after consumption | Retained for configurable time (replay!) |
| Throughput | High | Very high (millions/sec) |
| Use case | Task queues, notifications, RPC | Event streaming, audit logs, real-time analytics, microservice event bus |
| Ordering | Per-queue FIFO | Per-partition ordering |
| Examples | Email jobs, payment processing | Clickstream, CDC, activity feeds |
-- Rate Limiter: limits requests per client per time window
-- Prevents: API abuse, DDoS, resource exhaustion
-- TOKEN BUCKET (most common, allows bursts):
-- Bucket holds N tokens. 1 request = 1 token consumed.
-- Tokens refill at fixed rate (e.g., 10/second, max 100)
-- Request: if tokens > 0, consume and allow. Else: 429 Too Many Requests.
-- SLIDING WINDOW COUNTER (accurate):
-- Track request timestamps. Count in last 60 seconds.
-- Memory-intensive but no edge-case at window boundary.
-- FIXED WINDOW COUNTER (simple but flawed):
-- Count per minute. Edge case: 100 at 00:59 + 100 at 01:01 = 200 in 2 sec!
-- Redis implementation (atomic, distributed):
def is_allowed(user_id):
key = f"rate:{user_id}:{current_minute()}"
count = redis.incr(key) # atomic increment, returns new value
if count == 1:
redis.expire(key, 60) # set TTL on first request
return count <= 1000 # True=allow, False=reject (429)
-- Response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1714140000
Retry-After: 60 (on 429: seconds to wait)
| Dimension | Monolith | Microservices |
|---|---|---|
| Structure | Single deployable unit | Many small independent services |
| Deployment | Deploy entire app for any change | Deploy only the changed service |
| Scaling | Scale entire app (even unused parts) | Scale only services that need it |
| Communication | In-process function calls (fast) | Network calls HTTP/gRPC (latency + failure points) |
| Data | Shared DB (simple joins) | Each service owns its DB (distributed transactions hard) |
| Complexity | Simple to dev, test, debug | Complex: service discovery, distributed tracing, network partitions |
| Best for | Startups, small teams, early product | Large orgs, many independent teams (Netflix, Uber) |
An API Gateway is a single entry point for all client requests to backend microservices. It handles: (1) Request routing (URL path to correct service), (2) Authentication (verify JWT once, not in every service), (3) Rate limiting at the edge, (4) SSL termination (HTTPS at gateway, HTTP internally), (5) Load balancing across service instances, (6) Response transformation and aggregation, (7) Centralized logging and monitoring, (8) Circuit breaking for unhealthy services. Popular options: AWS API Gateway, Kong, NGINX, Traefik, Apigee, Netflix Zuul.
With simple hashing (hash(key) % N servers): adding/removing one server invalidates (N-1)/N of all cached keys — causing a thundering herd on the DB. Consistent hashing: place servers and keys on a circular ring (0 to 2′). Each key is stored on the first server clockwise from its hash position. Adding a server: only keys between its predecessor and itself migrate. Removing: only that server keys move to the next. Result: only 1/N of keys migrate (vs nearly all with modulo hashing). Virtual nodes (each physical server placed at K positions) provide better load distribution. Used in: Cassandra, Amazon DynamoDB, Redis Cluster.
Use SQL when: complex relationships and joins needed, ACID transactions required (payments, booking, inventory deduction), schema is stable and well-defined, or reporting with GROUP BY/aggregations. Use NoSQL when: massive write throughput needed (Cassandra: IoT, clickstream), schema varies per document (product catalog), simple key-based access with no complex joins, or extreme read speed (Redis: sessions, leaderboards, caches). Real examples: Bank ledger → PostgreSQL. User sessions → Redis. Product catalog with varied fields → MongoDB. Social feed → Cassandra. Most large systems use BOTH: PostgreSQL for transactional data + Redis for caching + Elasticsearch for search.
🏛 System Design Problems
For freshers, system design tests structured thinking, not deep expertise. Use the 5-step framework. Think out loud, ask clarifying questions, acknowledge trade-offs. The interviewer wants to see reasoning, not a perfect architecture.
-- REQUIREMENTS:
-- Functional: shorten URL, redirect short -> long, optional analytics
-- Non-functional: 100M URLs, 10:1 read:write, <100ms redirect latency
-- SCALE ESTIMATE:
-- Write: 100M / 30days = ~40 URLs/sec
-- Read: ~400 redirects/sec (10:1 ratio)
-- Storage: 100M * 500 bytes = 50GB (manageable)
-- HIGH-LEVEL DESIGN:
Client -> Load Balancer -> API Servers -> Redis cache
-> PostgreSQL
-- SHORT CODE GENERATION (base62):
-- 62 chars: a-z (26) + A-Z (26) + 0-9 (10)
-- 6 chars: 62^6 = 56 billion unique codes
-- Generate random 6-char string, check DB for collision, retry if collision
-- DB SCHEMA:
CREATE TABLE urls (
short_code VARCHAR(8) PRIMARY KEY,
long_url TEXT NOT NULL,
created_at TIMESTAMP,
expires_at TIMESTAMP,
user_id INT
);
-- REDIRECT FLOW (cache-aside):
GET /{short_code}
1. Redis.get(short_code) -> HIT: return 301/302 redirect immediately
2. MISS: PostgreSQL query -> cache result (TTL=3600s) -> return redirect
-- 301 vs 302: 301=permanent (browser caches, no analytics). 302=temporary (every click tracked)
-- For analytics use 302.
-- REQUIREMENTS:
-- 1:1 messaging, group chat, online status, message history
-- 50M DAU, real-time delivery, 5-year message storage
-- HIGH-LEVEL:
Client -> Load Balancer -> Chat Servers (WebSocket)
-> Kafka (message queue)
-> Cassandra (message storage)
-> Redis (presence/online status)
-- REAL-TIME: WebSocket (persistent bidirectional connection)
-- Each user: persistent WebSocket to a Chat Server
-- Chat Server maintains: {user_id -> WebSocket} in-memory map
-- MESSAGE DELIVERY:
-- Alice sends to Bob:
-- 1. Alice -> Alice's Chat Server -> Kafka topic
-- 2. Message consumer: is Bob connected? Check Redis.
-- 3a. Bob online: find Bob's Chat Server -> push via WebSocket
-- 3b. Bob offline: store in DB, send push notification, deliver when online
-- CASSANDRA SCHEMA (time-series):
CREATE TABLE messages (
conversation_id UUID,
message_id TIMEUUID, -- encodes timestamp, enables time-sorting
sender_id UUID,
content TEXT,
PRIMARY KEY (conversation_id, message_id)
) WITH CLUSTERING ORDER BY (message_id DESC);
-- Fetch last 50: SELECT ... LIMIT 50 -- one partition read
-- ONLINE PRESENCE (Redis):
-- User connects: redis.setex("online:{user_id}", 30, "1")
-- Heartbeat every 20s: renew TTL
-- Check: redis.get("online:bob") -> not None means online
A notification system decouples event producers from notification delivery. Core components: (1) API to receive events (order placed, payment done), (2) Message queue (Kafka) to absorb events, (3) Notification workers per channel (email worker, SMS worker, push worker), (4) Template engine (render notification body from event data), (5) Delivery providers (SendGrid for email, Twilio for SMS, FCM/APNs for push). Key decisions: retry logic with exponential backoff for failed deliveries, idempotency (deduplicate notifications using event ID to prevent double-sending on retry), user preferences (respect opt-outs per channel), rate limiting per user (no spam). Use Kafka for durability — if the email service is down, notifications queue up and deliver when it recovers.
Core components: (1) Rider App -> API Gateway -> Booking Service (match rider to driver), (2) Driver Location Service (drivers send GPS every 5s -> stored in Redis with geospatial index), (3) Matching Service (find nearest available drivers within radius using geospatial query), (4) Pricing Service (surge pricing = demand/supply ratio), (5) Real-time tracking (WebSocket for live map updates). Key tech choices: Redis GEOADD/GEORADIUS for driver location (O(n) radius search), Kafka for trip events, PostgreSQL for trip history + billing, WebSocket for live location streaming. The hardest part: exactly-once driver assignment (prevent two riders from booking same driver simultaneously) — use Redis atomic SETNX or DB row-level locking.
See Q30 for the complete API Gateway answer. In design problems: always add an API Gateway when you have multiple microservices. It prevents the client from knowing about individual service URLs, handles cross-cutting concerns (auth, rate limiting, logging) in one place, and provides a stable contract to clients even when backend services are refactored. Without a gateway: every client must know every service URL, every service must implement auth and rate limiting redundantly, and changing a service URL breaks all clients.
Core: in-memory hash map (O(1) GET/SET/DELETE). Persistence: WAL (append-only log) + periodic snapshots. Replication: primary accepts writes, replicas stream WAL. Expiration: store TTL with each key, background thread sweeps expired keys. Eviction: when memory full, use LRU to evict least recently used keys. Cluster: consistent hashing to distribute keys across nodes. Why in-memory? RAM access ~100ns vs disk ~1ms (10,000x faster). The core data structure is just a HashMap — Redis uses hash tables with open addressing and incremental rehashing to avoid pauses.
📋 SDLC Models
Infosys is a large software services company. Every project follows an SDLC model. You will work in teams using Agile, deliver via Scrum, and be evaluated partly on process understanding. SDLC questions appear in HR rounds, technical rounds, AND manager rounds.
Planning
Feasibility, scope, timeline, budget
Requirements
Functional + non-functional, stakeholder input
Design
System architecture, DB schema, UI wireframes
Implementation
Coding, unit testing, code review
Testing
Integration, system, UAT, performance
Deployment
Release to production, CI/CD pipeline
Maintenance
Bug fixes, enhancements, monitoring
| Dimension | Waterfall | Agile |
|---|---|---|
| Structure | Sequential phases. Cannot return to previous phase. | Iterative sprints (1-4 weeks). All phases each sprint. |
| Requirements | Fixed upfront. Changes are expensive. | Evolve throughout project. Change is embraced. |
| Customer involvement | Start (requirements) and end (delivery). | Continuous — every Sprint Review. |
| Delivery | One big release at the very end. | Working software every sprint. |
| Documentation | Heavy — every phase documented. | Light — working software over docs. |
| Testing | After coding phase completes. | Throughout — every sprint. |
| Risk | High — problems discovered late (expensive). | Low — problems discovered early (cheap to fix). |
| Best for | Fixed requirements, regulated industries (defense, medical). | Evolving requirements, software products, startups. |
| Model | Key Idea | Pros | Cons | Best for |
|---|---|---|---|---|
| Waterfall | Linear sequential phases | Simple, documented | Late defect discovery, no flexibility | Fixed requirements, regulatory |
| V-Model | Each dev phase paired with test phase | Testing planned early, high quality | Rigid, expensive to change | Safety-critical: military, medical |
| Spiral | Risk-driven iterations: plan/risk/prototype/evaluate | Excellent risk management | Complex, expensive, needs risk expertise | Large high-risk, research-heavy projects |
| RAD (Rapid Application Development) | Fast prototyping, user feedback, parallel teams | Very fast delivery, user-centric | Needs skilled team, limited scalability | Small-medium projects, fast delivery |
| Iterative | Develop subset of features, refine each iteration | Early partial delivery, accommodates change | May not address architecture upfront | Evolving requirements |
| Agile (Scrum) | Short sprints + empirical process | Fastest adaptation, continuous delivery | Needs discipline, scope creep risk | Most modern software products |
| SRS Section | Content |
|---|---|
| Introduction | Purpose, scope, definitions, document conventions |
| Overall Description | Product functions, user classes, constraints, assumptions |
| Functional Requirements | WHAT the system does. Use cases / user stories. Each: unique ID, description, priority, acceptance criteria. |
| Non-Functional Requirements | HOW WELL it does it. Performance (<200ms), Scalability (10K concurrent), Security (AES-256), Availability (99.9%) |
| External Interfaces | UI wireframes, hardware interfaces, API contracts (external systems) |
| Constraints | Technology constraints (must use Java), budget, timeline, legal/regulatory |
| Appendices | Glossary, use case diagrams, data flow diagrams, entity-relationship diagrams |
Functional vs Non-Functional: Functional = WHAT ("user can log in with email + password"). Non-Functional = HOW WELL ("login completes within 2 seconds at P95 for up to 10,000 concurrent users"). Both must be testable — "the system shall be fast" is NOT a valid requirement.
| Feasibility Type | What it checks | Key questions |
|---|---|---|
| Technical | Can we build it with available technology and team skills? | Do we have the required tech stack? Can we acquire the skills? |
| Economic | Is the cost justified by the benefit? | ROI, cost-benefit analysis, NPV, development cost vs revenue |
| Operational | Will users and the organization actually use and support it? | Will users adopt it? Does it fit existing workflows and processes? |
| Legal | Are there legal or compliance issues? | Data privacy (GDPR, PDPB), IP rights, licensing, accessibility laws |
| Scheduling | Can it be completed in the required timeframe? | Is the deadline realistic given scope and team size? |
Feasibility study is done BEFORE committing resources. It is much cheaper to discover "we cannot technically build this" at the feasibility stage than after 6 months of development. Output: feasibility report recommending go/no-go decision to stakeholders.
| Testing Type | What it checks | Who | Tools |
|---|---|---|---|
| Unit Testing | Individual function/class in isolation. Mock dependencies. | Developer | JUnit, TestNG, Mockito, pytest |
| Integration Testing | How modules interact when combined. | Dev / QA | Postman, REST Assured, JUnit |
| System Testing | Complete end-to-end application against requirements. | QA | Selenium, Katalon, Cypress |
| UAT (User Acceptance) | Does it meet actual business needs? Real users. | Client / end users | Manual, exploratory |
| Regression Testing | New changes did not break existing features. | QA / Automated | Selenium, Cypress, JUnit suite |
| Smoke Testing | Basic sanity after new build: "does it start?" | QA / DevOps | Manual or automated health check |
| Performance Testing | System under load: response time, throughput. | QA / DevOps | JMeter, k6, Gatling |
| Security Testing | Vulnerabilities: SQL injection, XSS, CSRF. | Security QA | OWASP ZAP, Burp Suite, Snyk |
| Exploratory Testing | Unscripted investigation to find unexpected issues. | QA | Manual, creative |
Testing pyramid: Many unit tests (fast, cheap, isolated) + moderate integration tests + few E2E tests (slow, brittle, expensive). Inverting the pyramid (many E2E, few unit) creates slow, fragile test suites that slow down CI/CD.
⚙ Agile & Scrum
Infosys uses Agile and Scrum on the majority of its delivery projects. Understanding Scrum roles, events, and artifacts is not optional — it is baseline professional knowledge expected on day one.
The Agile Manifesto (2001) states four core values:
- Individuals and interactions over processes and tools
- Working software over comprehensive documentation
- Customer collaboration over contract negotiation
- Responding to change over following a plan
"While there is value in the items on the right, we value the items on the left more." Agile does NOT eliminate documentation or contracts — it prioritizes the left when there is a conflict between the two.
| Role | Responsibilities | What they own |
|---|---|---|
| Product Owner (PO) | Maintains and prioritizes Product Backlog. Defines user stories + acceptance criteria. Represents stakeholders. Only person who can reprioritize backlog. | Product VALUE — ensuring team builds the RIGHT thing |
| Scrum Master (SM) | Facilitates all Scrum events. Removes impediments. Coaches team on Scrum. Protects team from external interruptions. Servant-leader, NOT a manager. | PROCESS — ensuring team works effectively with Scrum |
| Development Team | Self-organizing, cross-functional (dev, QA, design). Decides HOW to do the work. Collectively responsible for Sprint Goal. | DELIVERY — building the product increment each sprint |
| Event | Purpose | Duration (2-wk sprint) | Who |
|---|---|---|---|
| Sprint | Container event. Fixed time-box producing a Done increment. | 1-4 weeks (typically 2) | All |
| Sprint Planning | Select backlog items + create Sprint Goal + plan HOW to deliver. | Max 4 hours | All |
| Daily Scrum | Inspect Sprint Goal progress. Identify impediments. Plan next 24h. | 15 minutes daily | Dev Team (SM/PO may attend) |
| Sprint Review | Inspect increment. Stakeholder feedback. Update backlog. | Max 2 hours | All + stakeholders |
| Sprint Retrospective | Inspect team PROCESS. Create actionable improvement plan. | Max 1.5 hours | Dev Team + SM (PO optional) |
| Artifact | Contents | Owned by | Changes when |
|---|---|---|---|
| Product Backlog | ALL work to be done: user stories, bugs, tech debt, experiments. Ordered by value. Never "complete." | Product Owner | PO reprioritizes anytime based on value, risk, learning |
| Sprint Backlog | Selected PB items for current sprint + plan to deliver them + Sprint Goal. | Development Team | Team can adjust during sprint; PO cannot add new items mid-sprint |
| Increment | All completed PB items from current + all previous sprints. Must meet Definition of Done. Potentially shippable. | Development Team | After each sprint |
Definition of Done (DoD): Shared team agreement on what "Done" means. Example: Code written + reviewed, unit tests passing (>80% coverage), integration tests passing, deployed to staging, documentation updated, no critical bugs. Without DoD, "Done" means different things to different people — Scrum requires a formal shared DoD.
User Story format: "As a [type of user], I want [goal] so that [reason]." Must have testable Acceptance Criteria. Example: As a registered user, I want to reset my password via email so that I can recover my account. AC: email arrives within 2 min, link expires in 24h, used link shows clear error.
| Dimension | Scrum | Kanban |
|---|---|---|
| Iterations | Fixed sprints (1-4 weeks) | Continuous flow, no time-boxes |
| Roles | PO, SM, Dev Team | No prescribed roles |
| WIP Limits | Implicit (sprint capacity) | Explicit WIP limits per column (the key discipline) |
| Change | No changes during sprint | Change anytime (respecting WIP limits) |
| Metrics | Velocity (story points/sprint) | Lead time, cycle time, throughput |
| Best for | Product development, planned feature work | Operations, support, maintenance, unpredictable incoming work |
-- STORY POINTS: relative measure of effort + complexity + uncertainty -- NOT hours! A 3-point story is roughly 3x harder than a 1-point story -- Common scales: Fibonacci (1,2,3,5,8,13,21) or T-shirt (XS,S,M,L,XL) -- PLANNING POKER: -- Facilitator reads user story -- Each team member privately picks a card (story point value) -- All reveal SIMULTANEOUSLY (prevents anchoring bias) -- Outliers explain their reasoning (1 vs 13 = valuable discussion!) -- Re-estimate until consensus or average -- VELOCITY: average story points completed per sprint -- Sprint 1: 34, Sprint 2: 28, Sprint 3: 32 -> velocity = 31 -- Used for: 200 points of backlog / 31 = ~6.5 sprints = ~13 weeks -- Why Fibonacci? Gaps grow with size, reflecting uncertainty: -- "1 or 2?" = small, easy to estimate -- "13 or 21?" = large uncertainty, probably needs to be split! -- Rule: story > 13 points -> SPLIT it (too big, too uncertain) -- ANTI-PATTERNS: -- Management using velocity as KPI -> teams inflate estimates -- Comparing velocity between teams -> meaningless (different baseline) -- Velocity as commitment -> it is a planning tool, not a contract
- Set the stage: Check-in question. Create psychological safety (what happens in retro stays in retro).
- Gather data: What went well? What was painful? Concrete, specific observations.
- Generate insights: Why did problems occur? Root cause (5 Whys technique).
- Decide what to do: Select 1-3 improvement actions MAX. Specific, assigned to person, measurable.
- Close: Each person shares one word about the retro itself.
Most common failure mode: Teams discuss problems but leave with no action items. Or create 20 items and do zero. The SM tracks previous retro actions in the next retro — were they completed? A retro without action is a waste of time.
✅ Testing, CI/CD & DevOps
Modern software teams do not separate development from testing. TDD, CI/CD, and DevOps are not optional extras — they are professional expectations. Infosys projects use CI/CD pipelines and automated testing. Understanding these shows you are ready for modern delivery.
-- TDD: write the TEST FIRST, then write code to make it pass
-- RED: write a failing test (feature does not exist yet)
@Test
void testCalculateTax_standardRate() {
double tax = TaxCalculator.calculate(1000, "standard");
assertEquals(180.0, tax); // FAILS: method does not exist
}
-- GREEN: write MINIMUM code to pass the test
class TaxCalculator {
static double calculate(double amount, String type) {
return amount * 0.18; // just enough to pass
}
}
// Test NOW PASSES
-- REFACTOR: improve code quality, tests must still pass
class TaxCalculator {
private static final Map RATES = Map.of(
"standard", 0.18, "reduced", 0.05, "zero", 0.0
);
static double calculate(double amount, String type) {
return amount * RATES.getOrDefault(type, 0.18);
}
}
// All tests still PASS. Code is cleaner and extensible.
TDD benefits: Tests serve as executable documentation. No code without a test (prevents untested code). Forces modular design (untestable code = bad design signal). Enables fearless refactoring (tests catch regressions instantly).
-- CI (Continuous Integration): merge code frequently, automated build+test every time
-- CD (Continuous Delivery): code always in deployable state, one-click release
-- CD (Continuous Deployment): automatic deploy on every successful CI run
-- TYPICAL 8-STAGE PIPELINE:
Developer pushes code to GitHub
|
[1. SOURCE TRIGGER] -- webhook fires
|
[2. BUILD]
Compile: mvn package / gradle build
Resolve dependencies
|
[3. UNIT TESTS]
Run all unit tests
Fail fast: stop pipeline if any test fails
|
[4. CODE QUALITY]
Static analysis: SonarQube, Checkstyle
Coverage gate: must be > 80%
Security scan (SAST): Snyk, Checkmarx
|
[5. BUILD ARTIFACT]
Create Docker image
Push to container registry (AWS ECR, JFrog)
|
[6. DEPLOY TO STAGING]
Automatic deploy to staging environment
|
[7. INTEGRATION / E2E TESTS]
API tests (Postman/Newman)
Selenium E2E tests against staging
|
[8. DEPLOY TO PRODUCTION]
Manual approval (CD) or automatic (CDeployment)
Blue-green or rolling deployment strategy
Smoke tests post-deploy
Monitor: error rate spike -> automatic rollback
| DevOps Practice | What it means | Tools |
|---|---|---|
| Continuous Integration | Frequent merges + automated build/test | Jenkins, GitHub Actions, GitLab CI |
| Continuous Delivery | Automated, reliable releases | Spinnaker, AWS CodeDeploy, ArgoCD |
| Infrastructure as Code | Manage servers with code, not manual steps | Terraform, CloudFormation, Ansible |
| Containerization | Package app + dependencies into portable containers | Docker, containerd |
| Container Orchestration | Manage many containers at scale | Kubernetes, AWS ECS |
| Monitoring / Observability | Metrics, logs, traces for production visibility | Prometheus + Grafana, Datadog, ELK Stack |
| Secret Management | Secure handling of API keys, passwords, certs | HashiCorp Vault, AWS Secrets Manager |
DORA Metrics (measure DevOps maturity): Deployment Frequency (how often you deploy), Lead Time for Changes (commit to production time), Change Failure Rate (% of deployments causing incidents), Mean Time to Recovery (how fast you recover). Elite teams: multiple deployments per day, <1hr lead time, <15% failure rate, <1hr recovery.
-- Bug Life Cycle:
New -> Assigned -> Open (investigating) -> Fixed
|
Retest: PASS -> Closed
Retest: FAIL -> Reopened -> Open again
-- Other states: Deferred (next release), Rejected (not a bug), Duplicate
| Dimension | Severity | Priority |
|---|---|---|
| Definition | Impact on system functionality | Business urgency to fix it |
| Who sets it | QA team (technical judgment) | Product Owner / Business |
| High sev, Low pri | System crashes only in rare admin edge case | Can wait for next sprint |
| Low sev, High pri | Company name misspelled on public homepage | Fix today for brand reasons, even though no functional impact |
| P1-S1 | Production down for all users | Fix immediately — drop everything |
| P4-S4 | Minor cosmetic issue in rarely-used admin screen | Backlog for later sprint |
Shift-Left Testing: Moving testing activities earlier (to the left) in the SDLC, rather than testing only at the end. Instead of: code → code → code → TEST, do: code+test → code+test → code+test.
Benefits: Defects found early are 10-100x cheaper to fix. A bug found in requirements costs 1x. In design: 5x. In coding: 10x. In testing: 15x. In production: 100x. Shift-left prevents the expensive production defects.
Continuous Testing in CI/CD: Every code commit triggers automated tests. Unit tests on every commit (fast: <1 min). Integration tests on every merge to main (medium: 5-15 min). Full E2E suite on every release candidate (slow: 30-60 min). No manual testing gates before deployment — automation provides the confidence.
TDD + BDD: TDD (unit level) + BDD (Behavior Driven Development, using Gherkin: Given/When/Then scenarios) combine to create a full automated test suite that serves as living documentation of system behavior.
| Quality Characteristic | What it measures | Example metric |
|---|---|---|
| Functional Suitability | Does it do what it is supposed to? | All use cases pass acceptance tests |
| Performance Efficiency | Response time, resource usage under load | P95 API response < 200ms at 1000 concurrent users |
| Compatibility | Works with other systems, browsers, OS | Tests pass on Chrome, Firefox, Safari, Edge |
| Usability | How easily can users achieve their goals? | Task completion rate > 90% in user testing |
| Reliability | Works correctly for a specified period | 99.9% uptime, MTBF > 1000 hours |
| Security | Protects data, prevents unauthorized access | 0 critical OWASP Top 10 vulnerabilities |
| Maintainability | How easily can it be modified? | Code coverage > 80%, cyclomatic complexity < 10 |
| Portability | Transfer to another environment | Runs in Docker on AWS/Azure/GCP |
Technical Debt: The cost of shortcuts during development that make future changes harder. Like financial debt: manageable in small amounts, crippling if accumulated. Fix it during dedicated refactoring sprints or "boy scout rule" — always leave code cleaner than you found it.
Verification: "Are we building the product RIGHT?" — checking that the work products conform to specifications. Did we implement the design correctly? Static analysis: code review, inspections, walkthroughs. Example: verify code matches the design document. Validation: "Are we building the RIGHT product?" — checking that the product meets actual user needs. Dynamic testing with real execution. Example: UAT where actual users confirm the system solves their real problem. V&V together ensure both correctness (verification) and fitness for purpose (validation). A system can be perfectly verified (matches specs exactly) but fail validation (specs did not capture actual user needs — the requirements gathering failed).
A test case is a specific set of inputs, preconditions, execution steps, and expected results designed to verify a particular aspect of a system. Key components: (1) Test Case ID (unique identifier), (2) Test Case Name (descriptive), (3) Preconditions (what must be true before executing), (4) Test Steps (numbered actions to perform), (5) Test Data (specific inputs to use), (6) Expected Result (what should happen), (7) Actual Result (filled during execution), (8) Status (Pass/Fail/Blocked). Example: Test ID: TC-LOGIN-001, Name: Valid login with correct credentials, Precondition: User registered with email test@example.com password Test123!, Steps: 1. Go to /login 2. Enter email 3. Enter password 4. Click Submit, Expected: Redirected to /dashboard, welcome message shown.
🗀 Phase 6 Quick-Review Cheatsheet
🎉 Series Complete
You have covered every technical topic Infosys interviewers test — all 6 phases. Every HR question, every DSA pattern, every SQL nuance, every OOPs concept, every DBMS internal, every OS mechanism, every networking principle, every system design building block, and every SDLC practice. The preparation is done.
Now: mock interviews. Code every day. Stay calm on the day. You are ready.