Hello, everyone, I'm Kon.
Recently, many students wrote to me that they were busy looking for jobs near graduation and wanted to ask if there were any recommended C++ projects that they could practice and make their resumes more impressive. I remembered the same anxiety I had when I graduated, and I knew that as a C++ back-end developer, having a few practical and attractive projects could add a lot of weight to my interview.
Today, I'd like to recommend a few projects that are well-documented, easy-to-follow C++ projects for students who are preparing for school recruitment. In order to make it easier for you to choose, I will introduce them according to the gradient of "from easy to hard", and each project is accompanied by learning videos and materials to help you learn and practice efficiently.
A total of 23 C/C++ projects have been selected for you to choose from as needed.
I. Easy difficulty (suitable for personal practice)
1. Pressure testing tool Webbench (C implementation) -- 2.7k stars
Project Profile: Webbench is a well-known lightweight Web stress testing tool for performance testing and benchmarking of Web servers. Through this project, you can learn how to simulate highly concurrent requests and understand the performance of Web servers under high load.Webbench code is simple, easy to understand, very suitable for beginners to learn and master the basic concepts and implementation of Web performance testing.
Involves technology:C Language, Linux System Programming, Socket Programming, Multi-Process Programming, HTTP Protocol, Performance Testing
Project Highlights:
- HTTP protocol support: Implement the processing of HTTP requests and responses, demonstrating your mastery of Web standard protocols.
- Concurrent Programming: Demonstrate your competence in concurrent programming by using multi-process techniques to handle concurrent requests.
- Performance Analysis: Analyze the response time and throughput of a Web server at different concurrency levels to understand the server performance bottleneck.
- High Concurrency Simulation: Demonstrate your understanding of high concurrency processing by generating a large number of concurrent requests and testing the performance of a web server under high load.
- Simple code: The code is simple, easy to understand and modify, perfect for beginners to learn and expand.
- Cross-platform support: Support running on multiple operating systems (e.g. Linux, Unix, Windows) to demonstrate your cross-platform development capabilities.
reference resource:
- Look at the Webbench source code and learn about its design and implementation ideas. Download link:/EZLippi/WebBench
- Webbench source code analysis reference link:/qq_34168988/article/details/123893487
Here's a diagram of Webbench's architecture from the source code analysis:
2, small HTTP server Tinyhttpd (C implementation) -- 11.4k stars
Project Profile: Tinyhttpd is an ultra-lightweight HTTP server , the use of C language development , less than 600 lines of code , comes with a simple client . Through the study of this small project , you can deeply understand the basic principles and implementation details of HTTP server .
Technology involvedC language, Linux system programming, socket programming, HTTP protocol, multi-process programming, CGI technology, HTML and other front-end knowledge.
Project Highlights:
- HTTP protocol implementation: Demonstrate your understanding and ability to apply Web standard protocols by implementing the HTTP protocol.
- Concurrent connection processing: Demonstrate your mastery of concurrent programming by using multi-process or multi-threading techniques to handle multiple client connections.
- Simple file handling: Implement access and transfer functions for static files, demonstrating your understanding of file system operations.
- Request Parsing: Parse HTTP request headers and request bodies to understand and implement the flow of HTTP requests and responses.
- CGI support: Support for CGI (Common Gateway Interface) technology, which allows the server to run external programs to generate web content, demonstrates your mastery of server extensions.
- Simple code: The project code is simple and easy to understand, perfect for beginners to learn and understand the principles of network server implementation.
reference resource:
- HTTP/1.1 Standard (RFC 2616): refer to HTTP/1.1 Standard Protocol Details, link:/doc/html/rfc2616
- Tinyhttpd source code: learn Tinyhttpd design and implementation ideas, source code download link:/EZLippi/Tinyhttpd
- Tinyhttpd source code analysis: see Tinyhttpd source code analysis, reference link:/?aid=236
Project Architecture Diagram in TinyHttpd Source Code Analysis:
3, port scanning tool MyScan (C realization) -- 202 stars
Project Profile: MyScan is a lightweight, high-performance network port scanning tool designed for scanning and detecting specified ports on a host or network. Through this project, developers can understand how to use socket programming to implement network scanning, learn concurrent programming and the basic implementation of port probing.MyScan uses a simple structure, but contains the key techniques of network programming and multi-threading, ideal for beginners to master the workings of a port scanner.
Technology involvedC, Linux System Programming, Socket Programming, Multithreading Programming, Network Protocols, Concurrent Programming.
Project Highlights:
- port detection: Demonstrate your understanding of network protocols and port mechanisms by implementing a scanning function on a specified port.
- concurrent programming: Demonstrate concurrent programming capabilities by using multi-threading technology to support concurrent scanning of multiple ports.
- Socket Programming: Practice basic network communication by creating a connection to a target port through a socket.
- Efficient Scanning: Be able to quickly detect open ports on a host and understand port scanning techniques and performance optimization tips.
reference resource:
- Read MyScan source code : Learn about its design and implementation ideas. Source code download link:/nobackdoor/myscan
4. Chat server smallchat (C implementation) -- 7.3k stars
Project Profile: smallchat is a simple C-based implementation of the chat server and client project . Through this project , developers can learn and master the basic network programming techniques , to understand the core principles of the implementation of the chat application . smallchat project code is small , clear structure , very suitable for beginners to learn and practice network programming .
Involves technology:C Language, Socket Programming, Multithreading Programming, Network Protocol Design and Implementation, Terminal Control, Non-blocking I/O
Project Highlights:
- Socket Programming: Implementing communication between a server and a client through socket programming shows how to use C for network programming.
- multi-threaded processing: Demonstrates the power of concurrent programming by using multithreading techniques to handle multiple client connections.
- Basic Chat Functions: A simple chat server and client is implemented, including message sending and receiving.
- Simple command processing: Implements basic command processing functions, such as setting nicknames, and shows how to process user commands in a chat application.
- Terminal Control: Shows how to control and process terminal input by setting the terminal to raw mode.
- modular design: Clear code structure and modular design make the project easy to understand and extend.
Reference Resources:
- You can refer to the smallchat project on GitHub to learn its design and implementation ideas. Download the source code:/antirez/smallchat
- smallChat source code analysis and open source Smallchat for beginners to help you from the source code implementation point of view to explain . Refer to the article:/p/679290450 cap (a poem)/p/667274001
5. Thread pool tool ThreadPool -- 7.9k stars
Project Profile: ThreadPool is a lightweight C++ thread pool implementation designed to simplify multithreaded programming. With this project, developers can learn how to use thread pools to manage concurrent tasks, thus avoiding the creation and destruction of a large number of short-lived threads and improving the concurrency efficiency of the program. The project code is simple and clear , suitable for beginners to understand the basic concepts of thread pooling and its implementation .
Technology involved: C++11 standard, multithreaded programming, task queues, thread synchronization, lock management
Project Highlights:
- Multi-threaded management: Use a thread pool to unify the management of the thread life cycle and reduce the resource overhead of frequent thread creation and destruction.
- Task Queue Design: Implements a task queue mechanism that stores all pending tasks in a task queue, and idle threads in the thread pool can automatically remove tasks from the queue and execute them.
- asynchronous task execution: Support for asynchronous task submission and execution, allowing tasks to be processed in the background and improving the concurrency of the program.
-
thread synchronization: By
std::mutex
、std::condition_variable
etc. to achieve thread synchronization, avoid resource competition, and achieve safe multi-threaded operations. - Simplicity of code: The project code is simple, using 100 lines of code to implement a fully functional thread pool, is an excellent example of understanding the core principles of thread pooling.
reference resource:
- Read the ThreadPool source code to learn in detail about the task scheduling, synchronization mechanism and other design ideas. Download Links :/progschj/ThreadPool
- ThreadPool source code analysis article recommendation:/qq_45014727/article/details/136864717
6. C++11 style HTTP client - HttpClient -- 57 stars
Project Profile: HttpClient is a C++11 style HTTP client library that encapsulates the libcurl library and aims to provide an easy-to-use and modern HTTP client interface. Through this project, developers can easily use the HTTP protocol for GET, POST and other request operations, without having to directly write libcurl's cumbersome code. Project code style in line with the C++11 standard , the code is clear and concise , ideal for learning the basic application of libcurl and the use of C++11 standard library .
Technology involved: C++11, libcurl, HTTP protocol, network programming, JSON parsing (optional)
Project Highlights:
- C++11 style encapsulation: Wrapping libcurl with C++11 language features such as smart pointers, lambda expressions, etc. makes the code more modern and easier to understand.
- Simplifying HTTP requests: Provides an easy-to-use interface for HTTP requests (e.g., GET, POST), encapsulates the complex underlying implementation, and eliminates the need for users to call libcurl functions directly.
- Cross-platform support: libcurl supports multiple platforms, and the HttpClient project can run on multiple operating systems (e.g. Linux, macOS, and Windows).
- Easy to integrate: Because HttpClient is well encapsulated, project code can be easily integrated into other applications for HTTP communication.
- scalability: Supports custom request headers and request parameters that can be used to build RESTful API requests for easy interaction with the server.
reference resource:
- Read the HttpClient source code: you can refer to learn libcurl's encapsulation method and C++11 modern style code implementation. Source code download link:/iEternity/HttpClient
- Refer to the official libcurl documentation for an overview of the features and basic usage of the libcurl library. Link to the documentation:/libcurl/c/
7. MySQL Database Connection Pool - MysqlPool - 65 stars
Project Profile: MysqlPool is a C++-based implementation of MySQL database connection pooling designed to efficiently manage multi-user database access. Connection pooling improves access efficiency by creating and managing multiple database connections, avoiding the overhead of re-establishing a connection for each database request. The project provides a database connection reuse mechanism in a multi-threaded environment by controlling the creation and release of connections, and is ideal for learning how database connection pools are designed and implemented.
Technology involved: C++, MySQL Connector/C, Multithreading Programming, Connection Pool Management, Resource Management
Project Highlights:
- connection reuse: Multiplexing database connections through connection pooling reduces connection overhead per request and effectively improves database access efficiency in multi-user environments.
- Connection Pool Management: Provides dynamic allocation and management of connections and supports database operations in a multi-threaded environment.
- Automatic Recycling and Connection Release: When a database connection is no longer needed, the connection pool recycles it, avoiding waste of resources while improving the utilization of database resources.
- thread safety: Using a locking mechanism to ensure the security of the connection pool in a multi-threaded environment, preventing multiple threads from accessing the same connection at the same time.
- Configuration flexibility: Support for customizing the size of the connection pool , timeout time and other parameters , to facilitate the flexible configuration of the connection pool performance in different application scenarios .
- simple and easy to use: Simplifies the amount of code developers need to interact with the database by encapsulating MySQL's connection management logic.
reference resource:
- Learn MysqlPool source code: suitable for learning the implementation of database connection pooling, source code download link:./primer9999/MysqlPool/
- Check out the official documentation: The official documentation provides detailed APIs and sample code for MySQL Connector/C. Link to documentation:/doc/c-api/8.4/en/
8. smart_ptr implementation -- 89 stars
Project Profile:smart_ptr
is a library of smart pointers implemented in C++ itself, designed to emulate the standard library'sstd::shared_ptr
、std::unique_ptr
The smart pointers are a great way to get started. Implementing smart pointers is a great project to get started with template programming in C++, object lifecycle management, resource management, and the C++11 Rule of Three/Five. This project helps developers gain a deeper understanding of how smart pointers work and how to manage dynamic memory safely and efficiently in C++.
Technology involved: C++11, template programming, object lifecycle management, resource management, Rule of Three/Five (Rule of Three/Five)
Project Highlights:
-
Smart Pointer Basic Implementation: realizes something like
shared_ptr
、unique_ptr
of smart pointer types, showing how memory management is done in C++. - Application of the Rule of Three/Five: The project applies the "rule of three/five", i.e., defining copy constructs, assignment operations, and destructors, to show how to follow the memory management rules of modern C++.
- Template Programming: The smart pointer implementation uses templates to accommodate different types of pointers and objects, demonstrating the power of C++ template programming.
-
reference counting management: Realization of similar
shared_ptr
's reference counting feature ensures that an object releases memory only when the last pointer is destroyed. - Safe Memory Management: Implements an automatic memory release mechanism that avoids the tedious process of manually releasing memory and reduces the risk of memory leaks and dangling pointers.
- RAII principle: Managing resources through RAII (Resource Acquisition i.e. Initialization) ensures object lifecycle and pointer usage security.
reference resource:
- Read smart_ptr source code: the source code allows you to learn the specific implementation of smart pointers. Download link:/shimachao/smart_ptr
9. Linux network programming framework lce -- 81 stars
Project Profile: lce is a high-performance C++ network programming framework designed on the basis of theReactor mode For event processing , supports a variety of I/O models , and includes a thread pool and lock-free data structures , designed to achieve asynchronous non-blocking high concurrency processing . The project is suitable for the development of high-performance web servers and provides developers with a concise and efficient network programming tool.
Technology involved: C++, Reactor Model, Asynchronous I/O, Multithreaded Programming, Lockless Data Structures, Socket Programming, HTTP Protocols
Project Highlights:
-
Multiple I/O model support: Supports a wide range of I/O models (e.g.
epoll
etc.), adapting to different system environments and performance requirements, demonstrating a mastery of I/O multiplexing in network programming. - Reactor Event Handling Mechanism: Reactor pattern for event management , so that the framework can asynchronously handle a large number of concurrent requests , suitable for the needs of highly concurrent servers .
- Thread Pool Design: The framework has a built-in thread pool that can allocate tasks according to the system load, effectively improving the performance of concurrent processing.
- lock-free data structure: Support for data structures such as lock-free queues reduces the use of locks and improves concurrency efficiency, making it suitable for learning and practicing lock-free programming in a multi-threaded environment.
- packet parsing: Built-in packet parsing mechanism for easy chunking of large data and streaming data, a practical function for data transmission and parsing in network communication.
- HTTP protocol support: Supports the basic HTTP protocol , request parsing and response , suitable for building HTTP services or Web services .
reference resource:
- Learn lce source code: you can refer to the source code to learn Reactor pattern, lock-free programming and asynchronous network I/O implementation. Source code download link:/starjiang/lce
10. Simple Web Server - webServer -- 40 stars
Project Profile: This project is a simple web server using theepoll cap (a poem)thread pool It realizes efficient concurrent processing, supports HTTP GET and POST requests, and can parse and return HTML, JPG, PNG, ICO, MP3, JS, CSS and other files. For POST request processing, the server integrates theCGI Functionality, the ability to process user-submitted data and return the results of calculations. The project is suitable for beginners to learn the basic principles and implementation of Web servers.
Technology involvedC++, epoll, thread pooling, socket programming, HTTP protocols, CGI processing.
Project Highlights:
- epoll + thread pool architecture: Combines epoll and thread pooling to achieve highly concurrent network request processing, making full use of system resources, suitable for learning efficient I/O and multi-threaded programming.
- HTTP request parsing: Supports HTTP GET and POST requests, handles loading and responding to static resources, and demonstrates a basic implementation of HTTP request parsing.
- Multi-file type support: Can parse and return HTML, JPG, PNG, ICO, MP3, JS, CSS and other file types , suitable for building a simple static resource server .
- CGI processing: Uses a CGI server to process data in a POST request, perform calculations, and return results, demonstrating how to integrate CGI functionality into a Web server.
- Document Parsing and Response: The project implements basic file parsing functionality, which can return the corresponding file content according to the request type, demonstrating the fundamentals of file parsing and HTTP response.
reference resource:
- Look at the webServer source code: you can refer to learn the basic structure of the web server, epoll I/O multiplexing, and HTTP request parsing and processing. Download the source code:/niliushall/webServer
11, simulate baidu.com file transfer and download system - IM - 51 stars
Project ProfileIM is a simple file transfer and download system based on C/S mode, which mimics the core functions of Baidu.com, aiming to provide users with a convenient file storage and management experience. The project contains functional modules such as secure login, large file transfer, second transfer, incremental upload and file time machine, which can meet the basic cloud storage needs. The modularized design of the system is suitable for developers learning network transmission, file management and incremental data update.
Technology involvedC++, Socket Programming, Multithreading, Hash Algorithms, Intermittent Transfer, Encryption, CGI Handling
Project Highlights:
- Secure Login: User authentication mechanisms ensure secure access to data.
- Fast uploading and downloading of large files: Chunked transfers and intermittent transfers support efficient large file transfers.
- second transmission function: Avoid duplicate uploads, same files can be uploaded quickly in seconds.
- Incremental upload: Only the changed portion is transmitted, saving bandwidth resources.
- Document Time Machine: Supports file history version management and recovery functions.
reference resource:
- See IM source code: learn the basic implementation of file management, incremental transfers and network transfers through source code. Download link:/foshougua/network-dash
Second, medium difficulty (suitable for school recruiting resume writing) -- 11.4k stars
1、Mini STL library MyTinySTL
Many people say they don't know what to do with C++ after learning it. I think the first good opportunity to practice after learning C++ is to try to implement a small STL library by yourself. Here we recommend a project MyTinySTL, which uses C++11 to rewrite a small STL (container library + algorithm library). The code structure is clear and standardized, contains Chinese documentation and comments, and comes with a simple test framework, very suitable for newcomers to learn and reference!
Involves technology:C++11 Template programming, memory management techniques, container implementations (e.g., vector, list, deque, etc.), algorithm implementations (e.g., sort, find, etc.), iterator design, adapter patterns, etc.
Project Highlights:
- Configurator: Implement a memory allocator to manage memory allocation and release, demonstrating an understanding of memory management.
- Container: Implement common STL containers such as vector, list, deque, map, set, unordered_map, unordered_set, and basic_string, demonstrating an understanding of the internal structure and operations of containers.
- Iterator: Implements an STL-style iterator that supports traversal and manipulation of various containers.
- Algorithm: Implement basic algorithms, numerical algorithms, set algorithms, heap algorithms, etc., demonstrating competence in algorithm design and implementation.
- Imitation Functions: Implement a variety of functional objects and hash functions to support algorithms and container customization operations.
- Adapter: Implement container adapters (e.g., stack, queue, priority_queue) and iterator adapters (e.g., reverse_iterator), demonstrating application of design patterns and adapter patterns.
Reference Resources:
- MyTinySTL GitHub project address :/Alinshans/MyTinySTL
- The MyTinySTL project implementation directory is as follows:
2. File transfer server (FTP-based)
Project Profile: Implement a file transfer server based on the FTP protocol from scratch, enabling clients to perform file upload, download and management operations over the network. This project will help you master the core concepts and implementations of network communications, file system operations, and multi-process programming. By implementing this project, you can demonstrate your ability to design and implement high-performance network systems and file management.
Technology involved: C++11, multi-threaded programming, network programming, socket programming, file system operations, FTP protocols, security mechanisms, and more.
Project Highlights:
- Standard Protocol Implementation: Demonstrate your understanding and ability to apply standard network protocols by implementing the FTP protocol.
- file system operation: Demonstrate your understanding of file system operations by implementing functions such as file uploading, downloading, deleting, and directory browsing.
- concurrent connection processing: Demonstrate your mastery of concurrent programming by using multiprocessing techniques to handle multiple client connections.
- security mechanism: Enables user authentication and transmission encryption (e.g. TLS/SSL) to ensure secure data transmission.
- Fault tolerance and error handling: Implement robust error handling mechanisms to ensure stable operation of the system under various abnormal conditions.
- high performance: Optimize transfer efficiency and concurrent processing capabilities, demonstrating your competence in high-performance system design.
reference resource:
- Refer to RFC 959 (FTP Specification) for details on the standard protocol for FTP./doc/html/rfc959
- Here's a recommended project video that teaches you to implement a file transfer server from 0 to 1. Get the link:/s/n0guXDNx-PAT2v5q2ZV2pg
3. Instant messaging system - Linux-Timely-Communication-Project - 66 stars
Project Profile: Linux-Timely-Communication-Project is an instant messaging system developed on Linux platform based on C/C++ language. The project utilizes thelibevent Perform event-driven network programming, combiningmulti-threaded Handles highly concurrent requests withMySQL Database for user data storage and management. This project implements a basic chat system framework, suitable for learning how to design and implement network communication, database operation and multi-threaded synchronization and management, is a classic example of instant messaging project under Linux.
Technology involved: C/C++, libevent, Linux multithreading, MySQL database, socket programming, event-driven modeling.
Project Highlights:
- event-driven network model: Utilizes libevent to implement I/O multiplexing and an event-driven network model to efficiently manage user connections and messaging, suitable for learning event-driven programming.
- Multi-threading support: Uses multithreading to handle concurrent client connections and improve system responsiveness, while demonstrating the design of thread synchronization and locking mechanisms.
- MySQL Database Integration: Achieve persistent data management by storing user information, message logs, and more with MySQL, showing how to integrate database operations in a C/C++ project.
- User authentication and management: It supports basic functions such as user registration and login to manage user sessions, and is a good example for realizing user management.
- message sending and receiving function: Implement basic point-to-point message sending and receiving functionality to provide sample code for the core functionality of the instant messaging system.
- Cross-platform capabilities: Thanks to the libevent wrapper, the project compiles and runs on different Linux systems.
reference resource:
- Linux-Timely-Communication-Project source code download: suitable for in-depth study of network programming, database interaction and multi-threaded integrated implementation. Download link:/YanMario/Liunx-Timely-communication-project
- Official libevent documentation: Understanding libevent's event-driven model, link to documentation:/libevent/content/
4. Web server TinyWebServer -- 16.8k stars
Project Profile: C++ lightweight web server under Linux , help beginners quickly practice network programming , build their own server applications . Project through the implementation of thread pooling , non-blocking socket , epoll and other technologies to provide efficient concurrent processing capabilities , and support for HTTP request resolution and user authentication functions .
Technology involved: C++11, multi-threaded programming, network programming, socket programming, HTTP protocols, database access, logging systems, and more.
Project Highlights:
- HTTP request parsing: Demonstrate your understanding of the HTTP protocol by parsing HTTP request messages using state machines, with support for parsing GET and POST requests.
- user authentication: Access the server database to realize web-side user registration and login functions, demonstrating your mastery of database operations.
- file transfer: You can request server image and video files to realize the file transfer function.
- concurrency model: Demonstrate your understanding and ability to apply high concurrency processing using the concurrency model of thread pooling + non-blocking sockets + epoll (implemented in both ET and LT) + event handling (implemented in both Reactor and simulated Proactor).
- log system: Implement a synchronous/asynchronous logging system to record server operational status and demonstrate your understanding of log management.
- high performance: Webbench stress-tested to achieve tens of thousands of concurrent connections for data exchange, demonstrating your ability to design high-performance systems.
Project framework diagram:
reference resource:
- Source code download link:/qinguoyi/TinyWebServer
5. Simple web library Handy -- 4.6k stars
Project Profile: Handy is a very simple network library , 10 lines of code to write a complete echo server , the use of c++11 syntax to achieve a total of only 2,000 lines of code , there is a single ten million connection example , in addition to the implementation of the lockless logging system and so on.
It supports a wide range of platforms and protocols and has very high concurrency performance. By implementing this project, you can demonstrate your ability to design and implement high-performance networked systems and master core concepts and implementations of network communications, event-driven programming, and asynchronous I/O.
Technology involved: C++11, Socket Programming, Event Driven Programming, Multi-Threaded Programming, Asynchronous I/O, OpenSSL, Protobuf, Timers, Logging Systems.
Project Highlights:
- high performance: Using epoll on Linux and kqueue on MacOS, it supports millions of concurrent connections on a single machine with excellent performance.
- Elegant Exit: Supports a graceful exit mechanism that allows a program to perform a safe resource release and exit when a specific signal is received.
- half-synchronous, half-asynchronous processing: Manage network I/O asynchronously and process requests synchronously, simplifying the writing of server processing logic.
- Protobuf Support: Supports message encoding and decoding using Protobuf to improve data transfer efficiency.
- OpenSSL Support: Asynchronous connection management with support for OpenSSL connections to ensure secure data transfer.
- UDP Support: The UDP protocol is supported, and the UDP client uses the connect method, which is similar to TCP.
- simple and easy to use: The API is designed to be clean and simple, allowing developers to build a complete server with only a small amount of code.
Reference Resources:
- If you are a beginner, it is recommended to get handy network library this project, and handy has more examples that can help developers step by step to master the skills of network programming. Source code download link:/yedf/handy
6, mini muduo network library
Project Profile: Implement a simple high-performance networking library from scratch, similar to muduo. this project will help you master the core concepts and implementations of network programming, such as high concurrency processing, event-driven programming, and multithreaded programming. By implementing this project, you can demonstrate your ability to design and implement high-performance networking systems.
Technology involved: C++11, multi-threaded programming, network programming, epoll, Reactor pattern, timers, logging systems, etc.
Project Highlights:
- high performance processing: By employing the Reactor pattern and epoll, you can efficiently handle a large number of concurrent connections, demonstrating your competence in high-performance network programming.
- Multi-threading support: Implement a thread pool to improve concurrent processing and demonstrate your mastery of multithreaded programming.
- modular design: Demonstrate your software engineering skills with a clear project structure and a modular design for easy expansion and maintenance.
reference resource:
- muduo source code learning: an excellent C++ networking library, provides detailed design documentation and code implementation, great for reference and learning. muduo project link:/chenshuo/muduo
- muduo video recommendation: from 0 to 1 hand to teach you to realize muduo network library, the video reduces the difficulty of learning, very suitable for beginners. (Personally, I think you can learn the muduo library just by watching this video.) If you want to get the link to this video, you can visit :
/s/n0guXDNx-PAT2v5q2ZV2pg
7. HighPerformanceConcurrentServer -- 514 stars
Project Profile: HighPerformanceConcurrentServer is a high-performance concurrent web server framework based on C++11 and combining some of the C++14/17 features , including the logging system , thread pools , memory pools , timers and network I/O and other modules . The project is well modularized, with low coupling and high cohesion between modules, which can be used as a whole or individually as needed. The server uses epoll to implement network I/O and adopts the master-slave Reactor model to provide efficient concurrent processing capability. The project is suitable for learning and understanding the architectural design, concurrency control and resource management of high-performance servers.
Technology involvedC++11/14/17 standards, multithreaded programming, asynchronous I/O, epoll, Reactor model, memory pools, timers, logging systems, unit testing
Project Highlights:
- modular design: The project implements a variety of functional modules (e.g., logging, thread pooling, memory pooling, timers, network I/O, etc.), which are independent of each other and can be combined on demand, demonstrating good architectural design and code reusability.
- Master-Slave Reactor Model: The epoll-based LT mode realizes I/O multiplexing and adopts a master-slave Reactor design, which improves network I/O performance and is suitable for learning the network model of high-performance concurrent servers.
- Synchronous and Asynchronous Logging Systems: Support synchronous and asynchronous logging to ensure high performance while meeting the different needs of logging , to demonstrate the logging system design and optimization ideas.
- Efficient Memory Pool: Memory pools are managed using a combination of hash tables and chained lists to reduce memory fragmentation and improve memory management efficiency, making them suitable for learning about optimal design of memory management.
- Thread Pool Design: Built-in thread pool , support arbitrary task parameters and return results management , suitable for task scheduling in a highly concurrent environment .
- database connection pool: Integrate database connection pooling functionality for easy management and reuse of database connections to improve database access performance.
- Unit Testing and Performance Testing: The project conducted unit and performance tests for each functional module and the overall HTTP server to ensure the correct functionality of the modules and the efficiency of the system.
- Powerful Timer: A timer based on a minimal heap implementation that supports rich features such as multi-threaded execution, delayed task execution, and periodic tasks, demonstrating the design of timed task management.
reference resource:
- Learn HighPerformanceConcurrentServer source code: the project code structure is clear, suitable for learning high concurrency server multi-threaded processing, I / O multiplexing, memory management and logging optimization and other key technologies. Source code download link:/CandyConfident/HighPerformanceConcurrentServer
8. Dual-end instant messaging software IM
Project Profile: IM is a small instant messaging software project, implemented in C, with about three thousand lines of code. The project provides dual-end (client and server) instant messaging functionality, support for basic message sending and receiving, it is an excellent introduction to learning network programming and communication protocols. The project related B station video explains in detail, new developers can watch the video to learn the project implementation ideas and technical details.
Technology involved: C language, socket programming, TCP/IP protocols, multithreaded programming, network communications
Project Highlights:
- two-terminal communication: Realizes the function of two-way instant messaging between the client side and the server side, which is suitable for learning network programming and communication protocols.
- Multi-threading support: Manage multiple client connections using multithreading on the server side, suitable for learning basic multithreading programming.
- Message sending, receiving and processing: Supports basic message sending and receiving, demonstrating the design of communication protocols and message handling mechanisms.
- Code Streamlining: The whole project is only three thousand lines of code, clear structure, easy for newcomers to understand and learn.
- video tutorial: Station B has a video explanation of the project to help beginners quickly get started with the design and implementation of the project.
reference resource:
- B Station Video Search"[Three thousand lines of code for small projects]CLanguage-enabled dual-ended instant messaging software":Learn the details and key techniques of project realization。
- Video Get Link:/video/BV1Hi4y137zg/?spm_id_from=333.
III. Difficult Difficulty (advanced, also suitable for writing resumes)
1. RPC framework - 1.3k stars
Project Profile: Implement a Remote Procedure Call (RPC) framework that enables programs on different hosts to call each other's functions over the network. This project will help you master the core concepts of network communication, serialization, multi-threaded programming, and protocol design, demonstrating your ability to design and implement high-performance distributed systems.
Technology involved: C++, network programming, serialization/deserialization, multithreaded programming, protocol design, data consistency, and more.
Project Highlights:
- concurrent processing: Demonstrate your mastery of concurrent programming by using multithreading techniques to handle multiple client requests.
- Serialization/Deserialization: Achieve efficient data serialization and deserialization to ensure data integrity and efficiency in network transmission.
- protocol design: Design and implement efficient communication protocols to ensure efficient transfer of data between client and server.
- data consistency: Ensure consistency and reliability of remote invocation requests and responses in a distributed environment.
- Distributed Architecture Design: Implement cross-host remote procedure calls, demonstrating your understanding and ability to apply distributed systems architecture.
- high availability: Ensure high availability of RPC services during network fluctuations or node failures by implementing connection pooling and retry mechanisms.
- high performance: Optimize network communications and data processing efficiency, demonstrating your competence in high-performance system design.
reference resource: Refer to tinyrpc and other lightweight RPC frameworks to learn their design ideas and specific implementation details. Combined with distributed systems related books, in-depth understanding of the principles and techniques of RPC framework. Source code download link:/Gooddbird/tinyrpc
tinyrpc Project Overview:
Schematic diagram of tinyrpc RPC call execution:
2. Distributed file storage systems
Project Profile: Design and implement a distributed file storage system that enables multiple servers to work together for file storage and management. Users can perform file upload, download and management operations over the network. Through this project, you will learn how to build an efficient distributed system and master the techniques of network communication, multi-threaded programming and file system operation.
Technology involvedC++, network programming, file system operations, distributed systems basics, data consistency, load balancing, and more.
Project Highlights:
- Distributed Architecture Design: Implement distributed storage and management of files, demonstrating your understanding and ability to apply distributed systems architecture.
- high availability: Ensure high availability of data in case of node failure through multi-copy storage and fault tolerance mechanisms.
- concurrent processing: Demonstrate your mastery of concurrent programming by using multithreading techniques to handle multiple client connections and file manipulation requests.
- file system operation: Demonstrate your understanding of file system operations by implementing functions such as file uploading, downloading, deleting, and directory browsing.
- data consistency: Implement data consistency and fault tolerance mechanisms to ensure data reliability in a distributed environment.
- high performance: Optimize data transfer and storage efficiency and demonstrate your competence in high-performance system design.
- load balancing: Distribute data and requests among multiple storage nodes through a load balancing mechanism to improve system performance.
reference resourceMooseFS is an open-source distributed file system that is based on the architecture and implementation of MooseFS and other open-source distributed file systems , to learn its design ideas and specific implementation details. Combined with distributed systems and file storage related books , in-depth understanding of the principles and techniques of distributed file storage.MooseFS download link:/moosefs/moosefs
3. Distributed caching system
Project Profile: Build a distributed caching system that supports fast caching and access of data across multiple servers. With this project, you will learn how to design and implement a high-performance, highly available distributed caching system that solves the problem of data storage and fast access.
Technology involved: C++, network programming, multi-threaded programming, distributed systems, caching mechanisms, data consistency, load balancing, etc.
Project Highlights:
- Distributed Architecture Design: Implement cached data storage across multiple nodes, demonstrating your understanding and ability to apply distributed systems architecture.
- high availability: Ensure high availability of the caching system in case of node failure through multi-copy storage and failure recovery mechanisms.
- concurrent processing: Demonstrate your mastery of concurrent programming by using multithreading techniques to handle large numbers of concurrent cache requests.
- caching mechanism: Implement efficient data caching and expiration policies to ensure speed and accuracy of data access.
- data consistency: Ensure consistency of cached data in a distributed environment through consistency protocols and data synchronization.
- high performance: Optimize data transfer and access efficiency and demonstrate your competence in high-performance system design.
- load balancing: Distribute requests among multiple cache nodes through a load balancing mechanism to improve system performance.
reference resource: Reference to Redis and other open source distributed caching system architecture and implementation methods , to learn its design ideas and specific implementation details. Combined with distributed systems and cache-related books , in-depth understanding of the principles and techniques of distributed caching systems.Redis project links:/redis/redis
4. P2P file-sharing system (UDP-based)
Project Profile: Develop a file sharing system using a P2P architecture that allows multiple nodes to transfer and share files over the UDP protocol. This project will equip you to design an efficient and reliable file sharing system covering all aspects from network communication to data integrity.
Technology involved: C++, network programming, UDP protocols, multi-threaded programming, P2P networking, file system operations, data integrity checking, NAT penetration, sharded transfers, and more.
Project Highlights:
- P2P Architecture Design: Enable file sharing between nodes, demonstrating your understanding and ability to apply P2P network architectures.
- UDP communications: Demonstrate your mastery of connectionless network communication by using the UDP protocol for data transfer.
- concurrent processing: Demonstrate your competence in concurrent programming by using multithreading techniques to handle a large number of concurrent file transfer requests.
- file system operation: Demonstrate your understanding of file system operations by implementing file uploading, downloading, deleting, and directory browsing.
- data integrity: Ensure the integrity and reliability of file transfers through data validation mechanisms.
- high performance: Optimize data transfer and processing efficiency, enable fast file sharing, and demonstrate your competence in high-performance system design.
- load balancing: Distribute transmission tasks among multiple nodes through a load balancing mechanism to improve system performance and reliability.
- NAT penetration: Realize NAT penetration technology to enable smooth communication between nodes in complex network environments.
- flow control: Implement traffic control mechanisms to ensure rational utilization of network resources and transmission stability.
- slice transport: Split large files into smaller chunks for transmission to improve transmission efficiency and reliability.
reference resource:
The following are some of the P2P file sharing system projects that can be referred to, which provide a wealth of experience and technical details in terms of architectural implementation:
2sjha/mini-p2p-file-sharing
- multilingualism:C++
- synopsis: A mini P2P file sharing application for beginners. Project structure is simple , including basic P2P network programming and socket communication .
- specificities: Ideal for learning basic UDP communication and P2P file sharing mechanisms.
- download link:/2sjha/mini-p2p-file-sharing
bchu7796/p2p-file-sharing
- multilingualism:C++
- synopsis: Shows how to use multithreading for concurrent requests and UDP for data transfer. The project is of moderate complexity and includes multithreading and data transfer optimizations.
- specificities: Suitable for developers with some experience to learn in-depth details of the implementation of P2P file sharing.
- download link:/bchu7796/p2p-file-sharing
Peer2Peer_File_Sharing_System
- multilingualism:Python
- synopsis: A decentralized P2P file sharing system that uses UDP and TCP protocols for information and file sharing, suitable for understanding basic P2P file sharing and network programming concepts.
- specificities: Efficient P2P file transfer with intelligent file handling and concurrent processing.
- download link: /raghxvnair/Peer2Peer_File_Sharing_System
P2P-File-sharing
- multilingualism:Java
- synopsis: A P2P project created for a University of Florida computer networking course that allows any number of nodes to share files, covering basic P2P communication and file sharing mechanisms.
- specificities: For beginners and intermediate developers with an understanding of P2P network architecture and UDP programming.
- download link:/shantanu-ai/P2P-File-sharing
Some practical advice from what I've learned doing projects:
1. Write the project in a Linux environment:
- Most enterprise level projects are deployed on Linux servers, so you have to be familiar with the Linux environment. I recommend Ubuntu, and you need to be proficient with compilation toolchains such as gcc/g++, make, and makefile so that you can compile and deploy projects with ease. If you are not familiar with how to build a programming environment on Linux, you can read this article, it will teach you in detail to build a development environment from scratch, to ensure that you will be able to read it.
2. Utilization of existing projects:
- It is not necessary to realize a project from 0 to 1, which is too difficult (except for big brother). You can first download other people's excellent projects, run the code yourself, configure the environment, run the code, look at the results, and then study other people's code to achieve what function, how to achieve, whether it can be optimized, add some of their own unique thinking. This way you have a wealth of content to talk to the interviewer.
3. Practical experience in projects:
- As an example, I once showed a project on my resume that was based on implementing an HTTP server with online large integer arithmetic functionality. At that time, I was 0 to 1 implementation of a MiniMuduo as a server framework, and based on its implementation of HTTP server, but also refer to the Tinyhttpd project, adding CGI technology, support for more than 10,000 digits of the number of four operations.
4. Reflection and optimization in projects
-
When doing a project, be sure to think on your feet. For example, to do a HTTP server project, be sure to use wrk and other pressure testing tools for performance testing to optimize its QPS (query rate per second). After I did the project at that time, I interviewed with Baidu in the pre-fall recruitment period, and the interviewer asked a lot of detailed questions about the project, such as the project difficulties, how the performance of the HTTP server was, how much the QPS was, how to optimize to improve the QPS, where the performance bottleneck was, why CGI technology was used, what CGI was, and what problems were solved, and so on.
-
There were some questions that I didn't even consider at that time, and I didn't review and summarize them seriously, which led to poor performance in the interview, and the result was predictable. Later, when I interviewed with a security company, I answered in detail in the second interview how to conduct performance testing, what tools I used, how to optimize, how many QPS I achieved, how CGI was implemented, etc., which made the interview process go very smoothly.
-
For those who are interested, you can check out my previous school recruiting projects (2 of them), github link :./xiaokangcoding/myproject
Summary:
Finding the right C++ projects to practice on will not only make your resume look better, but will also actually improve your development skills. These 23 projects range from simple to advanced, so students at different stages of development will find something suitable. Remember, it's not the number of projects that counts, it's doing a solid job. The key is to write good code and pay attention to details.
Every time you finish a project, organize the documentation, summarize the pitfalls you encountered and the solutions, all of these will add a lot of points for you in the interview. I hope this C++ project recommendation can help you stand out in the school recruitment! Good luck to all of you in getting your dream Offer!
Finally:
If you find this article helpful, remember to give me a like 👍 and in reading and share it with your buddies who need it!
- Subscribe to my public: I'll regularly update more Linux and C++ related programming stuff, share advanced tips and real-world experience, and help you learn something useful every day.
- More exciting content for you to discover: Click to follow, the first time to receive the latest technical articles pushed, in the programming master of the road, we walk hand in hand!
- Interaction and Feedback: If you have any questions or suggestions, feel free to leave a comment, I'm really looking forward to talking with you!
What can I learn by paying attention?
This place not only provides high quality programming knowledge, but also combines real projects and common interview questions to bring you a comprehensive learning path. If you are learning programming, preparing for an interview, or want to improve your skills at work, this is definitely a good helper for you to improve yourself.
How do I follow my public number?
It's very simple! Scan the QR code below to follow with one click.
In addition, Xiaokang has recently created a technical exchange group dedicated to discussing technical issues and answering readers' questions. When reading the article, if there is any knowledge point that you do not understand, you are welcome to join the exchange group to ask questions. I will try my best to answer for everyone. I look forward to making progress with you all!