Comprehensive Linux C/C++ Interview Questions and Topics
This article compiles a wide range of Linux C/C++ interview questions covering language fundamentals, data structures, algorithms, operating systems, networking, databases, and general problem‑solving approaches to help candidates assess and improve their technical knowledge.
The author, a seasoned interviewer, shares observations about weak fundamentals among many computer science graduates and presents a curated list of typical Linux C/C++ interview questions.
Linux C/C++ interview questions are generally divided into three parts: basic knowledge, scenario‑based problems, and project‑related questions, with the first two sections carrying the most weight.
0x01: C/C++ Language
1. Discuss the differences between C and C++ programming. 2. Different uses of the static keyword in C and C++. 3. What is a union and its purpose? 4. Purpose of the volatile keyword. 5. How function calls are performed at the assembly level. 6. Basic features of object‑oriented programming. 7. How polymorphism is implemented; what are virtual functions? 8. Implement a singleton pattern. 9. Size of an object with a single int member. 10. Size of an object with an int and a char member. 11. Size of an object with an int member and a virtual function. 12. What is RAII? 13. Principles of smart pointers; purpose of weak_ptr. 14. What happens when a vector’s capacity is full? 15. Differences between map and unordered_map and their implementations. 16. What are rvalue references; what problem does move address? 17. Can constructors or destructors throw exceptions? 18. Types of C++ casts and their differences. 19. Steps from source code to executable.
0x02: Data Structures & Algorithms
1. Four traversal methods of a binary tree. 2. How hash tables work and how collisions are resolved. 3. Implement binary search. 4. Common sorting algorithms and their time complexities. 5. Stair‑climbing problem solved by recursion and dynamic programming. 6. Find the turning point in an array that first increases then decreases. 7. Design an algorithm to quickly check if an IP address exists in a system. 8. Design a thread‑safe queue.
0x03: Operating System
1. Difference between processes and threads. 2. What resides in a process address space? 3. What is stored in a thread’s stack? 4. Explain virtual memory mechanisms. 5. How virtual address translation works. 6. Principle of fork. 7. Inter‑process communication methods. 8. Principle of shared memory. 9. Principle of atomic operations. 10. I/O multiplexing models. 11. Reasons for epoll’s high performance. 12. Signal mechanism. 13. What is a system call and its execution process? 14. Copy‑on‑write principle and implementation.
0x04: Computer Networks
1. The four layers of the OSI model and their responsibilities. 2. Principle of the ping command. 3. Principle of traceroute. 4. What is ARP spoofing? 5. Differences among hub, switch, and router. 6. What is MTU and why that size? 7. TCP three‑way handshake and four‑way termination. 8. Can data be carried in the third handshake? 9. Mechanisms ensuring TCP reliability. 10. How timeout retransmission works. 11. DNS resolution process. 12. HTTP methods and difference between POST and PUT. 13. Differences between HTTP/1.0 and HTTP/1.1. 14. Principles of HTTPS security. 15. What is reverse proxy; nginx load‑balancing strategies. 16. Steps from entering a URL to rendering the webpage.
0x05: Databases
1. What is a database index? 2. Implementation methods of MySQL indexes. 3. Use cases for B+ trees vs hash indexes. 4. What is a “row lookup” (回表)? 5. What is a transaction and its ACID properties? 6. Solutions for sharding and partitioning databases. 7. Concepts of cache breakdown, avalanche, and penetration. 8. Why is Redis single‑threaded yet fast? 9. How Redis implements message queues. 10. Persistence methods of Redis and their principles. 11. Basic principles of Elasticsearch.
0x06: Others
1. Common learning methods and resources. 2. How to approach problem solving. 3. Most rewarding personal achievements. 4. Desired future work direction. 5. Open question for the interviewee.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
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.