What is CIDR notation?
Why Interviewers Ask This
Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Networking basics — a prerequisite for any developer role.
Answer
CIDR (Classless Inter-Domain Routing) notation is a compact way to represent an IP address and its associated subnet mask. A slash followed by a number indicates how many bits are used for the network portion: 192.168.1.0/24 means 24 bits for network (leaving 8 bits for hosts = 256 addresses, 254 usable). Common CIDR values: /8 — 16.7M hosts (Class A range), /16 — 65,534 hosts (Class B range), /24 — 254 hosts (Class C range), /30 — 2 usable hosts (point-to-point links), /32 — single host. CIDR replaced the old classful (A/B/C) addressing system, allowing more efficient allocation of IP space by using variable-length subnet masks (VLSM) instead of fixed class boundaries.
Common Mistake
Many candidates answer correctly but can't explain the 'why'. Always be prepared to justify your answer with a concrete example or use case from your Networking experience.