Top 12 Linux & Network Interview Questions Every Ops Engineer Should Know
This article compiles essential Linux environment variable settings, TCP characteristics, three‑handshake rationale, proxy implementation, TCP vs UDP pros and cons, OOP vs procedural differences, HTTP request flow, status codes, deadlock causes and prevention, TCP close_wait and time_wait states, and common IPC mechanisms, providing concise answers for operations interview preparation.
1. Setting Linux Environment Variables
Temporary: export MYNAME="new name" then echo $MYNAME outputs new name. Permanent: modify /etc/profile, e.g., export CLASSPATH=./java_HOME/lib;$JAVA_HOME/jre/lib, and apply with source /etc/profile.
2. Characteristics of TCP Connections
(1) Connection‑oriented using a client/server model. (2) Full‑duplex. (3) Reliable with flow control, congestion control, and error control. (4) Byte‑stream based.
3. Why Does TCP Require a Three‑Way Handshake?
Two handshakes cannot guarantee both sides have received each other's acknowledgments. The three‑step process—SYN, SYN‑ACK, ACK—ensures the client and server both know the connection is established before data transfer.
4. Proxy Implementation Principles
Proxies are classified as HTTP, FTP, or SOCKS and can be transparent or non‑transparent. Typical flow: (1) Client connects to proxy (TCP). (2) Client sends GET with URL. (3) Proxy resolves URL to IP, possibly via DNS, copies the request, removes the URL, repackages, and forwards it. (4) Proxy communicates with the real server using its own IP.
5. TCP vs. UDP Advantages and Disadvantages
TCP – Reliable, stable, supports flow control, congestion control, and three‑way handshake; drawbacks are higher latency, greater resource consumption, and susceptibility to certain attacks. UDP – Faster, lower overhead, fewer attack vectors; drawbacks are lack of reliability and potential packet loss on poor networks.
6. Procedural vs. Object‑Oriented Programming
Procedural programming breaks a problem into sequential steps implemented as functions. Object‑oriented programming models problem entities as objects, focusing on their behaviors and interactions rather than step‑by‑step procedures.
7. HTTP Request Process and Principles
HTTP is stateless and follows a request/response model: (1) Establish TCP connection. (2) Browser sends request command. (3) Browser sends request headers. (4) Server responds. (5) Server sends response headers. (6) Server sends data. (7) Server closes TCP connection. HTTP/1.0 uses short connections by default; HTTP/1.1 defaults to persistent (keep‑alive) connections, reducing the overhead of repeatedly opening and closing TCP sockets.
8. Common HTTP Status Codes
2xx – Success (e.g., 200 OK, 202 Accepted, 205 No Content). 3xx – Redirection (e.g., 301 Moved Permanently, 302 Found, 303 See Other, 305 Use Proxy, 307 Temporary Redirect). 4xx – Client errors (e.g., 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 405 Method Not Allowed, 408 Request Timeout). 5xx – Server errors (e.g., 500 Internal Server Error, 503 Service Unavailable).
9. What Is a Deadlock?
A deadlock occurs when two or more processes wait indefinitely for resources held by each other. Causes include insufficient resources, improper execution order, and poor resource allocation. Four necessary conditions: mutual exclusion, hold‑and‑wait, no preemption, circular wait. Prevention methods include ordered resource allocation and the Banker's algorithm.
10. CLOSE_WAIT State
When a socket has received a FIN from the peer but has not yet sent its own FIN, it enters CLOSE_WAIT. This state should be brief; prolonged CLOSE_WAIT often indicates the application is not properly closing the socket after reading EOF.
11. TIME_WAIT State
After actively closing a socket, it enters TIME_WAIT for 2 MSL (Maximum Segment Lifetime) to ensure all delayed packets are discarded and to allow reliable termination of a full‑duplex TCP connection.
12. Inter‑Process Communication Mechanisms
Common IPC methods include pipes, message queues, shared memory (fastest), semaphores, file mapping, and anonymous or named pipes.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
