Phase 6 — Contents
Overview Why This Phase Completes You
Computer Networks (Q1–Q22) OSI Model & TCP/IP TCP vs UDP & Protocols HTTP, HTTPS & DNS Subnets, Firewalls, CDN
System Design (Q23–Q42) Scalability Fundamentals Design Problems
SDLC & Agile (Q43–Q58) SDLC Models Agile & Scrum Testing & DevOps
Jump to: Overview OSI/TCP-IP TCP/UDP HTTP/HTTPS Networks Adv SD Basics SD Design SDLC Agile Testing
🌐 Part 2 · Phase 6 of 6 · Final Phase · April 2025

Computer Networks + System Design + SDLC
The Final Phase

The complete closer. Networks from OSI to WebSockets, System Design for freshers from URL shorteners to rate limiters, and every SDLC and Agile question Infosys asks. 58 questions. Series complete.

OSI ModelTCP vs UDPHTTP/HTTPS DNSScalabilityCaching Load BalancingSystem Design Waterfall vs AgileScrumCI/CD
✎ The Tech Intel⏰ ~55 min read 📋 58 Questions · All Answered🌐 Series Complete

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.

🔎 OSI 📶 TCP/UDP 🌐 HTTP 🔒 Security 🌏 Scalability 🏛 Design 📋 SDLC ⚙ Agile ✅ Testing
Overview

🌐 Why This Phase Completes the Picture

⚡ The Three Pillars of Applied Engineering

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
Questions 1–5

🔎 OSI Model & TCP/IP Architecture

⚡ Why OSI Is the Foundation of Every Network Question

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.

LayerNameFunctionReal Protocols / Devices
7ApplicationUser-facing services, data formatting for appsHTTP, HTTPS, FTP, SMTP, DNS, SSH, WebSocket
6PresentationEncryption, compression, encoding/decodingTLS/SSL, JPEG, MP3, ASCII, UTF-8
5SessionManage sessions: open, maintain, close connectionsNetBIOS, RPC, SIP
4TransportEnd-to-end delivery, segmentation, flow control, error recoveryTCP, UDP — ports live here
3NetworkLogical addressing and routing between networksIP, ICMP, ARP, Router
2Data LinkFrame delivery within same network, MAC addressing, error detectionEthernet, Wi-Fi (802.11), Switch, MAC
1PhysicalRaw bit transmission over physical mediumCables, Fiber, Radio waves, Hubs, NIC
Two Mnemonics to Memorise
Top-Down (7→1): All People Seem To Need Data Processing Bottom-Up (1→7): Please Do Not Throw Sausage Pizza Away

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 LayerOSI Layers CoveredKey Protocols
Application7 + 6 + 5 (Application + Presentation + Session)HTTP, HTTPS, FTP, SMTP, DNS, SSH, WebSocket
Transport4 (Transport)TCP, UDP
Internet3 (Network)IP, ICMP, ARP
Network Access / Link2 + 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
💡 OSI is for understanding and troubleshooting. TCP/IP is what actually runs the internet. In interviews: use OSI layer numbers/names, but reference TCP/IP when discussing real protocols.

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)
💡 Practice walking through this in under 2 minutes. It covers DNS, TCP handshake, TLS, HTTP, IP routing, and MAC addressing all in one answer. This single question can take 5-10 minutes in a strong interview.
DeviceOSI LayerAddress UsedHow it forwardsUse case
HubLayer 1 (Physical)NoneBroadcasts ALL frames to ALL ports. No intelligence.Obsolete. Created collision domains.
SwitchLayer 2 (Data Link)MAC addressLearns which MAC is on which port. Sends frame ONLY to destination port.Connect devices within a LAN. Efficient.
RouterLayer 3 (Network)IP addressRoutes 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.
📋 A switch creates a separate collision domain per port. A router creates a separate broadcast domain per interface, preventing broadcast storms from spreading across networks.
PropertyMAC AddressIP Address
LayerData Link (Layer 2)Network (Layer 3)
ScopeLocal network only (same subnet)Global (identifies host anywhere on internet)
Format48-bit hex: 00:1A:2B:3C:4D:5E32-bit IPv4: 192.168.1.1 or 128-bit IPv6
AssignmentBurned into NIC by manufacturer (can be spoofed)DHCP (dynamic) or manual (static)
Changes per hop?YES -- changes at every router hopNO -- stays same end-to-end
Used bySwitches (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)
⚠ ARP Spoofing: attacker sends fake ARP replies poisoning other devices ARP caches, making their traffic go through the attacker machine (Man-in-the-Middle). Mitigation: Dynamic ARP Inspection (DAI) on managed switches, 802.1X port authentication.
Questions 6–11

📶 TCP vs UDP & Transport Protocols

⚡ Why TCP vs UDP Is Asked in Every Technical Round

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.

PropertyTCPUDP
ConnectionConnection-oriented: 3-way handshakeConnectionless: fire and forget
ReliabilityGuaranteed delivery: ACKs, retransmission on lossNo guarantee: packets may be lost, duplicated, reordered
OrderingGuaranteed in-order deliveryNo ordering guarantee
Flow controlYes (sliding window)No
Congestion controlYes (slow start, AIMD)No
SpeedSlower — overhead of connection + reliabilityFaster — minimal overhead (8-byte header)
Header size20 bytes minimum8 bytes
Use whenAccuracy critical: web, email, file transfer, DBSpeed critical: gaming, video streaming, VoIP, DNS
ExamplesHTTP/HTTPS, FTP, SMTP, SSH, MySQLDNS, DHCP, video calls, online gaming, live streaming
💡 Real-world: Netflix uses TCP (HTTP) for video delivery — buffering is acceptable, reliability matters. Online gaming uses UDP — a late position update is useless, so a dropped packet is better than a delayed one. DNS uses UDP for speed with TCP fallback for large responses.
-- 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
💡 HTTP/3 runs over QUIC (UDP-based) which implements its own faster congestion control, reducing latency especially during connection establishment. QUIC also solves head-of-line blocking that exists in HTTP/2 over TCP.
-- 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)
📋 netstat -tulnp (Linux) or netstat -ano (Windows) shows which processes are listening on which ports. Useful for debugging port conflicts or verifying a server started correctly.
PropertyIPv4IPv6
Address size32-bit (4 bytes)128-bit (16 bytes)
FormatDotted decimal: 192.168.1.1Colon-hex: 2001:0db8:85a3::8a2e:0370:7334
Address space~4.3 billion (exhausted in 2011)~340 undecillion — effectively unlimited
NAT required?Yes — NAT extends addressesNo — every device gets globally unique address
Header20 bytes (variable with options)40 bytes (fixed, simpler processing)
BroadcastYesNo — replaced by multicast and anycast
ConfigurationManual or DHCPAuto-config (SLAAC) + DHCPv6
SecurityIPSec optionalIPSec built-in (mandatory in spec)
Adoption~96% of traffic~36% and growing (dual-stack common)
💡 IPv4 exhaustion is real — IANA allocated the last /8 blocks in 2011. Most ISPs use NAT to let many devices share one public IPv4 address. IPv6 eliminates the need for NAT by giving every device a globally routable address.
AttackHow it worksMitigation
DDoSFlood server with traffic from many sources until unavailableRate limiting, CDN absorption, traffic scrubbing, anycast
Man-in-the-MiddleIntercept communication between two parties (ARP spoofing, rogue AP)TLS/HTTPS, certificate pinning, HSTS, VPN
DNS SpoofingInject fake DNS records to redirect users to malicious IPDNSSEC, DNS over HTTPS (DoH), DNS over TLS (DoT)
Packet SniffingCapture unencrypted packets on shared networkEncrypt all traffic (TLS), use switched networks, VPN
SYN FloodSend many SYNs but never complete handshake, exhausting server connection tableSYN cookies, firewall rate limits
IP SpoofingForge source IP to impersonate another hostIngress filtering at ISPs, TLS mutual authentication
Questions 12–16

🌐 HTTP, HTTPS & DNS

⚡ Why HTTP and DNS Are Daily Engineering Knowledge

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.

MethodPurposeBody?Idempotent?Safe?Use case
GETRetrieve resourceNoYesYesFetch user profile, search results
POSTCreate new resourceYesNoNoSubmit form, create new order
PUTReplace entire resourceYesYesNoUpdate entire user object
PATCHPartial update of resourceYesNoNoChange only email field
DELETERemove resourceOptionalYesNoDelete a post
HEADLike GET but headers onlyNoYesYesCheck resource exists, get content-length
OPTIONSList supported methodsNoYesYesCORS 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.

💡 REST convention: GET /users (list), POST /users (create), GET /users/42 (fetch one), PUT /users/42 (replace), PATCH /users/42 (partial update), DELETE /users/42 (delete). This resource-oriented design is what Infosys projects use daily.
ClassMeaningKey Codes
1xx InformationalRequest received, processing100 Continue, 101 Switching Protocols (WebSocket upgrade)
2xx SuccessRequest succeeded200 OK, 201 Created (POST success), 204 No Content (DELETE success)
3xx RedirectionFurther action needed301 Moved Permanently, 302 Found (temp redirect), 304 Not Modified (cached)
4xx Client ErrorRequest has client-side error400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests
5xx Server ErrorServer failed on valid request500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout
⚠ 401 vs 403: 401 = I do not know who you are (authentication failed). 403 = I know who you are but you cannot do this (authorization failed). 301 vs 302: 301 = permanent redirect (browser caches forever). 302 = temporary (browser checks every time — use for analytics).
PropertyHTTP/1.1HTTP/2HTTP/3
TransportTCPTCPQUIC (UDP-based)
ConnectionsMultiple per domain (6-8)Single multiplexed TCP connectionSingle QUIC connection
HOL BlockingYes (request queue)TCP level still. Request level solved.Solved at both levels
HeadersPlain text, repeatedHPACK binary compressionQPACK compression
Server PushNoYesYes
TLSOptionalPractically requiredBuilt-in (0-RTT resumption)
AdoptionUniversal~50%~30% and growing
💡 HTTP/2 multiplexing: one TCP connection carries many parallel requests/responses as independent streams. HTTP/3 QUIC: a lost UDP packet only blocks the stream it belongs to, not all streams — solving the remaining TCP head-of-line blocking.

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
📋 TLS 1.3 removed all weak cipher suites, mandated forward secrecy, and reduced handshake to 1-RTT (vs 2-RTT in TLS 1.2). 0-RTT resumption allows known sessions to send data immediately — though with replay attack trade-offs.
-- 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)
💡 DNS TTL is critical: low TTL (60s) = fast failover but high query load. High TTL (86400s) = less load but slow propagation. Migration strategy: lower TTL a week before, make change, wait TTL duration, raise TTL again.
Questions 17–22

🔒 Subnets, NAT, Firewalls & Advanced Networking

⚡ Why Advanced Networking Rounds Out Interview Readiness

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)
💡 Quick subnet size: /24=256, /25=128, /26=64, /27=32, /28=16. Each step up halves, each step down doubles. Cloud VPC design uses these daily.
-- 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 TypeInspectsIntelligenceExample use
Packet Filter (Stateless)IP, port, protocol in each packetLow — no session awarenessBlock all traffic except ports 80/443
Stateful InspectionPacket + tracks connection stateMedium — knows if packet is part of established sessionAllow responses to outgoing; block unsolicited inbound
Application Layer (WAF)Full HTTP payload up to Layer 7High — understands HTTP, SQL, JavaScriptBlock SQL injection, XSS, CSRF in HTTP bodies
Next-Gen (NGFW)All above + deep packet inspection + IDS/IPSVery high — identifies apps not just portsBlock specific apps, detect malware, threat intelligence
📋 A WAF (Web Application Firewall) specifically protects web APIs by filtering HTTP traffic. AWS WAF, Cloudflare WAF, and ModSecurity are common examples. They sit in front of your API and block OWASP Top 10 threats before they reach your application code.
-- 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
⚠ CORS is enforced by the BROWSER, not the server. A server without CORS headers still RECEIVES and processes the request — but the browser refuses to let JavaScript READ the response. CORS errors appear in browser console, not server logs. Access-Control-Allow-Origin: * allows any origin but CANNOT be combined with credentials (cookies/Authorization headers).
-- 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
💡 WebSockets pass through HTTP-aware firewalls (initial HTTP upgrade looks normal) but then bypass HTTP overhead for all subsequent messages. Libraries: Socket.io (Node.js with fallback), Spring WebSocket (Java), Django Channels (Python).
-- 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)
Questions 23–32

🌏 System Design — Scalability Fundamentals

⚡ Why System Design Is Now Asked at Fresher Level

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.

1

Clarify Requirements

Functional (what it does) + Non-functional (scale, latency, availability). Never design before understanding these.

2

Estimate Scale

Users, requests/sec, data volume. Back-of-envelope math determines if you need caching, sharding, CDN.

3

High-Level Design

Draw: client -> load balancer -> app servers -> cache -> DB. Identify major components.

4

Deep Dive

Pick 2-3 critical components, explain them in detail. Show trade-offs you considered.

5

Identify Bottlenecks

SPOF, hot spots, scaling limits. What breaks first at 10x load? How do you fix it?

DimensionVertical (Scale Up)Horizontal (Scale Out)
What it meansBigger machine: more CPU, RAM, diskMore machines: add servers to a pool
Code changesNone neededStateless design required
CostExpensive at high end (diminishing returns)Cheaper: commodity hardware
Hard limitYes — biggest server availableNo — add servers indefinitely
Downtime for scalingUsually requires restartNo — add while running
State handlingEasy — all state on one machineHard — shared state needs Redis/DB
FailureSingle point of failureRedundant: losing one server is OK
Best forDatabases (hard to shard), quick winsWeb/app servers, stateless microservices
💡 Best practice: vertically scale the database (defer sharding complexity), horizontally scale the application tier (stateless = trivial). App servers: horizontal from day one. DB: vertical first, then read replicas, then sharding only when absolutely needed.
AlgorithmHow it worksBest for
Round RobinRotate through servers in orderServers with similar capacity, uniform request duration
Weighted Round RobinProportional traffic (Server1=70%, Server2=30%)Servers with different capacities
Least ConnectionsRoute to server with fewest active connectionsLong-lived connections, variable request duration
IP HashHash(client IP) -> always same serverSession affinity (sticky sessions)
Least Response TimeRoute to fastest responding serverLatency-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 PolicyWhat gets evictedBest for
LRU (Least Recently Used)Item not accessed for longest timeGeneral purpose (Redis default)
LFU (Least Frequently Used)Item accessed fewest timesWhen access frequency matters more than recency
TTL (Time To Live)Items after fixed expirationStale data: DNS, sessions, rate limits
RandomRandom itemSimple, surprisingly effective
💡 Cache invalidation strategy: delete the cache entry whenever the DB is updated (do NOT update cache directly — avoids race conditions). Let the next read repopulate from DB. This is safer than trying to keep cache and DB in sync on every write.
-- 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
⚠ Cross-shard operations are painful: JOINs across shards must be done in application code, transactions spanning shards require distributed transactions (complex), resharding requires massive data migration. Always try read replicas and caching before sharding. Defer sharding as long as possible.
-- 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
PropertyRabbitMQKafka
ModelTraditional message broker (push)Distributed event log (pull)
Message retentionDeleted after consumptionRetained for configurable time (replay!)
ThroughputHighVery high (millions/sec)
Use caseTask queues, notifications, RPCEvent streaming, audit logs, real-time analytics, microservice event bus
OrderingPer-queue FIFOPer-partition ordering
ExamplesEmail jobs, payment processingClickstream, 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)
DimensionMonolithMicroservices
StructureSingle deployable unitMany small independent services
DeploymentDeploy entire app for any changeDeploy only the changed service
ScalingScale entire app (even unused parts)Scale only services that need it
CommunicationIn-process function calls (fast)Network calls HTTP/gRPC (latency + failure points)
DataShared DB (simple joins)Each service owns its DB (distributed transactions hard)
ComplexitySimple to dev, test, debugComplex: service discovery, distributed tracing, network partitions
Best forStartups, small teams, early productLarge orgs, many independent teams (Netflix, Uber)
⚠ Do not jump to microservices prematurely. Martin Fowler's rule: 'Don't start with microservices.' Start monolith. Extract services when: specific parts need different scaling, team size grows beyond 10 per service, or independent deployment becomes critical. Microservices first causes operational complexity before the benefits materialize.

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.

Questions 33–42

🏛 System Design Problems

⚡ How to Answer Fresher 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.
💡 Why base62 not base64? Base64 uses + and / which are URL-unsafe characters. Base62 uses only alphanumeric — safe in URLs without encoding.
-- 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.

Questions 39–47

📋 SDLC Models

⚡ Why SDLC Questions Are Universal at Infosys

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

DimensionWaterfallAgile
StructureSequential phases. Cannot return to previous phase.Iterative sprints (1-4 weeks). All phases each sprint.
RequirementsFixed upfront. Changes are expensive.Evolve throughout project. Change is embraced.
Customer involvementStart (requirements) and end (delivery).Continuous — every Sprint Review.
DeliveryOne big release at the very end.Working software every sprint.
DocumentationHeavy — every phase documented.Light — working software over docs.
TestingAfter coding phase completes.Throughout — every sprint.
RiskHigh — problems discovered late (expensive).Low — problems discovered early (cheap to fix).
Best forFixed requirements, regulated industries (defense, medical).Evolving requirements, software products, startups.
💡 Infosys uses both. Internal products and client app development: Agile/Scrum. Government/defense contracts with fixed scope and price: Waterfall or hybrid. Know both cold — you may work on either depending on the client.
ModelKey IdeaProsConsBest for
WaterfallLinear sequential phasesSimple, documentedLate defect discovery, no flexibilityFixed requirements, regulatory
V-ModelEach dev phase paired with test phaseTesting planned early, high qualityRigid, expensive to changeSafety-critical: military, medical
SpiralRisk-driven iterations: plan/risk/prototype/evaluateExcellent risk managementComplex, expensive, needs risk expertiseLarge high-risk, research-heavy projects
RAD (Rapid Application Development)Fast prototyping, user feedback, parallel teamsVery fast delivery, user-centricNeeds skilled team, limited scalabilitySmall-medium projects, fast delivery
IterativeDevelop subset of features, refine each iterationEarly partial delivery, accommodates changeMay not address architecture upfrontEvolving requirements
Agile (Scrum)Short sprints + empirical processFastest adaptation, continuous deliveryNeeds discipline, scope creep riskMost modern software products
📋 V-Model mnemonic: Left side (development): Requirements -> System Design -> Architecture -> Module Design -> Coding. Right side (testing): Unit Test -> Integration Test -> System Test -> Acceptance Test. Each left phase is verified by its paired right phase.
SRS SectionContent
IntroductionPurpose, scope, definitions, document conventions
Overall DescriptionProduct functions, user classes, constraints, assumptions
Functional RequirementsWHAT the system does. Use cases / user stories. Each: unique ID, description, priority, acceptance criteria.
Non-Functional RequirementsHOW WELL it does it. Performance (<200ms), Scalability (10K concurrent), Security (AES-256), Availability (99.9%)
External InterfacesUI wireframes, hardware interfaces, API contracts (external systems)
ConstraintsTechnology constraints (must use Java), budget, timeline, legal/regulatory
AppendicesGlossary, 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 TypeWhat it checksKey questions
TechnicalCan we build it with available technology and team skills?Do we have the required tech stack? Can we acquire the skills?
EconomicIs the cost justified by the benefit?ROI, cost-benefit analysis, NPV, development cost vs revenue
OperationalWill users and the organization actually use and support it?Will users adopt it? Does it fit existing workflows and processes?
LegalAre there legal or compliance issues?Data privacy (GDPR, PDPB), IP rights, licensing, accessibility laws
SchedulingCan 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 TypeWhat it checksWhoTools
Unit TestingIndividual function/class in isolation. Mock dependencies.DeveloperJUnit, TestNG, Mockito, pytest
Integration TestingHow modules interact when combined.Dev / QAPostman, REST Assured, JUnit
System TestingComplete end-to-end application against requirements.QASelenium, Katalon, Cypress
UAT (User Acceptance)Does it meet actual business needs? Real users.Client / end usersManual, exploratory
Regression TestingNew changes did not break existing features.QA / AutomatedSelenium, Cypress, JUnit suite
Smoke TestingBasic sanity after new build: "does it start?"QA / DevOpsManual or automated health check
Performance TestingSystem under load: response time, throughput.QA / DevOpsJMeter, k6, Gatling
Security TestingVulnerabilities: SQL injection, XSS, CSRF.Security QAOWASP ZAP, Burp Suite, Snyk
Exploratory TestingUnscripted investigation to find unexpected issues.QAManual, 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.

Questions 44–50

⚙ Agile & Scrum

⚡ Why Scrum Knowledge Is Non-Negotiable at Infosys

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:

  1. Individuals and interactions over processes and tools
  2. Working software over comprehensive documentation
  3. Customer collaboration over contract negotiation
  4. 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.

💡 Memorize all 4 values word-for-word. Being able to quote the manifesto precisely signals professional preparation. Interviewers notice when a candidate knows it exactly vs paraphrases loosely.
RoleResponsibilitiesWhat 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 TeamSelf-organizing, cross-functional (dev, QA, design). Decides HOW to do the work. Collectively responsible for Sprint Goal.DELIVERY — building the product increment each sprint
⚠ Scrum Master is NOT a project manager (no command authority). PO is NOT a business analyst (active, decision-making). Dev Team is NOT a resource pool (self-organizing, collectively responsible). The Dev Team decides HOW; the PO decides WHAT priority; the SM ensures the process works.
EventPurposeDuration (2-wk sprint)Who
SprintContainer event. Fixed time-box producing a Done increment.1-4 weeks (typically 2)All
Sprint PlanningSelect backlog items + create Sprint Goal + plan HOW to deliver.Max 4 hoursAll
Daily ScrumInspect Sprint Goal progress. Identify impediments. Plan next 24h.15 minutes dailyDev Team (SM/PO may attend)
Sprint ReviewInspect increment. Stakeholder feedback. Update backlog.Max 2 hoursAll + stakeholders
Sprint RetrospectiveInspect team PROCESS. Create actionable improvement plan.Max 1.5 hoursDev Team + SM (PO optional)
📋 Daily Scrum 3 questions: "What did I do yesterday toward Sprint Goal? What will I do today? Any impediments?" Keep to 15 minutes — detailed problem-solving discussions happen separately after standup in sub-groups.
ArtifactContentsOwned byChanges when
Product BacklogALL work to be done: user stories, bugs, tech debt, experiments. Ordered by value. Never "complete."Product OwnerPO reprioritizes anytime based on value, risk, learning
Sprint BacklogSelected PB items for current sprint + plan to deliver them + Sprint Goal.Development TeamTeam can adjust during sprint; PO cannot add new items mid-sprint
IncrementAll completed PB items from current + all previous sprints. Must meet Definition of Done. Potentially shippable.Development TeamAfter 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.

DimensionScrumKanban
IterationsFixed sprints (1-4 weeks)Continuous flow, no time-boxes
RolesPO, SM, Dev TeamNo prescribed roles
WIP LimitsImplicit (sprint capacity)Explicit WIP limits per column (the key discipline)
ChangeNo changes during sprintChange anytime (respecting WIP limits)
MetricsVelocity (story points/sprint)Lead time, cycle time, throughput
Best forProduct development, planned feature workOperations, support, maintenance, unpredictable incoming work
📋 Many teams use Scrumban — a hybrid taking sprint structure from Scrum with Kanban explicit WIP limits. Common in teams handling both planned features and unplanned support work simultaneously.
-- 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
  1. Set the stage: Check-in question. Create psychological safety (what happens in retro stays in retro).
  2. Gather data: What went well? What was painful? Concrete, specific observations.
  3. Generate insights: Why did problems occur? Root cause (5 Whys technique).
  4. Decide what to do: Select 1-3 improvement actions MAX. Specific, assigned to person, measurable.
  5. 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.

💡 The most effective retros have psychological safety: people feel safe raising problems without fear of blame. Blame-free, system-focused retrospectives find real improvement opportunities. Blame-focused ones cause defensiveness and silence. The SM creates this environment.
Questions 51–58

✅ Testing, CI/CD & DevOps

⚡ Why Testing and CI/CD Complete the SDLC Picture

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
💡 Popular CI/CD tools: Jenkins (self-hosted, most flexible), GitHub Actions (in GitHub, easy setup), GitLab CI (in GitLab), Azure DevOps (common at Infosys for enterprise clients), AWS CodePipeline. At Infosys: Jenkins + Azure DevOps are most common.
DevOps PracticeWhat it meansTools
Continuous IntegrationFrequent merges + automated build/testJenkins, GitHub Actions, GitLab CI
Continuous DeliveryAutomated, reliable releasesSpinnaker, AWS CodeDeploy, ArgoCD
Infrastructure as CodeManage servers with code, not manual stepsTerraform, CloudFormation, Ansible
ContainerizationPackage app + dependencies into portable containersDocker, containerd
Container OrchestrationManage many containers at scaleKubernetes, AWS ECS
Monitoring / ObservabilityMetrics, logs, traces for production visibilityPrometheus + Grafana, Datadog, ELK Stack
Secret ManagementSecure handling of API keys, passwords, certsHashiCorp 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
DimensionSeverityPriority
DefinitionImpact on system functionalityBusiness urgency to fix it
Who sets itQA team (technical judgment)Product Owner / Business
High sev, Low priSystem crashes only in rare admin edge caseCan wait for next sprint
Low sev, High priCompany name misspelled on public homepageFix today for brand reasons, even though no functional impact
P1-S1Production down for all usersFix immediately — drop everything
P4-S4Minor cosmetic issue in rarely-used admin screenBacklog 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 CharacteristicWhat it measuresExample metric
Functional SuitabilityDoes it do what it is supposed to?All use cases pass acceptance tests
Performance EfficiencyResponse time, resource usage under loadP95 API response < 200ms at 1000 concurrent users
CompatibilityWorks with other systems, browsers, OSTests pass on Chrome, Firefox, Safari, Edge
UsabilityHow easily can users achieve their goals?Task completion rate > 90% in user testing
ReliabilityWorks correctly for a specified period99.9% uptime, MTBF > 1000 hours
SecurityProtects data, prevents unauthorized access0 critical OWASP Top 10 vulnerabilities
MaintainabilityHow easily can it be modified?Code coverage > 80%, cyclomatic complexity < 10
PortabilityTransfer to another environmentRuns 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.

· · ·
Summary

🗀 Phase 6 Quick-Review Cheatsheet

Networks — 10 Things to Know Cold
1. OSI 7 layers (bottom-up): Physical, Data Link, Network, Transport, Session, Presentation, Application 2. TCP/IP 4 layers: Link, Internet, Transport, Application (maps to OSI 1-2, 3, 4, 5-7) 3. TCP: reliable, ordered, connection-oriented (3-way handshake). UDP: fast, connectionless, no guarantee. 4. HTTP methods: GET (safe+idempotent), POST (neither), PUT (idempotent), PATCH, DELETE (idempotent). 5. Status: 2xx=success, 3xx=redirect, 401=unauthorized, 403=forbidden, 404=not found, 5xx=server error. 6. DNS: recursive resolver -> root NS -> TLD NS -> authoritative NS -> returns IP. 7. TLS: DH key exchange -> shared session key. Certificate proves server identity via trusted CA. 8. CORS: browser enforces. Server allows via Access-Control-Allow-Origin header. 9. WebSocket: HTTP Upgrade -> persistent bidirectional TCP. 2-14 byte frames vs 800+ byte HTTP headers. 10. CDN: geographic cache. Reduces latency, absorbs DDoS, TLS at edge.
System Design — 10 Things to Know Cold
1. 5-step framework: Requirements -> Scale estimate -> High-level -> Deep dive -> Bottlenecks. 2. Horizontal scaling: stateless app servers. Vertical: DB first, then replicas, then sharding. 3. Load balancing: Round Robin, Least Connections, IP Hash. L4 (TCP) vs L7 (HTTP). 4. Caching: Cache-Aside most common. LRU eviction. Invalidate on write (delete, not update). 5. Sharding: Hash (even), Range (hot spots), Directory (flexible). Cross-shard JOINs are application-level. 6. Message queues: decouple, buffer, retry. Kafka=streaming+replay. RabbitMQ=task queues. 7. Rate limiting: Token Bucket (allows bursts). Redis INCR for distributed atomic counting. 8. Consistent hashing: only 1/N keys migrate when adding/removing a node (vs N-1/N with modulo). 9. Microservices: each owns its DB. Communicate via HTTP/gRPC/queue. Circuit breaker prevents cascades. 10. CAP: pick C or A during partition. CP=reject requests. AP=serve stale data.
SDLC & Agile — 10 Things to Know Cold
1. Waterfall: sequential, fixed. Agile: iterative, adaptive. Infosys uses both depending on client. 2. Agile Manifesto: Individuals, Working Software, Customer Collaboration, Responding to Change. 3. Scrum roles: PO (WHAT priority), SM (process health), Dev Team (HOW to build). 4. Scrum events: Sprint, Planning, Daily Scrum (15 min), Review, Retrospective. 5. Artifacts: Product Backlog (PO-owned), Sprint Backlog (team-owned), Increment (meets DoD). 6. User story: "As a [user], I want [goal] so that [reason]." AC must be testable. 7. Story points: relative effort. Fibonacci scale. Velocity = average points per sprint. 8. Testing pyramid: many unit -> moderate integration -> few E2E. Shift-left = test early. 9. CI/CD: commit -> build -> test -> quality -> artifact -> staging -> E2E -> production. 10. TDD: Red (failing test) -> Green (minimum code to pass) -> Refactor (improve, still passes).

🎉 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.

✓ Part 1 — The Human Side ✓ Phase 1 — DSA (35 Qs) ✓ Phase 2 — SQL (32 Qs) ✓ Phase 3 — OOPs (32 Qs) ✓ Phase 4 — DBMS (32 Qs) ✓ Phase 5 — OS (33 Qs) ✓ Phase 6 — Networks + SD + SDLC (58 Qs)