Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Top 10 High-Frequency Questions
CN

Top 10 High-Frequency Questions

Practice 10 of the most frequently asked Computer Networks concepts and questions for technical interviews and placements.

1. Which layer of the OSI model handles physical addressing, node-to-node data transfer, and operates using MAC addresses and switches?

That’s the Data Link Layer (Layer 2).

Its job is node-to-node (device-to-device) delivery on the same local network. It frames the data, handles error detection, and uses physical addressing — the MAC address burned into each network interface.

OSI Model
────────────────────────────
Layer 7  Application
Layer 6  Presentation
Layer 5  Session
Layer 4  Transport
Layer 3  Network       → IP
Layer 2  Data Link     → MAC  ← HERE
Layer 1  Physical      → Bits
────────────────────────────

Why switches belong here: a switch is a Layer 2 device. It reads MAC addresses and forwards frames to the specific port where the destination device lives, rather than broadcasting everywhere.

PC A                    SWITCH                    PC B
MAC: AA:AA        ┌────────────────┐        MAC: BB:BB
      ───────────→ │  MAC Table    │ ───────────→
                   │                │
                   │ AA → Port 1    │
                   │ BB → Port 2    │
                   └────────────────┘
LayerNameAddress type
3NetworkIP
2Data LinkMAC
1PhysicalNone (bits)

2. What is the primary operational difference between a Layer 2 Switch and a Layer 1 Hub?

The difference is intelligence.

  • Hub (Layer 1) — blindly broadcasts incoming data to every port. No understanding of addresses, just electrical signal repetition.
  • Switch (Layer 2) — learns which MAC address lives on which port, builds a MAC address table, and forwards frames only to the intended destination.
HUB
──────────────

             HUB

      ┌───────┼───────┐
      ↓       ↓       ↓
     PC A    PC B    PC C

If A sends to B:

     PC A


      HUB
     /   \
    ↓     ↓
   PC B  PC C

Both B and C receive the signal.
SWITCH
──────────────

             SWITCH
          ┌────┼────┐
          ↓    ↓    ↓
         PC A PC B  PC C

If A sends to B:

     PC A


     SWITCH


     PC B

Only the required port receives the frame.

The consequences:

  • A hub creates one big collision domain — traffic from every port can collide.
  • A switch creates a separate collision domain per port and keeps traffic isolated.

Example: if 4 devices on a hub talk, all hear everything. On a switch, only the target device receives its frames.


3. Which transmission protocol should be selected for an application where speed and minimal overhead are critical, and occasional data loss is acceptable?

UDP (User Datagram Protocol).

UDP is a connectionless, best-effort protocol. It has almost no overhead:

  • No connection setup (no handshake).
  • No acknowledgments.
  • No retransmission of lost packets.
  • No ordering guarantees.
TCP

Client                         Server
  │                              │
  │──────── SYN ────────────────→│
  │←────── SYN-ACK ──────────────│
  │──────── ACK ────────────────→│
  │                              │
  │──────── DATA ───────────────→│
  │←──────── ACK ────────────────│
  │                              │
  │   Lost packet?               │
  │←──── retransmission ─────────│
UDP

Client                         Server
  │                              │
  │──────── DATA ───────────────→│
  │──────── DATA ───────────────→│
  │──────── DATA ───────────────→│
  │                              │

No handshake
No ACK
No retransmission

That’s exactly what you want when speed beats reliability — video streaming, live gaming, VoIP, DNS lookups. A dropped frame in a video call is a blip; the next frame arrives anyway.

Compare with TCP: reliable and ordered, but it pays for that with handshakes, acks, and retransmissions — latency and overhead.


4. During a TCP Three-Way Handshake, what is the second packet sent to establish the connection?

The second packet is SYN-ACK.

The full sequence:

Client                              Server
  │                                   │
  │────────── SYN ──────────────────→│
  │       "I want to connect"         │
  │                                   │
  │←──────── SYN + ACK ──────────────│
  │       "I agree + acknowledge"     │
  │                                   │
  │────────── ACK ──────────────────→│
  │       "Confirmed"                 │
  │                                   │
  │        CONNECTION ESTABLISHED     │

So:

1. SYN

2. SYN-ACK   ← Answer

3. ACK

Connection established

After the third step, both directions are synchronized and data can flow.


5. Which of the following is a key advantage of IPv6 over IPv4?

The big one is the 128-bit address space — a virtually infinite pool that removes the need for NAT.

IPv4
────
32 bits

~4.3 billion addresses
IPv6
────
128 bits

~3.4 × 10³⁸ addresses

Massive address space

Why it matters:

  • IPv4 — 32-bit addresses (~4.3 billion). We ran out, which is why NAT exists to share one public IP among many devices.
  • IPv6 — 128-bit addresses. Every device can have its own globally unique address, so NAT becomes unnecessary.
IPv4 Network

             Internet

          Public IPv4

                NAT

       ┌─────────┼─────────┐
       ↓         ↓         ↓
     PC 1       PC 2     Phone
 192.168.1.2 192.168.1.3 192.168.1.4

Bonus advantages:

  • Built-in IPSec — security integrated by design.
  • SLAAC — stateless address autoconfiguration; devices can assign their own addresses without a DHCP server.

6. What is the primary role of the Domain Name System (DNS) on the Internet?

DNS is the phonebook of the internet — it translates human-readable names like google.com into the numeric IP addresses computers actually use.

You type:

google.com


   DNS


142.250.72.14


Browser connects to server

Without DNS:

You

 └── "google.com"


       Computer

          └── "I need an IP address!"

With DNS:

Browser

   │ "What is google.com?"

DNS Resolver


DNS Server


142.250.72.14


Browser connects

How it works: your device asks a resolver, which queries a hierarchy of DNS servers:

Client


DNS Resolver


Root DNS


TLD DNS (.com)


Authoritative DNS


IP Address

Each returns the answer or points to the next server that knows it. Results are cached to keep it fast.


7. How does a Virtual Private Network (VPN) protect user data over a public network?

A VPN uses two techniques together: tunneling and encryption.

  1. Tunneling — your data packet is wrapped (encapsulated) inside another packet addressed to the VPN server. This creates a tunnel between your device and the VPN server.
  2. Encryption — the encapsulated data is scrambled with strong cryptographic protocols, so even if it’s intercepted, it’s unreadable.
Your Device

     │  Original data

  Encrypt


┌──────────────────────────┐
│      VPN Tunnel           │
│   🔒 Encrypted Traffic    │
└──────────────────────────┘


Public Internet


 VPN Server


Decrypt + Unwrap


Destination

To an outside observer, they see encrypted traffic to a VPN endpoint — not your actual activity. That’s how a VPN protects data on public Wi-Fi and hides traffic from the ISP.


8. What makes HTTPS secure compared to standard HTTP traffic?

HTTPS encrypts the data with SSL/TLS, while HTTP sends everything as plain text.

  • HTTP — transmits data in clear text over port 80. Anyone on the path (or network) can read it.
  • HTTPS — wraps the traffic in an SSL/TLS cryptographic layer over port 443. Data is unreadable to snoopers.
HTTP
────

Client

  │ login=alice&password=123

Internet


Server

Data travels in plain text.
HTTPS
─────

Client

  │ 🔒 TLS Encryption

[ 9F2A...Encrypted Data... ]


Internet


Server


Decrypt

What TLS provides:

                 TLS

        ┌─────────┼─────────┐
        ↓         ↓         ↓
Confidentiality Integrity Authentication
        │         │         │
      Secret    Detects    Verifies
      data      tampering  real server
  • Confidentiality — encryption keeps content secret.
  • Integrity — tampering is detected.
  • Authentication — the site’s certificate proves you’re talking to the real server.
HTTP:   [login: alice, password: hunter2]

        Visible as plain text

HTTPS:  [0x9F2A...encrypted blob...]

        Unreadable to snoopers

9. What is the functional purpose of a Subnet Mask in network configuration?

A subnet mask splits an IP address into a Network ID and a Host ID.

IP:         192.168.10.45
Mask:       255.255.255.0

            Network       Host
            <-------->    <->
IP:         192.168.10    .45
Mask:       255.255.255   .0

Therefore:

Network ID: 192.168.10.0
Host ID:              45

With /24:

IP:   192.168.10.45
      └──────┬──────┘
       Network  Host
       24 bits 8 bits

In binary:

Subnet Mask:

11111111.11111111.11111111.00000000
<--------- Network --------><-Host->
             24 bits          8 bits

Why it matters:

  • Routers use the Network ID to decide where to send traffic — same network = deliver locally, different network = route elsewhere.
  • It defines how big a subnet is (how many hosts fit).

Example: with 255.255.255.0, the first 24 bits are the network and the last 8 bits identify the host.

2⁸ = 256 total addresses

256
 ├── 1 Network address
 ├── 1 Broadcast address
 └── 254 Usable host addresses

So up to 254 usable host addresses are available in that subnet.


10. What is the primary purpose of an IP address in computer networking?

An IP address identifies and locates a device on a network so it can communicate.

Sender

  │ Destination IP:
  │ 192.168.1.50

Router


Device
IP: 192.168.1.50

Two roles:

  • Identification — identifies the destination device/interface.
  • Locating — the address helps routers determine where the device is and deliver data to it.

Like a mailing address: it tells the network where the destination is so the packet can be delivered.

              IP Address

          ┌────────┴────────┐
          ↓                 ↓
   Identification        Location
          │                 │
   "Which device?"    "Which network?"

An IP address is logical — unlike the MAC address, it can change and is managed by the network layer.

MAC Address

Layer 2

Local network delivery

"Which network interface?"

        vs.

IP Address

Layer 3

Routing between networks

"Which network/location?"

Example:

             Router
           /         \
          /           \
   Network A         Network B
       │                 │
       ↓                 ↓
      PC A              PC B

   MAC → local delivery
   IP  → routing between networks

My Private Notes

Notes are auto-saved locally to this device.