Embedded Software Interview Experience and Technical Review
This article shares a comprehensive embedded software interview guide, covering written‑test topics such as structs vs. unions, linked lists, pointer safety, endianness detection, and a strcpy implementation, followed by technical interview tips, HR interview advice, and concluding remarks.
Hello, I am Deep Linux. Today I share my embedded software interview experience. The embedded position has been hot in recent years, offering good salaries, making it a solid alternative for those not interested in backend development.
For fresh graduates, the requirements are slightly lower than backend Java or C++ positions, but solid C programming skills are still required, which attracts many C/C++ candidates.
The interview mainly tests three modules: C/C++ knowledge, microcontroller basics, and Linux.
1. Written Test
1.1 Difference between struct and union in C
Both are composite types for organizing data, but they differ in memory layout, size, access, and usage.
Memory allocation: struct members occupy separate memory in declaration order; union members share the same memory block sized for the largest member.
Memory consumption: struct size is the sum of its members (with possible padding); union size equals the largest member.
Access: struct members can be accessed simultaneously; union members are exclusive.
Use cases: structs for grouping related heterogeneous data; unions for saving memory when storing different types at the same location.
1.2 Singly linked list vs. doubly linked list
Both are common linked‑list structures with distinct characteristics.
Singly linked list: each node holds data and a pointer to the next node; only forward traversal; insertion/deletion O(1) at head, search O(n).
Doubly linked list: each node also holds a pointer to the previous node; supports forward and backward traversal; insertion/deletion O(1) anywhere, search O(n); requires extra memory for the additional pointer.
1.3 Pointer usage precautions
Check for null pointers before dereferencing.
Allocate memory before use and release it when done.
Avoid dangling pointers by nullifying them after the referenced object is destroyed.
Prevent wild pointers by initializing pointers and not using them after free.
Manage memory safety: avoid overflow, leaks, double free.
Be careful with pointer arithmetic and boundary conditions.
Avoid using a pointer after the original memory has been freed.
1.4 Determining endianness
Two common methods are shown using a union and pointer casting.
union EndianTest {
int i;
char c[sizeof(int)];
};
EndianTest test;
test.i = 1;
bool isLittleEndian = (test.c[0] == 1);Alternatively, using pointer reinterpretation:
int value = 1;
char* ptr = reinterpret_cast
(&value);
bool isLittleEndian = (*ptr == 1);1.5 Simple strcpy implementation
#include
char* strcpy(char* dest, const char* src) {
if (dest == nullptr || src == nullptr) {
return nullptr;
}
char* pDest = dest;
while (*src != '\0') {
*pDest++ = *src++;
}
*pDest = '\0';
return dest;
}
int main() {
const char* source = "Hello, world!";
char destination[20];
strcpy(destination, source);
std::cout << "Copied string: " << destination << std::endl;
return 0;
}Remember to ensure the destination buffer is large enough to avoid overflow.
2. Technical Interview
Typical strategy: start with a self‑introduction, mention self‑studied knowledge, then briefly describe projects (functions and workflow) to keep the conversation flowing.
The interviewer will mainly ask questions that appear on the resume, so list only what you truly know.
2.1 Role of the static keyword
Inside a function: static variables retain their value between calls.
At file scope: static limits visibility to the current translation unit.
In C++ classes: static members belong to the class, not to any instance.
In C structs: static members behave similarly to class static members.
2.2 Recap of struct vs. union differences
Memory layout, size, access, and typical use cases are summarized as in section 1.1.
2.3 Pointer usage reminders
Same points as section 1.3.
2.4 Differences between pointers and arrays
Arrays have fixed size allocated at compile time; pointers are variables holding addresses.
Arrays are a distinct type; pointers can point to any address.
Arrays use indexing; pointers use dereferencing and arithmetic.
Array size is immutable; pointers can be reassigned to different memory blocks.
When passed to functions, arrays decay to pointers, so modifications affect the original data.
2.5 Overview of doubly linked list
A doubly linked list node stores data plus two pointers (prev and next), allowing traversal from both ends. Insertion and deletion are O(1) with extra memory overhead for the additional pointer.
2.6 Three major features of C++
Object‑oriented programming (encapsulation, inheritance, polymorphism).
Generic programming via templates.
Low‑level control: pointers, references, manual memory management.
Interviewers may also ask about STM32 microcontroller projects, communication protocols (USART, I2C, SPI, CAN, I2S), sensor models, operating systems (Linux, uC/OS, FreeRTOS), TCP/UDP, process vs. thread, motor control algorithms (PID, FOC), and computer‑vision libraries like OpenCV.
3. HR Final Interview
Self‑introduction, discuss background, strengths and weaknesses, then negotiate salary based on market rates and job requirements.
Conclusion: For any embedded engineer, programming languages and code are tools; the core knowledge lies in principles, protocols, frameworks, and problem‑solving mindset.
Recommended Articles:
Deep Dive into C++ Memory Management: Pointers, References, and Allocation
Breaking Conventions: New Linux Kernel Data Structure – Maple Tree
In‑Depth Exploration of Linux Kernel Source Code
Efficient Network Communication: Socket Principles and Practice
Demystifying Linux Kernel Memory Barriers
Linux Kernel Filesystem: Powerful Storage Magic
Memory Allocation Unveiled: Inside the malloc Implementation
Exploring Core Network Tech: Hand‑written TCP/IP User‑Space Stack
Deepin Linux
Research areas: Windows & Linux platforms, C/C++ backend development, embedded systems and Linux kernel, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.