Networks Junior cheat sheet: interview answers
Every question of this level with its correct answer and explanation, on one page for a quick review before the interview.
1. What does an IP address identify?
Correct answer: A network interface of a device on an IP network
An IP address lets packets find a device's network interface. One machine can have several addresses, and pages or users are identified at higher layers.
2. What is a port number used for?
Correct answer: To pick which process on a host gets the traffic
The IP address finds the host, the port finds the service on it, e.g. 443 for HTTPS. Together with the protocol they identify one endpoint of a connection.
3. Which port does HTTPS use by default?
Correct answer: 443
HTTPS listens on 443 by default and plain HTTP on 80. 8080 is a common choice for development servers, not a standard.
4. Which port does DNS use by default?
Correct answer: 53
DNS uses port 53, mostly over UDP and over TCP for large answers. 25 is SMTP and 22 is SSH.
5. What is the main difference between TCP and UDP?
Correct answer: TCP guarantees ordered, reliable delivery; UDP doesn't
TCP sets up a connection, numbers bytes, resends lost data and keeps order. UDP just sends datagrams: lower overhead, but loss and reordering are possible.
6. How does a TCP connection start?
Correct answer: With a three-way handshake: SYN, SYN-ACK, ACK
The client sends SYN, the server replies SYN-ACK, the client confirms with ACK. Only then does data flow; TLS, if used, comes after this.
7. What does DNS do?
Correct answer: Translates domain names into IP addresses
DNS answers questions like 'what is the IP of devsets.com?'. Encryption is TLS, and handing out local addresses is DHCP.
8. Which DNS record maps a name to an IPv4 address?
Correct answer: A
A is IPv4, AAAA is IPv6 and MX points to mail servers for the domain.
9. What is a CNAME record?
Correct answer: An alias that points one name to another name
www.example.com can be a CNAME to example.com or to a CDN host. The resolver then looks up the target name.
10. What is the TTL of a DNS record?
Correct answer: How long resolvers may cache the answer
After a DNS change, old answers can live in caches until their TTL runs out. That's why changes 'propagate' with a delay.
11. A tester wants test.example.com to point to a staging server only on their own machine. What is the simplest way?
Correct answer: Add a line to the hosts file
The hosts file is checked before DNS on most systems. It changes resolution only for that machine and doesn't affect other users.
12. What address does localhost usually resolve to?
Correct answer: 127.0.0.1 (or ::1 for IPv6)
localhost is the loopback interface: traffic never leaves the machine. 192.168.0.1 is a typical router address in a home network.
13. Which of these is a private IPv4 address that can't be reached directly from the internet?
Correct answer: 192.168.1.20
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private ranges. Devices with them reach the internet through NAT.
14. Why was IPv6 introduced?
Correct answer: IPv4 has too few addresses for all devices
IPv4 has about 4.3 billion addresses. IPv6 uses 128-bit addresses, so the supply is practically unlimited.
15. What does NAT on a home router do?
Correct answer: Lets many private devices share one public IP
The router rewrites private source addresses to its public one and tracks connections to send replies back to the right device.
16. What does DHCP do?
Correct answer: Gives devices an IP address and network settings
When a laptop joins Wi-Fi, DHCP hands it an IP, subnet mask, gateway and DNS servers.
17. What does the
pingcommand check?Correct answer: Whether a host answers ICMP echo, and the round-trip time
ping sends ICMP echo requests. No reply doesn't always mean the host is down: many servers and firewalls block ICMP.
18. What does
traceroute(tracerton Windows) show?Correct answer: The routers a packet passes through on its way
It sends packets with growing TTL and lists each hop that answers, which helps find where delay or loss starts.
19. What is the default gateway?
Correct answer: The router that forwards traffic outside the local network
Packets for addresses outside the subnet go to the gateway, which passes them on towards the destination.
20. What are the two main parts of an HTTP message?
Correct answer: A start line with headers, and an optional body
A request has a method, path and headers, then maybe a body. A response has a status line, headers and usually a body.
21. What do HTTP status codes in the 4xx range mean?
Correct answer: The client made an error, e.g. 404 or 401
1xx informational, 2xx success, 3xx redirect, 4xx client error, 5xx server error.
22. What's the difference between 301 and 302 redirects?
Correct answer: 301 is permanent, 302 is temporary
Browsers and search engines may cache 301 and update links. 302 says the resource is elsewhere only for now.
23. A page through a reverse proxy returns 502 Bad Gateway. What does it usually mean?
Correct answer: The proxy got an invalid response or none from the backend
502 comes from a gateway or proxy that couldn't get a valid answer upstream. 504 means the upstream answered too late.
24. What does 504 Gateway Timeout mean?
Correct answer: A proxy waited too long for the backend server
The gateway gave up waiting for upstream. The backend may still be working on the request.
25. What does 304 Not Modified mean?
Correct answer: The cached copy is still valid, so no body is sent
The browser sent a conditional request (If-None-Match or If-Modified-Since) and the server confirmed the cached version is current.
26. What does the
Content-Typeheader describe?Correct answer: The media type of the body, e.g. JSON
Content-Length is the size and Content-Encoding the compression (gzip, br). Content-Type tells the client how to parse the body.
27. What is HTTPS?
Correct answer: HTTP sent over an encrypted TLS connection
TLS encrypts traffic and proves the server's identity with a certificate. The HTTP messages inside are the same.
28. The browser shows NET::ERR_CERT_DATE_INVALID. What is the likely cause?
Correct answer: The certificate has expired or the device clock is wrong
The browser checks the certificate's validity dates against the device time. A wrong system clock gives the same error.
29. What does a certificate authority (CA) do?
Correct answer: Signs certificates so browsers can trust a site's identity
Browsers trust a list of root CAs. A site's certificate chain must lead to one of them.
30. An HTTPS page loads an image over plain HTTP. What does the browser do?
Correct answer: Treats it as mixed content and upgrades or blocks it
Mixed content weakens HTTPS. Modern browsers auto-upgrade or block such requests and show it in the console.
31. In the URL
https://shop.example.com:8443/cart?item=5#top, what is8443?Correct answer: The port
Scheme https, host shop.example.com, port 8443, path /cart, query item=5 and fragment #top.
32. Is the URL fragment (
#section) sent to the server?Correct answer: No, it stays in the browser
The fragment is used by the page itself, e.g. to scroll. A server-side redirect bug can't depend on it.
33. Why are spaces in query parameters written as
%20or+?Correct answer: URLs allow only certain characters, others must be encoded
Percent-encoding turns unsafe characters into bytes like %20. A good negative test sends unusual characters and checks how they are decoded.
34. Which DevTools Network option keeps requests listed after a page reload or redirect?
Correct answer: Preserve log
Without Preserve log the list is cleared on navigation, and you lose the requests that happened before a redirect.
35. What does 'Disable cache' in DevTools Network do?
Correct answer: Ignores the HTTP cache while DevTools is open
It simulates a first visit for that tab. It doesn't touch the server or CDN caches.
36. How do you test a page on a slow mobile connection in Chrome?
Correct answer: Pick a throttling profile like 'Slow 4G' in DevTools
Network throttling adds latency and limits bandwidth for the tab, so you can see loading states and timeouts.
37. In DevTools Network, a request shows '(disk cache)' in the Size column. What does it mean?
Correct answer: The response came from the browser cache, not the network
No request reached the server. To check the real server response, disable the cache or do a hard reload.
38. What is 'Copy as cURL' in DevTools useful for?
Correct answer: Replaying the exact request in a terminal or a bug report
It copies the method, URL, headers, cookies and body. A developer can reproduce the bug without clicking through the UI.
39. What does the Initiator column in DevTools Network show?
Correct answer: What triggered it: a script, a link or a redirect
It helps find which code makes a duplicate or unexpected request.
40. What does the Waterfall in DevTools Network show?
Correct answer: When each request started and its phases: DNS, TLS, wait
Hover a bar to see Queueing, DNS lookup, Initial connection, SSL, Waiting (TTFB) and Content download.
41. What does
curl -I https://example.comdo?Correct answer: Sends a HEAD request and prints only the response headers
-I is a quick way to check status codes, redirects and caching headers without the body.
42. What does
curl -vadd?Correct answer: Verbose output: connection, TLS and all headers
Verbose mode shows the resolved IP, the TLS handshake and every header sent and received.
43. What is a CORS error in the browser console about?
Correct answer: The browser blocked a cross-origin response that wasn't allowed
The request often reached the server. The browser hides the response because Access-Control-Allow-Origin doesn't allow the page's origin.
44. What makes two URLs the same origin?
Correct answer: The same scheme, host and port
https://a.com and http://a.com differ in scheme, a.com and api.a.com differ in host, :443 and :8443 in port.
45. Why does the browser send an OPTIONS request before some API calls?
Correct answer: It's a CORS preflight checking that the real request is allowed
Cross-origin requests with methods like PUT or custom headers need permission first. Testers often see OPTIONS fail before the real call.
46. What is a cookie?
Correct answer: A small piece of data a site stores in the browser
The server sets it with Set-Cookie, and the browser sends it back in the Cookie header on later requests to that site.
47. What does the
HttpOnlycookie attribute do?Correct answer: Hides the cookie from JavaScript
HttpOnly protects session cookies from being read by scripts injected via XSS. Secure is the one that limits it to HTTPS.
48. What is latency in networking?
Correct answer: The time for data to travel from one point to another
Latency is delay, bandwidth is capacity. A fast connection with high latency still feels slow for many small requests.
49. What is packet loss?
Correct answer: Packets that never arrive at their destination
Loss forces TCP to resend data and slows everything down. On calls and games it shows as glitches.
50. What is a CDN?
Correct answer: A network of servers that serve content close to users
A CDN caches static files on edge servers worldwide, which cuts latency and load on the origin.
51. What is a reverse proxy?
Correct answer: A server in front of backends that takes client requests
Nginx or a load balancer can terminate TLS, cache, route and balance requests to several app servers.
52. Why do testers use proxies like Charles, Fiddler or mitmproxy?
Correct answer: To view, change and replay traffic between app and server
They show HTTP(S) traffic of mobile and desktop apps, where DevTools isn't available, and can change responses for tests.
53. To read HTTPS traffic of a mobile app in Charles, what is usually needed?
Correct answer: Install and trust the proxy's root certificate on the device
The proxy decrypts traffic with its own certificate, which the device must trust. Apps with certificate pinning still refuse it.
54. What does 'Connection refused' usually mean?
Correct answer: Nothing listens on that port, or the host rejected it
The host answered with a reset. A timeout instead means no answer at all, often a firewall or wrong IP.
55. The browser shows ERR_NAME_NOT_RESOLVED. Where is the problem?
Correct answer: DNS: the name couldn't be resolved to an IP
Check the spelling, the DNS records and the DNS server in use. The server itself was never contacted.
56. What does a firewall do?
Correct answer: Allows or blocks traffic based on rules
Rules can match IPs, ports and protocols. A blocked port often looks like a timeout to the client.
57. Why might a tester use a VPN during testing?
Correct answer: To test from another country or reach an internal network
Geo-based content, prices and blocks need an IP from another region. Corporate VPNs give access to staging environments.
58. What does
gziporbrin theContent-Encodingheader mean?Correct answer: The body is compressed and the browser unpacks it
Compression shrinks text resources a lot. The client says what it supports in Accept-Encoding.
59. What does HTTP keep-alive (a persistent connection) do?
Correct answer: Reuses one TCP connection for several requests
Without it, each request needs a new TCP and TLS handshake, which adds latency.
60. What's the main gain of HTTP/2 over HTTP/1.1?
Correct answer: Many requests run in parallel over one connection
HTTP/2 multiplexes streams and compresses headers. HTTP/1.1 needs several connections for parallel requests.
61. What transport does HTTP/3 use?
Correct answer: QUIC over UDP
QUIC builds reliability and TLS 1.3 encryption on top of UDP, which avoids some TCP delays.
62. What are WebSockets used for?
Correct answer: A two-way, long-lived connection for real-time data
After an HTTP upgrade, client and server can both send messages at any time: chats, live updates, games.
63. Which HTTP methods are idempotent?
Correct answer: GET, PUT and DELETE
Repeating an idempotent request has the same effect as doing it once. POST may create a new resource each time.
64. What does
Cache-Control: no-storetell the browser?Correct answer: Don't save the response in any cache
no-cache allows storing but requires revalidation. no-store is for sensitive data like account pages.
65. What does the OSI model describe?
Correct answer: Seven layers of network communication, cables to apps
Physical, data link, network, transport, session, presentation, application. The TCP/IP model is a simpler four-layer version.
66. At which layer do TCP and UDP work?
Correct answer: Transport
IP is the network layer, HTTP and DNS are application protocols, TCP and UDP are transport.
67. What is a MAC address?
Correct answer: A hardware address of a network interface in the local network
Switches deliver frames inside a LAN by MAC. ARP finds the MAC for an IP on the same network.
68. What is bandwidth?
Correct answer: How much data can be sent per second
Bandwidth limits big downloads. Latency matters more for pages with many small requests.
69. Why should testers check an app with the network switched off ('Offline' in DevTools)?
Correct answer: To see if it shows clear errors and keeps user data
Real users go offline in tunnels and lifts. The app should explain what happened and retry or save input.
70. An API call works in Postman but fails in the browser with a CORS error. Why?
Correct answer: CORS is enforced by browsers, not by tools like Postman
Postman doesn't apply the same-origin policy. The server must send the right CORS headers for browser clients.
71. What is the TTFB of a request?
Correct answer: Time until the first byte of the response arrives
In DevTools it's 'Waiting for server response'. A high TTFB points to slow server work or a far-away server.
72. What is a subnet mask such as 255.255.255.0 (/24) for?
Correct answer: It shows which part of an IP address is the network
With /24, devices with the same first three octets are in the same subnet and talk directly, the rest goes via the gateway.
73. Which tool lets you query DNS records directly from the terminal?
Correct answer:
digornslookupdig example.com Ashows the answer, TTL and the server that replied. It's how you check a DNS change.74. What does the
User-Agentrequest header contain?Correct answer: Information about the client: browser, OS, app
Servers use it for stats and sometimes for different content. Testers change it to check mobile and bot handling.
75. Why can a website be fine for you but down for a user in another country?
Correct answer: Routing, DNS, CDN or blocks can differ by region
Check from several locations or with a VPN, and compare DNS answers and CDN nodes.