What is the difference between a private and public IP address?
Why Interviewers Ask This
This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex Networking topics. It also reveals how well you can explain technical ideas to non-experts.
Answer
Public IP addresses are globally routable addresses assigned by Internet Service Providers (ISPs), unique across the entire Internet. Any device with a public IP can be directly reached from anywhere on the Internet. Private IP addresses are reserved ranges used inside local networks (LANs) that are not routed on the Internet. RFC 1918 defines three private ranges: 10.0.0.0/8 (10.0.0.0 – 10.255.255.255, ~16.7M addresses), 172.16.0.0/12 (172.16.0.0 – 172.31.255.255, ~1M addresses), 192.168.0.0/16 (192.168.0.0 – 192.168.255.255, 65,534 addresses). Devices with private IPs access the Internet through NAT on the router, which translates their private address to the router's public IP. Other special addresses: 127.0.0.1 (loopback/localhost), 169.254.x.x (APIPA — assigned when DHCP fails).
Common Mistake
Rushing to answer is a common mistake. Take two seconds to structure your response: definition → example → trade-off. This structure makes complex Networking answers easy to follow.