C Programming with DSA Technical Round Questions & Answers
40 questions for the technical round stage — 4 easy, 29 medium, 7 hard.
About the technical round round
The technical round is the core of a C Programming with DSA interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
Tips for the technical round round
- Say your approach out loud before you start writing.
- After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question.
- Pick one project you can explain end to end, including what you would do differently.
- If you get stuck, explain what you would try next instead of going silent.
What is a trie and when is it better than a hash table?
Show answer
Find the length of the longest substring without repeating characters in C.
Show answer
What is structure padding and how can you reduce it?
Show answer
What is the difference between fseek, ftell and rewind?
Show answer
A hash table becomes slow as more data is inserted. What is wrong?
Show answer
A UART receive buffer in firmware sometimes loses or duplicates bytes. How would you fix it?
Show answer
A program crashes with a segmentation fault. How do you find the cause?
Show answer
Valgrind reports invalid read of size 4 after free. How do you fix it?
Show answer
What is the sliding window technique?
Show answer
Write code to check whether the machine is little endian or big endian.
Show answer
What is the difference between stack and heap allocation?
Show answer
Write Kadane's algorithm in C.
Show answer
Find the next greater element for every array element using a monotonic stack.
Show answer
Write C code to count the number of set bits in an integer.
Show answer
A recursive tree traversal crashes on a very large, skewed tree. How do you fix it?
Show answer
How do you find the middle of a linked list in one pass?
Show answer
You need to look up 10 lakh user ids quickly in a C program. What structure do you choose?
Show answer
What is a prefix sum array and why is it useful?
Show answer
Write a C program that counts lines, words and characters in a file.
Show answer
What is the union-find data structure?
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
Compare quicksort, merge sort and heap sort.
Show answer
Remove the nth node from the end of a linked list in one pass.
Show answer
What is the difference between a macro and an inline function?
Show answer
Rotate an array to the right by k positions in O(n) time and O(1) space.
Show answer
Write a header guard and explain why it is needed.
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 the difference between const int *p, int *const p and const int *const p?
Show answer
What does the static keyword do in different contexts?
Show answer
How would you detect if two linked lists intersect and find the intersection node?
Show answer
Which gcc flags would you use to build and debug a C program safely?
Show answer
A strlen call crashes on a buffer received from a network packet. What is wrong?
Show answer
How would you check whether a binary tree is a valid BST?
Show answer
Your program sorts 1 crore integers in the range 0 to 999 and qsort is too slow. What would you do?
Show answer
A build tool must compile modules in the correct dependency order and report circular dependencies. How would you design it?
Show answer
You need to find whether any two numbers in an unsorted array sum to a target. Compare approaches.
Show answer
What is the difference between strcpy, strncpy and snprintf for copying strings?
Show answer
A program that writes logs with fprintf loses the last lines when it crashes. Why, and how do you fix it?
Show answer
Frequently asked questions
What happens in the C Programming with DSA technical round round?
The technical round is the core of a C Programming with DSA interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
How do I clear the technical round round?
Say your approach out loud before you start writing. After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question. Pick one project you can explain end to end, including what you would do differently.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.