Senior C Engineer Interview Questions & Answers
40 questions for Senior C Engineer interviews — 19 medium, 21 hard.
About the Senior C Engineer role
A senior C engineer owns large C codebases and makes design decisions on memory ownership, module boundaries, concurrency and performance. They review code, set safety practices such as sanitizer builds and static analysis, mentor juniors and lead debugging of hard crashes and leaks. Telecom, networking, storage and automotive companies rely on such engineers for stable, long lived products. They also plan releases and estimate technical work.
Find the next greater element for every array element using a monotonic stack.
Show answer
Evaluate a postfix expression of single digit numbers using a stack.
Show answer
Find the lowest common ancestor of two nodes in a binary search tree.
Show answer
Valgrind reports invalid read of size 4 after free. How do you fix it?
Show answer
What makes a good hash function?
Show answer
Describe a time you had to make a trade-off between memory and speed.
Show answer
Why are self-balancing trees like AVL and red-black trees needed?
Show answer
Implement your own version of memcpy.
Show answer
Quicksort in your code becomes very slow on already sorted input. Why and how do you fix it?
Show answer
You must schedule the maximum number of non-overlapping meetings in one room. What algorithm do you use?
Show answer
You need to find the shortest route between two cities on a map with distances. Which algorithm do you use and why?
Show answer
What is the master theorem used for?
Show answer
Write BFS on a graph stored as an adjacency matrix.
Show answer
A DP solution for a large grid uses too much memory. How can you reduce it?
Show answer
You must design an LRU cache in C with O(1) get and put. How would you build it?
Show answer
How do you convert an infix expression to postfix?
Show answer
What is a hash table and how are collisions handled?
Show answer
Tell me about a time you chose the right data structure under pressure.
Show answer
Tell me about a time you explained a complex data structure to your team.
Show answer
What is amortised analysis? Give an example.
Show answer
What is the difference between open addressing and separate chaining in terms of performance?
Show answer
What is a heap and how does it implement a priority queue?
Show answer
A build tool must compile modules in the correct dependency order and report circular dependencies. How would you design it?
Show answer
How are graphs represented in C?
Show answer
What is a ring buffer and why is it common in embedded systems?
Show answer
What is the union-find data structure?
Show answer
Memory use of a long running C service grows every hour. How do you investigate?
Show answer
A recursive tree traversal crashes on a very large, skewed tree. How do you fix it?
Show answer
A function returns the address of a local array and the caller gets wrong data. Why?
Show answer
Write a C program that counts lines, words and characters in a file.
Show answer
How does Dijkstra's algorithm work?
Show answer
Compare quicksort, merge sort and heap sort.
Show answer
You need to implement a queue using two stacks. How does it work and what is its cost?
Show answer
Write a simple fixed-size memory pool allocator in C.
Show answer
Solve the 0/1 knapsack problem in C with a 1D DP array.
Show answer
How would you find the kth smallest element in an unsorted array efficiently?
Show answer
Implement union-find with path compression and union by rank.
Show answer
Two programs on different machines exchange a binary struct and values come out wrong. What is happening?
Show answer
A Dijkstra implementation gives wrong distances on a graph with a few negative edges. Why?
Show answer
Frequently asked questions
What does a Senior C Engineer do?
A senior C engineer owns large C codebases and makes design decisions on memory ownership, module boundaries, concurrency and performance. They review code, set safety practices such as sanitizer builds and static analysis, mentor juniors and lead debugging of hard crashes and leaks. Telecom, networking, storage and automotive companies rely on such engineers for stable, long lived products. They also plan releases and estimate technical work.
Which skills are tested in a Senior C Engineer interview?
Expect questions on System design in C, Code review, Static analysis, Concurrency, Mentoring. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a Senior C Engineer interview?
Revise Pointers and Memory Management, Sorting, Searching and Dynamic Programming, Trees and Graphs, Stacks, Queues and Hashing first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.