Interview Q&A / Computer Networks

INTERVIEW Q&A · 55 QUESTIONS

Computer Networks interview questions

What happens when you open a website, TCP vs UDP, DNS and HTTP.

  1. What is an IP address, a subnet and CIDR notation like /24?

    An IPv4 address is a 32-bit number that identifies a device on a network. CIDR notation such as 192.168.1.0/24 says how many leading bits are the network part; the rest identify hosts. A /24 has 256 addresses (254 usable), a /16 has 65,536, and each extra bit halves the size of the subnet.

    IntermediateIn-depth4 min read
  2. Given 192.168.10.77/27, find the network address, broadcast address and host range.

    A /27 has blocks of 32 addresses. 77 falls in the block starting at 64, so network is 192.168.10.64, broadcast is 192.168.10.95, and usable hosts are .65 to .94 (30 hosts).

    BeginnerQuick answer1 min read
  3. How do you check whether two IP addresses are in the same subnet?

    Apply the subnet mask to both addresses (bitwise AND). If the network addresses match, they are in the same subnet and can talk directly. If not, traffic must go via the default gateway.

    BeginnerQuick answer1 min read
  4. How do you divide 192.168.1.0/24 into four equal subnets?

    Borrow 2 host bits (2^2 = 4 subnets) to get /26. The subnets are 192.168.1.0/26, .64/26, .128/26 and .192/26, each with 64 addresses and 62 usable hosts.

    BeginnerQuick answer1 min read
  5. How many usable hosts are in a /26 subnet, and what is the general formula?

    A /26 leaves 6 host bits, so 2^6 = 64 addresses, of which 62 are usable because the first is the network address and the last is the broadcast address. The formula is 2^(32 - prefix) minus 2.

    BeginnerQuick answer1 min read
  6. What is VLSM? Allocate subnets for 100, 50 and 20 hosts from 192.168.5.0/24.

    VLSM (variable length subnet masking) lets each subnet use the mask that fits its size instead of one size for all. Allocate largest first: /25 for 100 hosts, /26 for 50, /27 for 20, and a /30 for a router link.

    IntermediateQuick answer1 min read