Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Computer Networks Module 7

IPv4 addressing, subnetting and NAT interview questions

Interview questions on IPv4 addressing, subnetting and NAT: warm-ups, then what each harder question tests and how a good answer starts.

12 questions: 4 warm-ups and 8 with model answers · Levels: Fresher to senior

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher

    What is the difference between a subnet mask and a prefix length?

    Answered in the lesson IPv4 addresses, masks and CIDR notation

  2. Fresher

    What is the block size of a /27, and what are the first three /27 subnets of 192.168.10.0/24?

    Answered in the lesson Subnetting step by step

  3. Fresher

    What is VLSM, and why are the largest subnets allocated first?

    Answered in the lesson VLSM and route summarisation

  4. Fresher

    What is the difference between basic NAT and NAPT?

    Answered in the lesson NAT, port translation and carrier-grade NAT

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Mid to senior

    An internal service fetches URLs for users and refuses any URL whose host text starts with "127.". A request for http://0x7f.1/admin still reaches a local admin page. Explain why, and how you would fix the check.

    What it tests
    Knowledge of lenient IPv4 parsing, and whether the fix checks the parsed and resolved address that is actually used rather than the text.
    First step
    Write down how each part of the service reads the host. The check compares text, but the HTTP client hands the host to a parser that accepts hexadecimal, octal and shortened forms. Work out which 32-bit address 0x7f.1 becomes under those rules.
    Follow-ups

    From the lesson IPv4 addresses, masks and CIDR notation

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Fresher to mid

    You are given 172.20.0.0/16 and must create at least 300 equal subnets, each with at least 100 usable hosts. Is it possible? Give the prefix, the number of subnets and hosts per subnet, and the network address of subnet 299, counting from 0.

    What it tests
    Turning two requirements into limits on the prefix length, checking that they meet, and locating a subnet by arithmetic across an octet boundary.
    First step
    Turn each requirement into a limit on the prefix: the number of borrowed bits that gives 300 subnets sets the shortest prefix allowed, and the number of host bits that gives 100 usable hosts sets the longest. Check whether a prefix exists between the two.
    Follow-ups

    From the lesson Subnetting step by step

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 2 minutes
  3. Fresher to mid

    A laptop is set to 192.168.10.77 with mask 255.255.255.224 and default gateway 192.168.10.1. It reaches the printers at .70 and .90 on the same switch, but nothing beyond them, not even the gateway. Find the fault and the fix.

    What it tests
    Working out a subnet from a dotted mask, and knowing that a host delivers directly only inside its own subnet, so its default gateway must be inside that subnet.
    First step
    Work out the laptop's own subnet from the mask: 224 in the fourth octet means blocks of 32, so find the block that contains 77. Then check whether the printers and the gateway fall inside that block.
    Follow-ups

    From the lesson Subnetting step by step

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Fresher to mid

    Plan 10.50.0.0/22 for a site with four LANs of 300, 120, 60 and 25 hosts and four point-to-point links between routers. Give each subnet's prefix and range, and say what space is left for growth.

    What it tests
    Sizing each subnet correctly, placing variable-length blocks on aligned boundaries without overlap, and describing the free space as CIDR blocks.
    First step
    Size each subnet first: hosts plus 2, rounded up to a power of two, and a /31 for each link. Add the sizes up to check that they fit in the 1,024 addresses of the /22, then place the blocks from the largest down.
    Follow-ups

    From the lesson VLSM and route summarisation

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  5. Mid to senior

    A branch router announces 10.8.0.0/21 to the core because its LANs are 10.8.1.0/24 to 10.8.4.0/24. Another site uses 10.8.6.0/24. What can go wrong, and what should the branch announce instead?

    What it tests
    Computing what a summary covers, reasoning with longest-prefix match and failures, and knowing the discard route and exact alternatives.
    First step
    Write down the range 10.8.0.0/21 covers and compare it with the four LANs the branch really has. Then follow a packet for the other site's network, first while its own route is present and then after that route disappears.
    Follow-ups

    From the lesson VLSM and route summarisation

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  6. Fresher to mid

    A customer forwarded port 8443 on their home router to a camera, but it cannot be reached from outside. The router's WAN address is 100.72.18.9. Diagnose the problem and list the ways to make the camera reachable.

    What it tests
    Recognising shared address space and carrier-grade NAT, explaining why an inbound connection never reaches the home router, and weighing the alternatives, including their security.
    First step
    Classify the WAN address before touching the port-forwarding rule: which block is 100.72.18.9 in, and who uses that block? Then compare it with the public address a website sees for the same connection.
    Follow-ups

    From the lesson NAT, port translation and carrier-grade NAT

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 4 minutes
  7. Mid to senior

    A mobile app keeps a UDP socket open to receive push messages. On some networks the messages stop arriving after about a minute of silence, while the app's TCP connections stay up for hours. Explain why, and design a fix.

    What it tests
    Knowing that NAT mappings expire on idle timers, which direction refreshes them, the different TCP and UDP rules, and designing keepalives with numbers.
    First step
    Follow the push message backwards: it arrives at a public address and port that exist only while a NAT keeps the phone's mapping. Ask what keeps that mapping alive, and what the phone sends during a minute of silence.
    Follow-ups

    From the lesson NAT, port translation and carrier-grade NAT

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All Computer Networks interview questions · The Computer Networks track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.