Networking Interview Prep
Networking Fundamentals

Network Types

From Your Pocket to the Entire Planet

LinkedIn Hook

Most developers can build a REST API, deploy it to the cloud, and handle 10,000 requests a second.

But ask them: "What is the difference between a LAN and a WAN?" — and you get silence.

That gap costs you in system design interviews. Because when you design a distributed system, latency decisions, architecture choices, and failure modes ALL depend on knowing which network type you're operating on.

Here is what no one tells you about LAN, WAN, MAN, and PAN:

  • Your localhost API call travels 0 km. Your production API might travel 12,000 km. The latency difference is 100x.
  • "Local network" does NOT mean "safe network." Misconfigured LANs are how internal breaches happen.
  • Your Bluetooth headphones are a network. A tiny, personal one — but still a network.

Lesson 1.2 of the Networking Interview Prep series breaks down all four network types with real examples, a comparison table, and the exact questions interviewers ask.

Read the full lesson → [link]

#Networking #SystemDesign #InterviewPrep #BackendDevelopment #SoftwareEngineering


Network Types thumbnail


What You'll Learn

  • The definition, range, speed, and real-world examples of PAN, LAN, MAN, and WAN
  • Why the distinction matters for backend developers making latency and architecture decisions
  • The most common mistakes engineers make when reasoning about local vs. remote networks
  • How to answer network type questions confidently in technical interviews

Scaling From Your Pocket to the Planet

Imagine you are standing in the middle of a city.

Right around your body — maybe 10 meters — you have your phone, your smartwatch, your wireless earbuds. They all talk to each other. That is your Personal Area Network (PAN).

Step into the building behind you — an office or your home. Every device connected to the Wi-Fi router shares a Local Area Network (LAN). Your laptop, the printer, the smart TV, your colleague's machine — all on the same LAN.

Now zoom out to the entire city. The hospital's network needs to talk to the city health department. The university campus needs to link three buildings across town. That city-wide infrastructure is a Metropolitan Area Network (MAN).

Zoom out one final time — to the entire globe. When you call an API in Singapore from your laptop in Dhaka, you are crossing a Wide Area Network (WAN). The internet itself is the largest WAN ever built.

Same concept. Different scale. Each one has distinct implications for latency, bandwidth, failure modes, and security — all of which matter deeply to you as a developer.


PAN — Personal Area Network

Definition: A network that connects devices within an individual's immediate personal space, typically within a range of 1–10 meters.

Range: Up to ~10 meters

Typical Speed: 1 Mbps to 3 Mbps (Bluetooth Classic); up to 480 Mbps (USB)

Technologies: Bluetooth, USB, Zigbee, Infrared (IrDA), NFC

Real-World Examples:

  • Your phone syncing data to your smartwatch over Bluetooth
  • Wireless earbuds receiving audio from your laptop
  • A stylus communicating with a drawing tablet
  • Contactless card payment via NFC at a payment terminal

Developer Relevance: PANs are the foundation of IoT device communication. If you are building mobile apps that communicate with wearables or peripheral hardware, you are working at the PAN layer. Bluetooth Low Energy (BLE) APIs, NFC intents in Android, and Core Bluetooth in iOS all operate at this layer.


LAN — Local Area Network

Definition: A network that connects devices within a limited geographic area such as a home, office floor, school, or building — all sharing the same router or switch.

Range: Up to ~100 meters (typical Wi-Fi indoors); up to 100 meters per Ethernet segment, extendable via switches

Typical Speed: 100 Mbps to 10 Gbps (Ethernet); 54 Mbps to 9.6 Gbps (Wi-Fi depending on standard)

Technologies: Ethernet (IEEE 802.3), Wi-Fi (IEEE 802.11 a/b/g/n/ac/ax)

Real-World Examples:

  • All devices in your home connected to your Wi-Fi router
  • An office where 50 computers share the same switch and internet connection
  • A university computer lab networked together for resource sharing
  • A home server accessible from every device on the local network

Developer Relevance: LAN is where most backend development "feels" fast. When you run localhost or connect to 192.168.x.x, you are on a LAN. Docker containers communicating within a single machine, database servers on the same local network as your app server, development environments — all LAN territory. LAN latency is typically under 1 millisecond. This is why microservices within a data center behave very differently from distributed services across the internet.


MAN — Metropolitan Area Network

Definition: A network that spans a city or a large campus — larger than a LAN but smaller than a WAN. Often used by ISPs, city governments, or large universities to connect multiple buildings or branches across a metropolitan area.

Range: 5 km to 50 km

Typical Speed: 10 Mbps to 10 Gbps (fiber backbone common)

Technologies: Fiber optic cables, WiMAX (IEEE 802.16), SONET, Ethernet over fiber

Real-World Examples:

  • A city's traffic light management system connected across all intersections
  • A bank linking its city branches through a private fiber network
  • A university connecting multiple campuses across a city (main campus, medical campus, research park)
  • A cable TV company's infrastructure serving a metropolitan area

Developer Relevance: MANs are less visible in day-to-day development but critical in infrastructure engineering. If you are at a company with multiple offices in the same city connected privately (not over the public internet), you are likely on or adjacent to a MAN. Latency here is typically 5–20 milliseconds, noticeably higher than LAN but far lower than transcontinental WAN connections.


WAN — Wide Area Network

Definition: A network that spans large geographic areas — countries, continents, or the entire globe. WANs connect multiple LANs and MANs together. The internet is the most prominent WAN.

Range: Hundreds to thousands of kilometers; effectively unlimited (global)

Typical Speed: Highly variable — from a few Mbps (consumer broadband) to Tbps (fiber optic backbone links between continents)

Technologies: Fiber optic submarine cables, MPLS (Multiprotocol Label Switching), satellite links, leased lines, 4G/5G cellular networks

Real-World Examples:

  • The internet — connecting every networked device on Earth
  • A multinational company's private network linking offices in New York, London, and Tokyo
  • A bank's SWIFT network for international fund transfers
  • Satellite internet (Starlink) connecting remote rural areas to the global internet

Developer Relevance: Every time your app makes an API call to an external service, sends an email via SMTP, or fetches data from a CDN, you are crossing a WAN. WAN latency can range from 20 ms (nearby region) to 300+ ms (opposite side of the globe). This is why you choose AWS regions close to your users. It is why you use CDNs. It is why you cache aggressively. Understanding WAN behavior is fundamental to designing resilient, low-latency production systems.


Code Example — Latency Simulation: LAN vs WAN in Node.js

This example simulates the practical latency difference a developer experiences when calling a local service (LAN) versus a remote external API (WAN). It also shows how to build a simple latency-aware request wrapper.

// network-types-demo.js
// Demonstrates how network type affects API response times
// and how to build latency-aware request logic

const http = require('http');
const https = require('https');

// ─────────────────────────────────────────────
// Simulated Latency Constants (realistic values)
// ─────────────────────────────────────────────
const LATENCY = {
  PAN: 2,    // Bluetooth/NFC: ~1–5 ms
  LAN: 1,    // Same local network: <1 ms (shown as 1 ms floor)
  MAN: 15,   // City-wide fiber: ~5–20 ms
  WAN: 120,  // Intercontinental: ~80–300 ms
};

// ─────────────────────────────────────────────
// Utility: simulate a network call with delay
// ─────────────────────────────────────────────
function simulateNetworkCall(networkType, endpoint, dataSize = '1KB') {
  return new Promise((resolve) => {
    const latency = LATENCY[networkType];
    const jitter = Math.floor(Math.random() * (latency * 0.2)); // 20% jitter

    setTimeout(() => {
      resolve({
        networkType,
        endpoint,
        dataSize,
        latency: latency + jitter,
        timestamp: new Date().toISOString(),
      });
    }, latency + jitter);
  });
}

// ─────────────────────────────────────────────
// Example: calling the same endpoint over
// different network types
// ─────────────────────────────────────────────
async function compareNetworkLatency() {
  console.log('=== Network Type Latency Comparison ===\n');

  const scenarios = [
    { type: 'LAN',  endpoint: 'http://192.168.1.10:3000/api/users' },
    { type: 'MAN',  endpoint: 'http://10.50.0.5:3000/api/users'    },
    { type: 'WAN',  endpoint: 'https://api.example.com/api/users'   },
  ];

  for (const scenario of scenarios) {
    const result = await simulateNetworkCall(scenario.type, scenario.endpoint);
    console.log(`[${result.networkType}] ${result.endpoint}`);
    console.log(`  → Simulated latency: ${result.latency} ms`);
    console.log(`  → Timestamp: ${result.timestamp}`);
    console.log('');
  }
}

// ─────────────────────────────────────────────
// Real-world pattern: timeout strategy based
// on expected network type
// ─────────────────────────────────────────────
function createApiClient(networkType) {
  const timeouts = {
    PAN: 500,   // Bluetooth: fail fast
    LAN: 2000,  // Local network: short timeout is fine
    MAN: 5000,  // City-scale: give a bit more room
    WAN: 15000, // Internet: expect variability
  };

  const timeout = timeouts[networkType] || 10000;

  return {
    networkType,
    timeout,
    fetch: (url) => {
      console.log(`[${networkType}] Fetching: ${url}`);
      console.log(`[${networkType}] Timeout set to: ${timeout}ms`);
      // In real code: use AbortController with fetch(), or axios timeout option
      // return fetch(url, { signal: AbortSignal.timeout(timeout) });
    },
  };
}

// ─────────────────────────────────────────────
// Run the demo
// ─────────────────────────────────────────────
compareNetworkLatency().then(() => {
  console.log('=== API Client Timeout Strategy by Network Type ===\n');

  ['LAN', 'MAN', 'WAN'].forEach((type) => {
    const client = createApiClient(type);
    client.fetch(`https://api.myapp.com/data`);
    console.log('');
  });
});

Sample Output:

=== Network Type Latency Comparison ===

[LAN] http://192.168.1.10:3000/api/users
  → Simulated latency: 1 ms
  → Timestamp: 2026-04-21T10:00:00.001Z

[MAN] http://10.50.0.5:3000/api/users
  → Simulated latency: 17 ms
  → Timestamp: 2026-04-21T10:00:00.018Z

[WAN] https://api.example.com/api/users
  → Simulated latency: 134 ms
  → Timestamp: 2026-04-21T10:00:00.152Z

=== API Client Timeout Strategy by Network Type ===

[LAN] Fetching: https://api.myapp.com/data
[LAN] Timeout set to: 2000ms

[MAN] Fetching: https://api.myapp.com/data
[MAN] Timeout set to: 5000ms

[WAN] Fetching: https://api.myapp.com/data
[WAN] Timeout set to: 15000ms

Key takeaway: A 2-second timeout is perfectly reasonable for a LAN service call. The same timeout would cause frequent false failures on a WAN call. Knowing your network type directly informs your timeout, retry, and circuit breaker configuration.

Network Types visual 1


Common Mistakes

  • Confusing a private LAN IP address with a public IP address. When your app binds to 192.168.1.100 or 10.0.0.5, that address is only reachable within your local network. Devices on the internet cannot reach it without port forwarding or a VPN tunnel. Developers debugging "why can't my friend access this?" often miss this entirely — they share their LAN IP and wonder why it does not work from outside.

  • Assuming "local network" means low latency automatically. A poorly configured LAN with outdated switches, heavy broadcast traffic, or a saturated access point can produce latency of 50–200 ms — worse than some WAN connections. Network type defines topology and scale, not guaranteed performance. Always measure; never assume.

  • Treating WAN calls the same as LAN calls in code. Many developers write code that works perfectly in development (LAN/localhost) but fails in production under real WAN conditions because they set no timeouts, have no retry logic, and never account for packet loss or high latency. The network type dictates the defensive programming patterns you need to apply.


Interview Questions

Q1: What is the difference between a LAN and a WAN?

A LAN (Local Area Network) connects devices within a limited area such as a home, office, or building. Communication happens over short distances with high speed and low latency, typically under 1 ms. A WAN (Wide Area Network) spans large geographic areas — cities, countries, or the globe — connecting multiple LANs together. The internet is the largest WAN. WAN connections have higher latency (tens to hundreds of milliseconds) and are subject to more variability, packet loss, and security risks than LAN connections.

Q2: If a developer's app runs fine locally but fails when deployed, what network-related factors might be responsible?

Several network-type-related factors could cause this: (1) The app may be making calls with timeouts appropriate for LAN but too short for WAN. (2) The app may rely on a service reachable by LAN IP in development but requires a public DNS hostname in production. (3) Firewall rules that are permissive on a local network may be restrictive in a cloud environment. (4) Packet loss and jitter on WAN connections may expose race conditions or missing retry logic not visible on low-latency LAN connections.

Q3: What is a MAN, and when would a company use one instead of relying on the public internet?

A MAN (Metropolitan Area Network) is a network that covers a city or large campus area, ranging from 5 to 50 km. A company would use a private MAN when it needs to connect multiple offices or campuses within a city with high bandwidth, low latency, and without routing traffic over the public internet. This reduces security exposure, provides consistent performance, and avoids the variability of public WAN connections. Banks, hospitals, and universities with multiple city locations are common MAN users.

Q4: How does knowing about PANs help a developer building mobile or IoT applications?

PAN technologies like Bluetooth and NFC are the communication layer for wearables, IoT sensors, and proximity-based interactions. A developer building an app that pairs with a fitness tracker, reads an NFC tag, or controls a smart home device is working at the PAN layer. Understanding PAN characteristics — short range, relatively low bandwidth, power efficiency as a constraint — informs API design, polling frequency, data payload sizes, and connection management strategies specific to Bluetooth or NFC stacks.

Q5: Why do cloud providers like AWS offer multiple geographic regions, and how does this relate to WAN?

Cloud providers offer multiple regions because WAN latency is proportional to physical distance. Light traveling through fiber optic cables takes roughly 5 ms per 1,000 km. A user in Tokyo making a request to a server in Ireland will experience 200+ ms of round-trip latency just from physical distance. By placing compute resources in regions close to end users, providers minimize WAN traversal distance and reduce latency. This is also why CDNs exist — to serve static content from a LAN-adjacent edge node rather than a distant origin WAN server.


Quick Reference — Cheat Sheet

Network TypeFull NameRangeTypical SpeedTechnologiesCommon Examples
PANPersonal Area Network1 – 10 m1 – 480 MbpsBluetooth, NFC, USB, ZigbeeSmartwatch, wireless earbuds, NFC payments
LANLocal Area NetworkUp to ~100 m100 Mbps – 10 GbpsEthernet (802.3), Wi-Fi (802.11)Home Wi-Fi, office network, localhost dev environment
MANMetropolitan Area Network5 – 50 km10 Mbps – 10 GbpsFiber, WiMAX, SONETCity-wide ISP infrastructure, university campuses, bank branches
WANWide Area Network100 km – globalKbps – TbpsFiber submarine cables, MPLS, satellite, 4G/5GThe internet, corporate global VPNs, international SWIFT network
Network TypeTypical LatencyWho Manages ItSecurity Exposure
PAN1 – 5 msEnd userLow (short range, device pairing)
LAN< 1 msHome user / IT teamMedium (internal threats possible)
MAN5 – 20 msISP / organizationMedium-High (shared city infrastructure)
WAN20 – 300+ msISPs, telcos, cloud providersHigh (public internet exposure)

Previous: Lesson 1.1 — What is a Network? Next: Lesson 1.3 — IP Address vs MAC Address


This is Lesson 1.2 of the Networking Interview Prep Course — 8 chapters, 32 lessons.

On this page