Ravindra BagaleCourses & study guides

Chapter 2: The OSI Model and TCP/IP Model

Interview Questions

Q1. Name the seven OSI layers and the PDU at layers 2, 3 and 4.
Physical, Data Link, Network, Transport, Session, Presentation, Application. PDUs: frame (L2), packet (L3), segment/datagram (L4).
Q2. Explain the TCP three-way handshake.
Client sends SYN, server replies SYN-ACK, client sends ACK. After this the connection is established and data can flow with sequence numbers and acknowledgements.
Q3. What is the difference between TCP and UDP? Give an example of each.
TCP is connection-oriented and reliable (HTTP, SSH, MySQL). UDP is connectionless and faster with no delivery guarantee (DNS, VoIP, video streaming).
Q4. At which layer do an AWS Application Load Balancer and a Network Load Balancer operate?
ALB works at Layer 7 (routes by host/path/headers). NLB works at Layer 4 (TCP/UDP, ports).
Q5. What happens when you type a URL in the browser?
URL parsing → DNS resolution → TCP handshake → TLS handshake → HTTP request → server/app/database processing → HTTP response → browser renders HTML/CSS/JS.
Q6. What is encapsulation?
Each layer adds its own header (and Layer 2 also a trailer) around the data from the layer above before passing it down; the receiver removes them in reverse order (decapsulation).