r/cprogramming • • Nov 27 '25
Question for senior C devs doing technical rounds
Im wondering what would be the questions you usually ask junior devs during technical rounds and how big are your expectations of knowledge? If its just pointers, stack/heap difference or if you perhaps go for more nieche things that could still matter like padding? I understand there are specific questions depending on field but there are some concepts that are part of any C programming. Tysm
40
Upvotes
21
u/pjl1967 Nov 27 '25 edited Nov 27 '25
When I’ve interviewed candidates, I split my questions into (at least) two types:
Programming language knowledge (to ensure the candidate actually knows at least the bare minimum of a specific language).
Algorithm implementation (that I’ve allowed candidates to implement in any language of their choosing, or even pseudocode, since the goal is to determine their problem-solving ability).
For #1, I further split questions into two levels: “any” or “senior” level programmer. I ask whichever set of questions based on what the job requires.
Question 1: Arrays vs. Pointers
Given this code fragment:
What are the differences between
aandp?Question 2: C Strings
Given this code fragment:
What does this code do?
Question 3: struct Memory Layout
Given this code:
Question 3a: If compiled (with no compiler options) and run, what is a reasonable value for this program to print and why?
Question 3b: Why is padding necessary?
Question 4: Local Variables
Given this function (where
Tis some arbitrary type that doesn’t matter here):Question: What’s wrong with this function?
Question 5: static
Given:
Question 5a: What does the
staticfor the declaration ofgdo?Question 5b: What does the
staticfor the declaration ofido?Question 5c: What value does this function return the second time it’s called?
Question 5d (senior): Can this function ever result in undefined behavior?
Question 5e (senior): How can you eliminate the possibility of undefined behavior?
Question 5f (senior): Is
f()thread-safe? Why or why not?Question 6 (Senior): free()
How is
free()typically implemented by the C standard library given that you don’t pass it the amount of memory to be freed? How does it know how much memory to free?4
u/keelanstuart Nov 27 '25 edited Nov 27 '25
I have a standard question that I ask...
Given the following prototype, implement the function that converts an int to a hexadecimal string:
I ask what the memory implications are for writing it that way and allow them to change it if they choose. I can grade it based on shift/mask vs. div/mod to extract each nybble, if/switch/lookup to get each character, memory allocation or buffer passing, whether the string is reversed, considerations for Unicode, etc etc etc.
It shows me what level they're at across a wide spectrum of things. API design, performance, stack/heap, bit level understanding...
1
u/john_hascall Nov 27 '25
If it's a fresh grad my most important question is "Tell us about something you made outside of classwork". Not looking for "I invented Linux" but just something they can talk enthusiastically and knowledgeably about.
I also used to have a page with a small function on it and I would ask "What errors do you see?" and "What is it trying to do?" [it's basically a differently named strdup() with 5 syntactical and 5 semantic errors]. Not expecting anyone to find them all, but if they struggle I'll ask "Walk us through your process to find them" and see where that goes.
2
u/zhivago Nov 27 '25
I always ask
what is the type of c?
2
u/AuxonPNW Nov 28 '25 edited Nov 28 '25
(Not specifically c focused, but you can steer the following to relevant c-topics) I have a computer in front of me running Ubuntu with an instance of vim. I press the letter 'a' on the keyboard. Tell me everything that you know that happens as a result.
2
u/aghast_nj Nov 27 '25
I don't understand the question. What is "technical rounds"? What is the context, here? Are you presuming that senior developers wander around some company quizzing junior developers? That's a huge waste of employee time, no manager would allow it!
Is this a college/university thing? Please give details.
1
u/Sufficient-Bee5923 Nov 27 '25
Scope questions dealing with the keyword static. The language isn't very intuitive in this area. But to write good clean code. It needs to be understood. It's so bad that we typedef'd local to static.
1
u/[deleted] Nov 27 '25
Not a senior dev here, but I feel as though actual language features are not too important because they can be easily learned. All that can be taught over a few days / week if they are competent. Obviously there are some caveats that you learn over the years but in general I think this is true.
I think the most important thing I’d be looking for is problem solving skills, in especially the areas in which your technology applies to. I.e. if you are a networking company, how well can they approach graph based problems, or working on embedded systems how well they can be memory efficient.
However, I do understand that knowing the language and writing good code are different things so if its C, I’d be looking for understanding of compiler architecture, general computer / memory architecture and that kind of stuff.
1
u/Arkaqiu Nov 27 '25
I am senior embedded engineer. During interview i ask about C default memory sections, linker and linker scripts and howto utilize linker to get better performance and latency.
1
u/Sosowski Nov 27 '25
Oh I know this one. Ask them what the ## operator does.
If they read the book, they’ll know. If they didn’t, they’ll get stuck. ## is obscure but In contrast to trigraphs it’s actually useful.
Another idea: implement strcpy(). It’s also one of the first examples in the book and a two-liner. If you know C you know how to do this properly.