huihut/interview
📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.
Slowing — last commit 9mo ago
weakest axisnon-standard license (Other); no tests detected…
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
last commit was 9mo ago; no CI workflows detected
- ✓Last commit 9mo ago
- ✓20 active contributors
- ✓Other licensed
Show all 8 evidence items →Show less
- ⚠Slowing — last commit 9mo ago
- ⚠Concentrated ownership — top contributor handles 75% of recent commits
- ⚠Non-standard license (Other) — review terms
- ⚠No CI workflows detected
- ⚠No test directory detected
What would change the summary?
- →Use as dependency Concerns → Mixed if: clarify license terms
- →Deploy as-is Mixed → Healthy if: 1 commit in the last 180 days
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/huihut/interview)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/huihut/interview on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: huihut/interview
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/huihut/interview shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Slowing — last commit 9mo ago
- Last commit 9mo ago
- 20 active contributors
- Other licensed
- ⚠ Slowing — last commit 9mo ago
- ⚠ Concentrated ownership — top contributor handles 75% of recent commits
- ⚠ Non-standard license (Other) — review terms
- ⚠ No CI workflows detected
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live huihut/interview
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/huihut/interview.
What it runs against: a local clone of huihut/interview — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in huihut/interview | Confirms the artifact applies here, not a fork |
| 2 | License is still Other | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 287 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of huihut/interview. If you don't
# have one yet, run these first:
#
# git clone https://github.com/huihut/interview.git
# cd interview
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of huihut/interview and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "huihut/interview(\\.git)?\\b" \\
&& ok "origin remote is huihut/interview" \\
|| miss "origin remote is not huihut/interview (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Other)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Other\"" package.json 2>/dev/null) \\
&& ok "license is Other" \\
|| miss "license drift — was Other at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "README.md" \\
&& ok "README.md" \\
|| miss "missing critical file: README.md"
test -f "Algorithm/QuickSort.h" \\
&& ok "Algorithm/QuickSort.h" \\
|| miss "missing critical file: Algorithm/QuickSort.h"
test -f "DataStructure/BinaryTree.cpp" \\
&& ok "DataStructure/BinaryTree.cpp" \\
|| miss "missing critical file: DataStructure/BinaryTree.cpp"
test -f "DesignPattern/SingletonPattern/Singleton.h" \\
&& ok "DesignPattern/SingletonPattern/Singleton.h" \\
|| miss "missing critical file: DesignPattern/SingletonPattern/Singleton.h"
test -f "STL/STL.md" \\
&& ok "STL/STL.md" \\
|| miss "missing critical file: STL/STL.md"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 287 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~257d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/huihut/interview"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
A comprehensive knowledge base and interview preparation resource for C/C++ job seekers, structured as a GitHub repository with implementations of fundamental data structures (binary trees, hash tables, linked lists), sorting/searching algorithms, and design patterns. It serves as both a learning reference and study guide covering language features, STL, system concepts, networking, and database fundamentals needed for technical interviews. Monolithic reference structure: Algorithm/ contains header-only or standalone implementations (BubbleSort.h, QuickSort.h, etc.), DataStructure/ holds core data structure implementations (BinaryTree.cpp, RedBlackTree.cpp, HashTable.cpp), DesignPattern/ organizes pattern examples hierarchically (AbstractFactoryPattern/, AdapterPattern/, ObserverPattern/, SingletonPattern/), and root-level markdown files provide narrative content. No src/build separation; code is example-focused rather than library-packaged.
👥Who it's for
Undergraduate and graduate students preparing for C/C++ technical interviews at tech companies, junior developers transitioning into systems programming, and hiring managers/mentors looking for curated interview content. Users typically have basic programming knowledge but need structured preparation for roles in systems engineering, embedded systems, or performance-critical applications.
🌱Maturity & risk
Actively maintained community project with substantial content (71KB+ C++, organized across Algorithm/, DataStructure/, DesignPattern/ directories) and multilingual documentation (Simplified Chinese primary, English available). Hosted with Docsify for browsable documentation and supports PDF generation via Chrome printing. Not a framework/library but an educational resource with CC BY-NC-SA 4.0 licensing, indicating stable, long-term educational intent rather than traditional software maturity metrics.
No external runtime dependencies or CI/CD pipeline visible—purely static documentation and reference code examples, eliminating dependency risk. Risk is primarily editorial: single-maintainer model (huihut) for content accuracy, potential for interview content to drift from current hiring practices, and minimal test coverage for code examples. Code snippets are illustrative rather than production-validated, so direct copy-paste into production systems without review is inadvisable.
Active areas of work
Repository appears stable in maintenance mode—actively accepting issues and PRs for content corrections and improvements (see issue #12 mentioned in README for discussions). Focus is on accuracy of knowledge summaries and completeness of algorithm/pattern coverage rather than new feature development. No active CI pipeline or automated testing visible in file structure.
🚀Get running
Clone and browse: git clone https://github.com/huihut/interview.git && cd interview. No build step required for learning; read markdown content via GitHub or deploy locally with Docsify: npm install -g docsify-cli && docsify serve . (inferred from README mention of Docsify documentation site). C++ code examples compile standalone with standard toolchain: g++ -std=c++11 Algorithm/QuickSort.h -o quicksort_demo for individual files.
Daily commands:
Individual algorithm files are self-contained and compile with: g++ -std=c++11 Algorithm/<filename>.h. Design pattern examples in DesignPattern/ use CMake: cd DesignPattern && cmake . && make. No executable entry point for the repository as a whole—it's a reference library. To view documentation: open https://interview.huihut.com (Docsify-hosted) or run docsify serve locally after cloning.
🗺️Map of the codebase
README.md— Primary entry point documenting the repository's scope as a C/C++ interview prep resource covering language, data structures, algorithms, system design, and networking fundamentals.Algorithm/QuickSort.h— Core sorting algorithm implementation referenced throughout interview preparation; demonstrates canonical algorithm implementation patterns used across the codebase.DataStructure/BinaryTree.cpp— Fundamental data structure implementation serving as a template for understanding tree-based algorithms and their practical applications in coding interviews.DesignPattern/SingletonPattern/Singleton.h— Design pattern reference showing production-quality C++ idioms that candidates must understand for senior role interviews.STL/STL.md— Comprehensive STL documentation covering the Standard Template Library, essential for understanding modern C++ interview expectations.Problems/KnapsackProblem/pack.cpp— Classic dynamic programming problem implementation demonstrating algorithm problem-solving methodology used throughout the interview prep material.
🧩Components & responsibilities
- Algorithm module (C++ templates, generic programming) — Provides reusable implementations of sorting (QuickSort, MergeSort, HeapSort) and searching (BinarySearch, BSTSearch) algorithms
- Failure mode: Incorrect sorting order or search failure on edge cases (empty arrays, single elements)
- Data Structure module (Pointers, memory management, C++ classes) — Implements fundamental structures (BinaryTree, LinkList, HashTable, Stack) with standard operations
- Failure mode: Memory leaks,
🛠️How to make changes
Add a new sorting algorithm
- Create a new header file in Algorithm/ directory following the pattern of existing sorts (e.g., BubbleSort.h) (
Algorithm/NewSort.h) - Implement the sorting function with template support for generic types, following the style of Algorithm/QuickSort.h (
Algorithm/NewSort.h) - Add documentation explaining time/space complexity and use cases in comments matching existing algorithm headers (
Algorithm/NewSort.h)
Add a new data structure implementation
- Create a new .cpp file in DataStructure/ directory (e.g., DataStructure/Graph.cpp) following patterns from BinaryTree.cpp or LinkList.cpp (
DataStructure/NewStructure.cpp) - Implement core operations (insert, delete, search, traverse) with clear function signatures and test cases (
DataStructure/NewStructure.cpp) - Add inline comments documenting complexity analysis and edge cases similar to existing implementations (
DataStructure/NewStructure.cpp)
Add a new design pattern example
- Create a subdirectory in DesignPattern/ (e.g., DesignPattern/DecoratorPattern/) matching the naming convention (
DesignPattern/PatternName/PatternNameMain.h) - Implement abstract base classes, concrete implementations, and main entry following the pattern of DesignPattern/SingletonPattern/Singleton.h (
DesignPattern/PatternName/implementation.h) - Create a CMakeLists.txt build configuration matching DesignPattern/CMakeLists.txt structure (
DesignPattern/PatternName/CMakeLists.txt)
Add a new interview problem solution
- Create a new subdirectory in Problems/ with descriptive name (e.g., Problems/LongestSubstringProblem/) (
Problems/ProblemName/README.md) - Implement the solution in a .cpp file with clear algorithm explanation and approach documentation (
Problems/ProblemName/Solution.cpp) - Add README.md explaining the problem, approach, complexity analysis following patterns in Problems/KnapsackProblem/README.md (
Problems/ProblemName/README.md)
🔧Why these technologies
- C++ with STL — Primary language for technical interviews at major tech companies; STL coverage ensures candidates understand modern C++ standard library
- Header files (.h) and implementation files (.cpp) — Demonstrates proper C++ separation of interface and implementation for interview best practices
- CMake build system — Portable build configuration allowing candidates to compile and test code across different platforms
- Docsify documentation framework — Provides searchable, navigable documentation format suitable for interview preparation and quick reference
⚖️Trade-offs already made
-
Standalone algorithm/data structure implementations rather than unified library
- Why: Each component is independently understandable for learning purposes without requiring understanding of entire codebase
- Consequence: Code duplication across files; easier learning curve but higher maintenance burden
-
Mix of header-only (.h) and compiled (.cpp) implementations
- Why: Header-only templates enable generic implementations; compiled files provide concrete examples
- Consequence: Build complexity increases; students must understand both compilation models
-
Focus on educational correctness over production optimization
- Why: Repository targets interview preparation where understanding algorithms matters more than micro-optimizations
- Consequence: Code may not be optimal for real-world performance; suitable only for learning contexts
🚫Non-goals (don't propose these)
- Not a production-ready algorithm library (no comprehensive error handling, validation)
- Not a complete compiler/language implementation reference
- Does not cover GPU programming, concurrent/parallel algorithms, or distributed systems in depth
- Not an exhaustive collection of all possible interview questions (representative sample only)
- Does not provide automated testing framework or CI/CD pipeline
- Not a real-time system or embedded systems resource
🪤Traps & gotchas
No build configuration required to read content, but CMake is optional and only configured for DesignPattern/ (not root). Code examples assume C++11/14 compiler availability (specify with -std=c++11 flag). No automated test runners—code correctness is manual responsibility. Docsify requires Node.js runtime if serving locally, but GitHub-hosted version requires no setup. Content is Chinese-first (Simplified Chinese primary, English translated)—English README may lag behind main content updates.
🏗️Architecture
💡Concepts to learn
- Red-Black Tree balancing — Understanding red-black tree properties (color invariants, rebalancing on insert/delete) is essential for grasping STL std::map and std::set internals, frequently asked in interviews probing data structure depth
- Quicksort partitioning strategies (Lomuto vs Hoare) — Partitioning scheme choice affects pivot selection, swaps, and worst-case behavior; mastering both strategies demonstrates algorithmic maturity and ability to optimize for cache locality
- Observer pattern and pub-sub decoupling — Foundation for event-driven systems and reactor patterns used in async I/O frameworks (epoll, kqueue); critical for systems programming and network server design interview questions
- Singleton thread safety and double-checked locking — Meyer's Singleton vs manual locking strategies highlight C++ memory model intricacies and volatile semantics; questions on this reveal understanding of concurrency primitives in C++11+
- Hash table collision resolution (open addressing, chaining) — Underlying mechanism for std::unordered_map; understanding load factor, probe sequences, and rehashing is crucial for performance analysis in system design questions
- Binary tree traversal and Morris inorder traversal — Inorder/preorder/postorder traversals are foundational for tree problems; Morris traversal demonstrates O(1) space tree iteration without recursion or stack, impressing interviewers on optimization knowledge
- Abstract Factory pattern vs Factory Method — Distinguishing when to use family-of-objects (Abstract Factory) vs single-object instantiation (Factory Method) is tested in system design questions about extensibility and coupling reduction
🔗Related repos
donnemartin/system-design-primer— Complementary system design and architecture patterns for backend interview preparation; pairs with this repo's low-level C++ knowledge for full-stack technical readinesskrahets/hello-algo— Alternative algorithm and data structure reference with animated visualizations and multi-language implementations; overlaps heavily but adds visual learning for the same interview topicsTheAlgorithms/C-Plus-Plus— Broader C++ algorithm implementations library; complements this repo's curated interview-focused selection with exhaustive algorithm catalog and community contributionscpp-netlib/cpp-netlib— Production-grade C++ networking library; directly relevant for the 'network programming' section mentioned in repo, bridging interview concepts to practical implementationisocpp/CppCoreGuidelines— Official C++ language best practices and idioms; essential reference for understanding why specific patterns in this repo's code examples are preferred in modern C++
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add unit tests for Algorithm implementations using Google Test framework
The Algorithm/ directory contains 13+ sorting and searching implementations (.h and .cpp files) with no visible test coverage. This is critical for a technical interview prep repo where correctness is paramount. Adding comprehensive unit tests would validate algorithm correctness, serve as executable examples for learners, and catch edge cases (empty arrays, single elements, duplicates). This also models best practices for interview candidates.
- [ ] Create Algorithm/Tests/ directory with CMakeLists.txt for Google Test integration
- [ ] Add test file Algorithm/Tests/SortingAlgorithmsTest.cpp covering BubbleSort.h, InsertSort.h, QuickSort.h, MergeSort.h, HeapSort.h with edge cases (empty, single element, duplicates, reverse sorted)
- [ ] Add test file Algorithm/Tests/SearchAlgorithmsTest.cpp covering BinarySearch.h, SequentialSearch.h, BSTSearch.h, FibonacciSearch.h
- [ ] Integrate tests into root CMakeLists.txt (or create one if missing) to enable CI execution
- [ ] Document test execution in README.md or CONTRIBUTING.md
Create CMakeLists.txt for DataStructure/ directory and add missing implementations for LinkedList and Tree variants
DataStructure/ has isolated .cpp files (BinaryTree.cpp, LinkList.cpp, RedBlackTree.cpp, HashTable.cpp, etc.) without a build system. The file structure shows LinkList.cpp and LinkList_with_head.cpp exist separately but lack executable examples or headers. Creating a proper CMake build and adding missing .h headers + main() examples would make these data structures compilable and testable, improving usability for learners.
- [ ] Create DataStructure/CMakeLists.txt with targets for each data structure
- [ ] Create missing header files: DataStructure/LinkedList.h, DataStructure/BinaryTree.h, DataStructure/RedBlackTree.h, DataStructure/HashTable.h
- [ ] Add DataStructure/Examples/ directory with standalone executable examples (e.g., LinkedListExample.cpp, BinaryTreeExample.cpp) demonstrating insert, delete, search operations
- [ ] Ensure all .cpp files compile cleanly and add basic sanity checks (print traversals, validate invariants)
- [ ] Update DesignPattern/CMakeLists.txt as reference pattern and document in README.md
Add comprehensive README files for Problems/ directory with complexity analysis and solution walkthroughs
Problems/ directory (ChessboardCoverageProblem, KnapsackProblem, NeumannNeighborProblem) contains solutions but minimal documentation. Most subdirectories have README.md, but they lack: algorithm complexity analysis (time/space), step-by-step solution explanation, input/output examples, and difficulty ratings. This is a high-value PR for an interview prep repo, as it transforms raw code into learning material. The existing .exe files suggest these are tested but undocumented.
- [ ] Enhance Problems/KnapsackProblem/README.md with: problem statement, time complexity O(nW) analysis, space optimization trick (1D DP), worked example with n=3 items, w=5 capacity, and 0/1 vs unbounded variants
- [ ] Enhance Problems/ChessboardCoverageProblem/README.md with: recursive divide-and-conquer explanation, complexity O(4^k) proof, diagram showing base case and recursive structure, difficulty rating (Medium)
- [ ] Enhance Problems/NeumannNeighborProblem/README.md with: problem formulation, comparison of Formula/ (closed-form O(1)) vs Recursive/ (O(n)) solutions, when to use each, and coordinate geometry intuition
- [ ] Add missing Problems/README.md index linking all three problems with difficulty and topic tags (DP, Recursion, Math)
- [ ] Consider adding Problems/LeetCode/ or Problems/Classic
🌿Good first issues
- Add unit tests for Algorithm/ implementations: Create a test/ directory with Google Test or Catch2 framework; start with QuickSort.h and BinarySearch.h to validate correctness on edge cases (empty arrays, single elements, duplicates). Links to CI/CD visibility.
- Document time/space complexity for all algorithm headers: Add inline comments to Algorithm/*.h files specifying O() bounds for best/average/worst cases and space usage. Example: QuickSort.h needs 'Average: O(n log n), Worst: O(n²), Space: O(log n)'.
- Create DataStructure/ comparison matrix markdown: Build a table (in DataStructure/README.md or new Comparison.md) comparing BinaryTree.cpp, RedBlackTree.cpp, HashTable.cpp on insertion/deletion/search complexity, rebalancing overhead, and interview frequency.
⭐Top contributors
Click to expand
Top contributors
- @huihut — 75 commits
- @ShayekhBinIslam — 3 commits
- @kwongtailau — 2 commits
- @Charmve — 2 commits
- @DiDongDongDi — 2 commits
📝Recent commits
Click to expand
Recent commits
aba5cd9— Merge pull request #124 from lbx-bot/master (huihut)2128664— 修改文件 (lbx-bot)c3afca8— update docsify (huihut)eda93db— TCP 端到端通信 (huihut)3ecb6a2— fix typeid (huihut)48fd81d— 编译器扩展与标准对齐控制 (huihut)cb34d14— 删除:如何定义一个只能在堆上(栈上)生成对象的类? (huihut)8871b8f— fix Named pipes and Anonymous pipes (huihut)358a4cb— fix Simple Mail Transfer Protocol (huihut)ae64f57— fix typos (huihut)
🔒Security observations
This is an educational repository containing C/C++ interview preparation materials and code examples. The overall security posture is good for a learning resource. The main issues identified are: (1) compiled executables (.exe files) should be removed from version control and replaced with build instructions, (2) the documentation site should implement proper HTTP security headers, and (3) build processes could benefit from automated security scanning. The repository appears to have no hardcoded credentials, secrets, or injection vulnerabilities visible in the provided file structure. As an educational resource without active network services or user data handling, the attack surface is minimal.
- Low · Executable Files in Repository —
Problems/ChessboardCoverageProblem/ChessboardCoverage.exe, Problems/KnapsackProblem/pack.exe, Problems/NeumannNeighborProblem/Formula/Neumann2_3_12.exe, Problems/NeumannNeighborProblem/Recursive/Neumann2_4_12.exe, Problems/RoundRobinProblem/MatchTable.exe, Problems/TubingProblem/Tubing.exe. The repository contains compiled executable files (.exe) which should not be version controlled. These files can pose distribution and integrity risks, and make it difficult to track actual source code changes. Fix: Remove all .exe files from the repository and add *.exe to .gitignore. Provide build instructions instead so users can compile from source. - Low · Missing Security Headers in Documentation —
docs/ directory and deployment configuration. The repository serves documentation via Docsify (https://interview.huihut.com) but no security headers configuration is visible in the provided files. This could expose the site to common web vulnerabilities. Fix: Ensure the documentation site includes proper security headers (Content-Security-Policy, X-Content-Type-Options, X-Frame-Options, Strict-Transport-Security). Configure these in the web server or hosting platform configuration. - Low · No Build System Security Checks —
DesignPattern/CMakeLists.txt and build configuration. CMakeLists.txt is present but no evidence of security scanning, dependency verification, or signed builds in the build configuration. Fix: Integrate security scanning tools into the build process (e.g., clang-analyzer, cppcheck). Consider using dependency scanning and reproducible builds.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.