Firmware Engineer Interview Questions & Answers
40 questions for Firmware Engineer interviews — 5 easy, 31 medium, 4 hard.
About the Firmware Engineer role
A firmware engineer writes the C code that runs directly on hardware, such as boot loaders, board support packages, sensor drivers and power management logic. The role involves reading datasheets, working with registers through bit manipulation, debugging with JTAG and oscilloscopes and making code fit tight memory budgets. Semiconductor, IoT and automotive companies are major employers for this role. Clear documentation of hardware behaviour is also expected.
A strlen call crashes on a buffer received from a network packet. What is wrong?
Show answer
You need to update one record in the middle of a large binary file without rewriting it all. How?
Show answer
What is a function pointer and where is it used?
Show answer
Valgrind reports invalid read of size 4 after free. How do you fix it?
Show answer
What is the difference between strcpy, strncpy and snprintf for copying strings?
Show answer
What is structure padding and how can you reduce it?
Show answer
How do you write C code that other developers can maintain?
Show answer
A function returns the address of a local array and the caller gets wrong data. Why?
Show answer
Use a tagged union to store either an int, a float or a string value.
Show answer
Write a function that dynamically allocates an array of n integers and fills it with squares.
Show answer
What is the difference between a declaration and a definition in C?
Show answer
What is the difference between ++i and i++?
Show answer
What is a double pointer and when do you need it?
Show answer
What is the difference between a structure and a union?
Show answer
Copy a file in C using fread and fwrite.
Show answer
Two source files both define a global variable named count and the build fails. How do you fix it?
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
How do you handle working with a teammate who writes buggy code?
Show answer
What is the difference between const int *p, int *const p and const int *const p?
Show answer
What is the volatile qualifier used for in C?
Show answer
Write Kadane's algorithm in C.
Show answer
What are bit fields in C?
Show answer
What is the difference between a macro and an inline function?
Show answer
What is a memory leak and how do you detect it?
Show answer
Write a C program that counts lines, words and characters in a file.
Show answer
What is undefined behaviour in C? Give examples.
Show answer
You must schedule the maximum number of non-overlapping meetings in one room. What algorithm do you use?
Show answer
Tell me about a time you debugged a hard crash in C code.
Show answer
What is a ring buffer and why is it common in embedded systems?
Show answer
How do you handle a situation where requirements change late in a project?
Show answer
A program crashes with a segmentation fault. How do you find the cause?
Show answer
Write code to check whether the machine is little endian or big endian.
Show answer
Which gcc flags would you use to build and debug a C program safely?
Show answer
Explain the memory layout of a C program.
Show answer
How do you set, clear and toggle a particular bit in C?
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
Write C code to count the number of set bits in an integer.
Show answer
What is the strict aliasing rule?
Show answer
Use qsort with a function pointer to sort an array of integers in descending order.
Show answer
Frequently asked questions
What does a Firmware Engineer do?
A firmware engineer writes the C code that runs directly on hardware, such as boot loaders, board support packages, sensor drivers and power management logic. The role involves reading datasheets, working with registers through bit manipulation, debugging with JTAG and oscilloscopes and making code fit tight memory budgets. Semiconductor, IoT and automotive companies are major employers for this role. Clear documentation of hardware behaviour is also expected.
Which skills are tested in a Firmware Engineer interview?
Expect questions on Embedded C, Register level programming, JTAG debugging, Bootloaders, Low power design. Most rounds also ask you to explain a project and solve one practical problem live.
How do I prepare for a Firmware Engineer interview?
Revise C Basics, Data Types and Operators, Pointers and Memory Management, Structures, Unions and File Handling first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.