Understanding computer networks is crucial for technical interviews, especially for roles like network engineer, DevOps specialist, or software developer. This guide breaks down essential concepts in simple terms, focusing on practical knowledge interviewers expect candidates to know.
1. The OSI Model Simplified
The Open Systems Interconnection (OSI) model defines seven layers of network communication:
- Physical Layer: Deals with hardware (e.g., cables, routers).
- Data Link Layer: Manages MAC addresses and local network communication.
- Network Layer: Handles IP addressing and routing (e.g., routers).
- Transport Layer: Ensures data delivery (TCP/UDP).
- Session Layer: Manages connections between devices.
- Presentation Layer: Translates data formats (e.g., encryption).
- Application Layer: User-facing protocols (HTTP, FTP).
Interview Tip: Memorize the layers using mnemonics like "Please Do Not Throw Sausage Pizza Away."
2. TCP vs. UDP: Key Differences
-
TCP (Transmission Control Protocol):
-
Connection-oriented (establishes a handshake).
-
Reliable (retransmits lost packets).
-
Used for emails, web browsing.
-
UDP (User Datagram Protocol):
-
Connectionless.
-
Faster but unreliable.
-
Used for streaming, gaming.
Common Question: "Why does DNS use UDP but sometimes switch to TCP?" Answer: UDP is faster for small queries, but TCP is needed for large responses.
3. IP Addresses and Subnetting
- IPv4 vs. IPv6: IPv4 uses 32-bit addresses (e.g., 192.168.1.1), while IPv6 uses 128-bit hexadecimal addresses.
- Subnetting: Dividing networks into smaller parts. For example, 192.168.1.0/24 allows 254 devices.
Practice Task: Calculate subnets for 192.168.2.0 with a /26 mask.
4. HTTP vs. HTTPS
- HTTP: Unencrypted, uses port 80.
- HTTPS: Encrypted via SSL/TLS, uses port 443.
- Why HTTPS Matters: Protects data from eavesdropping (e.g., passwords, credit cards).
5. DNS: The Phonebook of the Internet
- Translates domain names (e.g., google.com) to IP addresses.
- DNS Lookup Process:
- Check local cache.
- Query recursive resolver.
- Root server → TLD server → Authoritative server.
Interview Question: "What happens when you type a URL in a browser?"
6. Common Network Devices
- Router: Connects different networks (e.g., LAN to WAN).
- Switch: Connects devices within a LAN using MAC addresses.
- Firewall: Filters traffic based on security rules.
7. Three-Way Handshake (TCP Connection)
- SYN: Client sends a synchronization request.
- SYN-ACK: Server acknowledges and responds.
- ACK: Client confirms the connection.
Why It's Important: Ensures reliable communication.
8. Network Security Basics
- VPN: Encrypts internet traffic.
- Firewalls: Block unauthorized access.
- DDoS Attacks: Overwhelm servers with traffic.
9. Top Interview Questions
- "Explain DHCP."
- "What's a MAC address?"
- "How does ARP work?"
- "Describe NAT."
10. Final Tips
- Hands-On Practice: Use tools like Wireshark or Ping.
- Stay Updated: Learn about cloud networking (AWS, Azure).
- Think Aloud: Explain your reasoning during interviews.
Mastering these fundamentals will boost confidence in networking interviews. Focus on clear explanations and real-world examples to stand out.