Networking Interview Questions: 22 Answers on OSI, Subnetting & BGP

22 networking interview questions with sample answers: OSI vs TCP/IP, the TCP handshake, DNS, DHCP DORA, a worked /26 subnet, STP, OSPF vs BGP, NAT and TLS.

By OphyAI Team • • Updated November 16, 2026 • 4835 words

Last updated: November 2026

Quick Answer

Networking interviewers test whether you can follow a packet end to end: which layer a problem lives in, how TCP, DNS, DHCP and ARP get a host talking, whether you can subnet in your head, how switches and routers pick a path (STP, OSPF, BGP), and how you troubleshoot calmly when “the network is down”. Rehearse the spoken answers in OphyAI Interview Practice, use Interview Copilot on the live technical screen, and use Coding Copilot for a hands-on scripting or automation round. Expect concept questions, a subnetting exercise and a troubleshooting scenario.

This page covers computer networking for network engineer, network administrator, NOC, IT support and cloud roles, not professional networking.

#QuestionWhat it tests
1OSI vs TCP/IP modelLayered thinking
2TCP vs UDPTransport trade-offs
3The TCP three-way handshakeConnection setup and teardown
4How DNS resolution worksRecursive vs iterative lookups
5DHCP and DORAHow a host gets an address
6Subnet 192.168.10.0/24 into /26sCIDR math under pressure
7How ARP worksLayer 2 to Layer 3 glue
8VLANs and 802.1Q trunkingSwitching design
9Spanning Tree ProtocolLoop prevention
10Static vs dynamic routingRouting judgment and route selection

The Questions, With Sample Answers

1. “What is the OSI model, and how does it map to the TCP/IP model?”

Why they ask. Every other answer depends on placing a problem at the right layer.

Sample answer. “OSI has seven layers: physical, data link, network, transport, session, presentation and application. TCP/IP, the model the internet runs on, has four: link, internet, transport and application. Physical and data link map to link, where Ethernet frames and MAC addresses live. Network maps to internet, which is IP and ICMP. Transport is TCP and UDP in both. The top three OSI layers fold into the TCP/IP application layer, so HTTP, DNS, TLS and SSH sit there. I use OSI as a troubleshooting vocabulary: link light off is Layer 1; no ARP entry for the gateway is Layer 2; no route is Layer 3; a closed port is Layer 4.”

Weak answers. Reciting a mnemonic with no protocol at each layer, or putting TCP at Layer 3.

2. “What is the difference between TCP and UDP, and when would you use each?”

Why they ask. It shows whether you see reliability as a cost, not a free feature.

Sample answer. “TCP is connection-oriented. It sets up a session with a handshake, numbers every byte, retransmits lost segments, delivers in order and runs flow and congestion control, at the cost of a minimum 20-byte header and extra round trips. UDP is connectionless with an 8-byte header: no delivery guarantee, ordering or retransmission, so the application handles loss if it cares. I use TCP when every byte must arrive: web traffic, SSH, databases, BGP sessions. I use UDP when timeliness matters more or the exchange is tiny: voice and video, DNS queries, DHCP, NTP, syslog. QUIC, used by HTTP/3, runs over UDP but builds its own reliability and encryption.”

Weak answers. “UDP is unreliable so nobody uses it”, or naming no protocol that runs on each.

3. “Walk me through the TCP three-way handshake. How is a connection closed?”

Why they ask. Firewall, load balancer and packet capture questions all assume you can read this sequence.

Sample answer. “The client sends a SYN with its initial sequence number, say 100. The server answers with a SYN-ACK carrying its own sequence number, say 300, and an acknowledgment of 101. The client replies with an ACK of 301, and the connection is established. Options such as MSS, window scaling and selective acknowledgment are negotiated in the SYN and SYN-ACK. Closing normally takes four segments, a FIN and an ACK in each direction, because each side closes independently. The side that closes first waits in TIME-WAIT for twice the maximum segment lifetime. In a capture, a SYN with no reply points at a filter or a down host; a SYN answered by a RST means the host is up but nothing listens on that port.”

Weak answers. Getting the order wrong, or not knowing what a RST means in a capture.

Drill the handshake in Interview Practice; the usual follow-up is “and what if the SYN-ACK never comes back?“

4. “What happens during DNS resolution when you type a hostname into a browser?”

Why they ask. “It’s always DNS” is a cliche because it is often true. They want to know you can find where the chain broke.

Sample answer. “The browser checks its cache, then the operating system checks its cache and the hosts file. On a miss, the stub resolver queries the configured recursive resolver, usually over UDP port 53. The resolver does the iterative work: a root server refers it to the top-level domain servers, such as .com, which refer it to the domain’s authoritative name servers, which return an A record for IPv4 or AAAA for IPv6. The resolver caches the answer for the record’s TTL. DNS uses TCP port 53 for zone transfers and responses too large for UDP. To troubleshoot, I run dig against a specific server, compare the resolver’s answer with the authoritative one, and check TTLs to explain stale results.”

Weak answers. “DNS turns names into IPs” with no mention of caching, TTLs or resolver vs authoritative server.

5. “How does a host get an IP address through DHCP?”

Why they ask. DHCP failures drive many “connected but no internet” tickets, and relays trip up junior admins.

Sample answer. “It is DORA. The client broadcasts a DHCPDISCOVER from UDP port 68 to port 67. Servers reply with a DHCPOFFER: address, mask, gateway, DNS servers and lease time. The client broadcasts a DHCPREQUEST for one offer, which also tells other servers they were not chosen, and the server confirms with a DHCPACK. If the client finds the address already in use, it sends a DHCPDECLINE. Because DISCOVER is a broadcast, it does not cross a router, so I configure a relay, ip helper-address on Cisco, on the client VLAN’s gateway. Clients renew at half the lease time by default. A 169.254.x.x address on Windows means DHCP failed.”

Weak answers. Not knowing DORA, or not knowing why a new VLAN gets no addresses until a relay exists.

6. “Subnet 192.168.10.0/24 into four equal subnets. Where does 192.168.10.77 sit?”

Why they ask. Subnetting appears in nearly every network interview, often without a calculator.

Sample answer. “Four subnets need two borrowed bits, so /24 becomes /26, mask 255.255.255.192. The block size is 256 minus 192, which is 64, giving 192.168.10.0, .64, .128 and .192. Each /26 has 64 addresses, minus network and broadcast, so 62 usable hosts. 192.168.10.77 falls between 64 and 127, so it is in 192.168.10.64/26: network .64, first usable .65, last usable .126, broadcast .127. If someone needs at least 50 hosts per subnet, /26 is right, because a /27 gives only 30 usable. For point-to-point links I use a /30, with 2 usable addresses, or a /31 where both ends support it.”

PrefixMaskAddressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Weak answers. Forgetting to subtract network and broadcast addresses, or needing a calculator for a /26.

Ask Interview Practice for a fresh block and prefix each day and answer out loud against the clock.

7. “How does ARP work, and what is a gratuitous ARP?”

Why they ask. ARP is where Layer 3 meets Layer 2, and it explains why a host can ping its gateway but not a server.

Sample answer. “To send an IPv4 packet on its local subnet, a host needs the destination’s MAC address; if the target is off-subnet, it needs the default gateway’s MAC instead, which is the point people miss. It checks its ARP cache, and on a miss broadcasts a request, ‘who has 10.0.0.1, tell 10.0.0.25’. The owner sends a unicast reply with its MAC, and both sides cache it. A gratuitous ARP is a host announcing its own mapping unprompted, used to detect duplicate addresses and to update neighbors after failover, such as an HSRP or VRRP virtual IP moving. ARP has no authentication, which is why spoofing works and switches offer Dynamic ARP Inspection. IPv6 replaces ARP with Neighbor Discovery.”

Weak answers. Saying ARP finds a remote server’s MAC address across the internet.

8. “What is a VLAN, and how does 802.1Q trunking work?”

Why they ask. Every campus network runs VLANs, and mismatched trunks are a classic outage.

Sample answer. “A VLAN is a separate broadcast domain on shared switches, so finance and guest Wi-Fi share hardware but traffic between them must pass a router or Layer 3 switch where I apply policy. An access port carries one VLAN untagged. A trunk carries many, and IEEE 802.1Q inserts a 4-byte tag after the source MAC: TPID 0x8100, three priority bits, one DEI bit and a 12-bit VLAN ID. Twelve bits give 4,096 values with 0 and 4,095 reserved, so 1 to 4,094 are usable. The native VLAN is sent untagged and both ends must agree on it. I move it off VLAN 1, prune allowed VLANs and disable DTP on user ports.”

Weak answers. Treating a VLAN as a security boundary by itself, or never having heard of a native VLAN mismatch.

9. “What does Spanning Tree Protocol do, and how is the root bridge elected?”

Why they ask. A Layer 2 loop can take down a site in seconds.

Sample answer. “Ethernet frames have no TTL, so a loop between redundant links causes a broadcast storm and MAC table flapping. STP blocks redundant ports to build a loop-free tree. Switches exchange BPDUs and elect the root bridge with the lowest bridge ID: priority, default 32768 plus the VLAN number on Cisco’s per-VLAN versions, then lowest MAC as tie-breaker. Each other switch picks a root port with the lowest path cost to the root, each segment gets one designated port, and the rest block. Classic 802.1D takes 30 to 50 seconds to converge on default timers, so I run Rapid STP, set the root deliberately on core switches, and enable PortFast and BPDU Guard on edge ports.”

Weak answers. “STP picks the fastest switch as root”, or leaving root election to whichever switch has the oldest MAC.

Prepare for the Layer 2 round with OphyAI: say the election aloud in Interview Practice until it takes under a minute.

10. “When would you use static routing, and how does a router choose between routes?”

Why they ask. It tests design judgment and whether you can predict what the router will actually install.

Sample answer. “Static routes fit small, stable topologies: a stub branch that needs only a default route, or a backup path. They cost nothing to run but do not react to failures without IP SLA tracking and do not scale. Dynamic protocols learn and reroute automatically. To choose a route, the router first uses longest prefix match: 10.1.1.0/24 beats 10.0.0.0/8 for 10.1.1.5, whatever learned them. For the same prefix, administrative distance picks the source. Cisco defaults are 0 connected, 1 static, 20 eBGP, 90 internal EIGRP, 110 OSPF, 115 IS-IS, 120 RIP, 170 external EIGRP and 200 iBGP. Then the protocol’s metric decides. A floating static is a static route given a higher distance than the dynamic one, so it installs only on failure.”

Weak answers. Applying administrative distance before prefix length, the most common mistake here.

11. “Compare OSPF, EIGRP and BGP.”

Why they ask. Most network roles touch at least two of these.

Sample answer. “OSPF is an open-standard link-state interior protocol. Routers flood link-state advertisements within an area, build the same map and run shortest path first. It runs directly over IP protocol 89, uses a bandwidth-based cost, needs area 0 as the backbone and elects a DR and BDR on broadcast segments. EIGRP is Cisco’s advanced distance-vector protocol, published as an informational RFC in 2016. It uses DUAL, keeps feasible successors as precomputed backups and converges fast, but it is mostly a Cisco-only choice. BGP is the internet’s path-vector exterior protocol. It runs over TCP port 179, scales to the full internet table and picks paths by policy: local preference, AS path length, MED. Inside a campus I pick OSPF; between ISPs, clouds or large fabrics, BGP.”

Weak answers. Calling BGP “a faster OSPF”, or not knowing BGP runs over TCP.

For OSPF neighbor states and the BGP best-path order, see our Cisco network engineer interview questions.

12. “What is the difference between NAT and PAT?”

Why they ask. Every internet edge translates addresses, and NAT breaks things in recognizable ways.

Sample answer. “NAT rewrites IP addresses at a boundary, usually from RFC 1918 space, 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, to public addresses. Static NAT maps one inside address to one outside address permanently, which I use to publish a server. Dynamic NAT maps inside hosts one to one to a public pool. PAT, which Cisco calls NAT overload, maps many inside hosts to one public address by also rewriting source ports and tracking each session, which is how an office shares one IP. The costs: NAT breaks end-to-end addressing, complicates protocols that embed addresses in the payload such as SIP and active FTP, and makes logs harder to trace. On Cisco I check show ip nat translations.”

Weak answers. Calling NAT a security feature, or not knowing the RFC 1918 ranges.

13. “How do access control lists work, and where do you place them?”

Why they ask. A misplaced or misordered ACL is a common self-inflicted outage.

Sample answer. “An ACL is an ordered list of permit and deny rules applied to an interface, inbound or outbound. The router checks entries top-down and stops at the first match, so a broad permit above a specific deny makes the deny dead. Every ACL ends with an implicit deny, so a missing permit for routing protocol or return traffic can cut me off. On Cisco, standard ACLs, numbered 1 to 99 and 1300 to 1999, match only the source, so I place them near the destination. Extended ACLs, 100 to 199 and 2000 to 2699, match source, destination, protocol and ports, so I place them near the source. On a remote router I make changes with a rollback timer in place.”

Weak answers. Not knowing about the implicit deny, or editing a remote ACL with no rollback plan.

14. “What is the difference between a stateful and a stateless firewall?”

Why they ask. It tests whether you understand why return traffic gets through without a rule for it.

Sample answer. “A stateless filter, like a basic router ACL, judges each packet on its headers alone. To allow browsing out, I would have to permit return traffic from port 443 to high ports explicitly, which is loose. A stateful firewall keeps a state table: when an inside host sends a SYN to port 443, it records the five-tuple and allows matching return packets, while unsolicited inbound packets are dropped. Rules get simpler and safer, at the cost of memory per connection and state sync between a failover pair. Next-generation firewalls add application identification, user identity, TLS inspection and intrusion prevention. A good cloud example: AWS security groups are stateful, network ACLs are stateless.”

Weak answers. “Stateful means it has more rules”, or not knowing why return traffic works.

Prepare for the security portion with OphyAI by pairing this with the cybersecurity interview questions in one Interview Practice mock.

15. “What is the difference between HTTP and HTTPS? Walk me through the TLS handshake.”

Why they ask. Certificate and TLS problems now cause as many tickets as routing problems.

Sample answer. “HTTP is plain text, by default on TCP port 80. HTTPS is HTTP inside TLS, by default on port 443, adding encryption, integrity and server authentication by certificate. In TLS 1.3, after the TCP handshake, the client sends a ClientHello with cipher suites and a key share. The server replies with a ServerHello and its key share, both sides derive keys, and the rest is encrypted: EncryptedExtensions, the certificate, CertificateVerify and Finished. That is one round trip, versus two for a full TLS 1.2 handshake, and TLS 1.3 removed static RSA key exchange, so sessions get forward secrecy. The client checks the chain, hostname and expiry. 0-RTT resumption data can be replayed, so it should carry only safe requests.”

Weak answers. “HTTPS uses SSL” with no detail, or not knowing what the client checks in a certificate.

16. “What are the main differences between IPv4 and IPv6?”

Why they ask. Carriers, clouds and government networks run IPv6 at scale, and dual-stack issues are real.

Sample answer. “IPv6 addresses are 128 bits instead of 32, written as eight hex groups, and a double colon compresses one run of zeros once per address. The base header is a fixed 40 bytes, with extension headers for options. There is no broadcast: multicast and Neighbor Discovery over ICMPv6 replace ARP. Hosts configure themselves with SLAAC or DHCPv6. Every interface has a link-local address in fe80::/10, which routing protocols use as next hops. Routers never fragment; only the source does, using path MTU discovery, and every link must carry at least 1,280 bytes, so blocking ICMPv6 breaks things. A /64 is the standard subnet. In practice I run dual stack and keep firewall rules for both families.”

Weak answers. “IPv6 is just longer addresses”, or blocking all ICMPv6.

17. “What is the difference between latency, bandwidth and throughput?”

Why they ask. “The network is slow” tickets need you to know which one is the real problem.

Sample answer. “Bandwidth is capacity, say 1 Gbps. Latency is travel time, usually measured as round-trip time. Throughput is what you actually get end to end. The bandwidth-delay product links them: 1 Gbps with a 50 ms RTT means 50 million bits, about 6.25 MB, in flight, so one TCP flow needs a window that large to fill the pipe. With a 64 KB window and no window scaling, that flow tops out around 10.5 Mbps however fast the link is. Loss cuts throughput further because TCP backs off. So when a user says a 1 Gbps link is slow, I measure RTT, loss and the TCP window before asking for more bandwidth. Jitter matters most for voice.”

Weak answers. Treating bandwidth as speed, or buying a bigger circuit for a latency problem.

18. “How does a load balancer work? Layer 4 versus Layer 7?”

Why they ask. Network and cloud engineers own load balancers, and they sit in the path of most incidents.

Sample answer. “A load balancer spreads client connections across a server pool behind one virtual IP, and health checks remove failing servers. Layer 4 works on IP addresses and TCP or UDP ports: fast and protocol-agnostic, but blind to URLs and headers. Layer 7 terminates the HTTP or TLS session, so it can route by hostname or path, insert X-Forwarded-For, keep sticky sessions with cookies and offload TLS. Common algorithms are round robin, weighted round robin, least connections and source-IP hash. I always ask what happens to the client IP: with source NAT the servers see the load balancer, so I need X-Forwarded-For or the PROXY protocol. Health checks should test the real application, not just an open port.”

Weak answers. Describing round robin only, or forgetting health checks.

For full design rounds, see our system design interview questions.

19. “What is a VPN, and how does IPsec build a tunnel?”

Why they ask. Site-to-site tunnels to branches and clouds are daily work, and a down tunnel is a common scenario.

Sample answer. “A VPN carries private traffic across an untrusted network in an encrypted tunnel. Site-to-site VPNs join networks, such as a branch to a cloud VPC; remote-access VPNs connect users. With IPsec and IKEv2, the peers first run IKE_SA_INIT over UDP port 500 to agree on algorithms and do a Diffie-Hellman exchange, then IKE_AUTH to authenticate with pre-shared keys or certificates and set up the first Child SA, which carries data. Traffic is protected with ESP, IP protocol 50. If a NAT sits in the path, the peers move to UDP port 4500 and encapsulate ESP in UDP. When a tunnel fails, I check the IKE SA first, then mismatched proposals, then traffic selectors, then routing for the protected subnets.”

Weak answers. Not knowing the two stages, or forgetting that NAT traversal changes the port.

20. “What is QoS, and how would you protect voice traffic?”

Why they ask. Voice and video complaints land on the network team, and QoS is often configured wrong.

Sample answer. “QoS only matters when a link is congested; it decides who waits and who gets dropped. The steps are classify, mark, queue, and police or shape. I classify voice at the edge and mark it DSCP EF, value 46, with call signaling as CS3. On congested links, EF goes in a capped low-latency priority queue so it cannot starve other classes, which get guaranteed bandwidth shares. Policing drops or re-marks traffic above a rate; shaping buffers it, which I use toward a provider that polices. Voice needs low delay, low jitter and near-zero loss; ITU-T G.114’s guideline of about 150 ms one-way is the usual reference. Markings only help if every hop, including the WAN provider, honors them.”

Weak answers. “QoS makes the network faster”, or marking traffic with no queuing configured.

21. “A user says the website is down. How do you troubleshoot it?”

Why they ask. This scenario appears in almost every network, NOC and IT support loop, and they grade the method.

Sample answer. “First I scope it: one user or everyone, one site or all, since when, and what changed. Then I walk the layers. Does the user have an IP, mask and gateway, or a 169.254 address? Can they ping the gateway? Does DNS resolve the name to the expected address? Can they reach that IP: ping, then traceroute to see where it stops? Is the port open: curl -v or Test-NetConnection to 443, which also shows TLS and certificate errors? If the name resolves and TCP connects but the page fails, it is likely the application or a load balancer health issue, and I hand over evidence. I keep timestamped notes, check monitoring and recent changes, and tell the user when the next update comes.”

Weak answers. Jumping to “restart the router”, or testing in random order without scoping who is affected.

Prepare for scenario rounds with OphyAI in a voice mock in Interview Practice, where the interviewer answers only what you ask.

22. “Two hosts on different subnets cannot reach each other. Walk me through it.”

Why they ask. It tests whether you think about both directions of a flow, where many real outages hide.

Sample answer. “I start at the source host: correct IP and mask, correct default gateway, and an ARP entry for that gateway. With a wrong mask, the host may treat the destination as local and ARP for it directly. Next, the gateway: is there a route to the destination subnet, and does the far side have a route back? A missing return route is the classic cause, because the forward path looks perfect. Then policy: an ACL, firewall rule or security group on either side, a host firewall on the server, or asymmetric routing through a stateful firewall that never saw the SYN. I run traceroute from both ends, check interface errors, and capture on the destination to see whether the request arrives.”

Weak answers. Checking only the forward path, or forgetting the host firewall.

How to Practice These

Run a voice or text mock in OphyAI Interview Practice, which asks follow-up questions and gives a transcript and per-answer feedback, so you can see whether your subnetting or troubleshooting answer survives “and then what?”. On the live technical screen, OphyAI Interview Copilot gives real-time answer suggestions during Zoom, Microsoft Teams and Google Meet interviews. For a scripting or automation round, such as parsing device output in Python, Coding Copilot in the desktop app (Premium plan, 15 credits a session) reads the problem from your screen with Cmd/Ctrl+Shift+A and returns how it read the problem, what to say first, the code, a dry run with edge cases and the Big O. Start practicing →

Daily routine: three timed subnetting prompts, four questions answered aloud and one troubleshooting scenario.

Frequently Asked Questions

What are the most common networking interview questions?

The most common are the OSI and TCP/IP models, TCP vs UDP and the handshake, DNS resolution, DHCP’s DORA process, a subnetting exercise, ARP, VLANs and trunking, STP, routing basics, and OSPF vs BGP. Almost every loop also includes a troubleshooting scenario such as “a user cannot reach a website”, graded on method.

How do I answer network engineer interview questions with no job experience?

Use lab work as evidence. Build small topologies in Cisco Packet Tracer, GNS3 or a home lab, break them on purpose and fix them. Then answer with what you configured and saw: “When I set the wrong native VLAN, CDP logged a mismatch.” Concrete lab stories beat textbook definitions.

Do I need a CCNA to pass a networking interview?

No. Many employers hire without one, but a CCNA is a common screening signal for entry-level network roles, and its syllabus covers most questions on this page. If the posting lists it as required, take that seriously; if it says preferred, strong subnetting and troubleshooting answers can carry you.

How much do network engineers make in the US?

The US Bureau of Labor Statistics reports a May 2025 median of $99,130 a year for network and computer systems administrators and $134,050 for computer network architects. BLS projects a 4% decline for administrators and 8% growth for architects from 2025 to 2035.

Will I have to subnet without a calculator?

Often, yes, because it shows fluency. Memorize the block sizes for /25 to /30 (128, 64, 32, 16, 8, 4), practice finding the network, broadcast and usable range for a random address, and be ready to say how many hosts and subnets any prefix gives.

Which port numbers should I memorize for a networking interview?

Know these cold: FTP 20 and 21, SSH 22, Telnet 23, SMTP 25, DNS 53, DHCP 67 and 68, HTTP 80, NTP 123, SNMP 161 and 162, BGP 179, LDAP 389, HTTPS 443, syslog 514 and RDP 3389. Also know which run over TCP and which over UDP, because that is the usual follow-up.

Are networking interviews different for cloud and DevOps roles?

The fundamentals are the same, but the vocabulary shifts to VPCs, route tables, security groups vs network ACLs, load balancers, DNS, VPNs or private interconnects, and sometimes BGP for hybrid links. You are less likely to configure STP and more likely to explain why a private-subnet instance cannot reach the internet.

How does OphyAI work in a networking interview?

Rehearse subnetting or the “website is down” scenario in Interview Practice, which follows up and gives per-answer feedback. On a live screen, Interview Copilot shows real-time answer suggestions. Coding Copilot runs in the desktop app; its overlay is left out of screen sharing, though not out of a webcam, keystroke and paste history, tab or focus tracking, or proctoring software.

Sources and verification notes

Sources checked November 2026 by fetching each page in this run. The questions are original templates, not published by any employer.

Tags:

networking interview questions network engineer interview questions subnetting CCNA technical interview

Rehearse your answers, then get live help on the call.

Practice free for up to 15 minutes, then use Interview Copilot in the OphyAI desktop app: real-time answer suggestions on Zoom, Teams and Google Meet, in a window hidden from screen sharing.

Hidden from screen share and recording; a webcam or a person in the room can still see your screen.