Computer Networks
6 must-know theory questions with interview-ready answers
Fresher Interview Prep Series | Prepared for Devansh
Q1. Explain the OSI Model (7 layers)
# Layer Job Examples
7 Application User-facing protocols HTTP, DNS, SMTP,
FTP
6 Presentation Format: encryption, SSL/TLS, JPEG
compression
5 Session Open/close/manage Login sessions, RPC
sessions
4 Transport End-to-end delivery, TCP, UDP
ports
3 Network Routing between IP, routers
networks
2 Data Link Node-to-node frames, Ethernet, switches
MAC
1 Physical Bits on the wire Cables, Wi-Fi radio
HOW TO SAY IT IN THE INTERVIEW
OSI is the 7-layer theoretical model; TCP/IP is the practical 4-layer one. In interviews, most questions live
at layers 7, 4 and 3 — HTTP on top of TCP on top of IP. Mnemonic: All People Seem To Need Data
Processing (top-down).
Q2. TCP vs UDP
Aspect TCP UDP
Reliability Guaranteed, ordered, Fire-and-forget
retransmits
Connection 3-way handshake (SYN, Connectionless
SYN-ACK, ACK)
Speed Slower (overhead) Faster
Extras Flow control, congestion control None
Used by HTTP(S), email, file transfer DNS, video streaming, gaming,
VoIP
HOW TO SAY IT IN THE INTERVIEW
TCP when correctness matters — a half-downloaded file is useless. UDP when speed matters and losing
a packet is fine — a dropped video frame is invisible, a re-sent one arrives too late anyway.
Q3. How does HTTPS / SSL-TLS work?
HOW TO SAY IT IN THE INTERVIEW
HTTPS is HTTP over a TLS-encrypted channel. Simplified handshake: client hello → server sends its
certificate (signed by a trusted CA) → client verifies it → both sides agree keys (asymmetric crypto for the
handshake) → all further traffic uses fast symmetric encryption.
• Confidentiality — nobody in the middle can read the data.
• Integrity — tampering is detected.
• Authentication — the certificate proves you are talking to the real server.
Q4. What is DNS and how does a lookup work?
HOW TO SAY IT IN THE INTERVIEW
DNS maps domain names to IP addresses. Lookup: browser cache → OS cache → ISP resolver → root
server (points to .com) → TLD server (points to [Link]'s nameserver) → authoritative nameserver
returns the IP. The resolver caches it per the record's TTL, so repeat lookups are instant.
Record Maps
A / AAAA Domain to IPv4 / IPv6
CNAME Alias to another domain
MX Mail server for the domain
TXT Free text (domain verification, SPF)
Q5. Forward Proxy vs Reverse Proxy
HOW TO SAY IT IN THE INTERVIEW
A forward proxy sits in front of clients and hides them: Client → Proxy → Internet. Used for corporate
filtering, VPNs, anonymity. A reverse proxy sits in front of servers and hides them: Client → Reverse
Proxy → [servers]. Used for load balancing, TLS termination, caching, DDoS protection — Nginx and
Cloudflare are the classic examples. One sentence version: forward proxy represents the client, reverse
proxy represents the server.
Q6. What is REST? REST vs SOAP
HOW TO SAY IT IN THE INTERVIEW
REST is an architectural style over HTTP: resources identified by URLs, manipulated with standard verbs,
and stateless — each request carries everything the server needs.
GET /api/users/123 -> fetch user 123
POST /api/users -> create a user
PUT /api/users/123 -> replace user 123
PATCH /api/users/123 -> partial update
DELETE /api/users/123 -> delete
• Know status codes: 200 OK, 201 Created, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404
Not Found, 429 Too Many Requests, 500 Server Error.
• SOAP: XML-based, heavyweight, strict contracts (WSDL), built-in security standards — still used in
banking/enterprise.
• Modern default: REST (or gRPC internally) for APIs; SOAP for legacy enterprise integrations.