Fundamentals 41 min read

30 Essential Embedded Linux Interview Questions and Answers

This article compiles 30 common embedded Linux interview questions covering Linux basics, kernel components, memory management, process scheduling, I/O subsystems, inter-process communication, system calls, bootloader processes, and essential command-line tools, providing concise explanations to help candidates prepare for embedded system positions.

Deepin Linux
Deepin Linux
Deepin Linux
30 Essential Embedded Linux Interview Questions and Answers

Hello, I am Deep Linux. Today I share an embedded Linux interview guide because embedded positions have been hot in recent years, offering attractive salaries and a good alternative for those who do not want to focus on backend development.

Is the requirement for fresh graduates high? Compared with backend Java or C++, the language requirements are a bit lower; however, proficiency in C is still essential, making this a good fit for C/C++ programmers.

Below are the 30 must‑know questions for an embedded Linux interview.

面经问题来源:https://www.nowcoder.com/interview/
(答案自己总结的,如有出错 大家多多指教!!)

1. What is Linux?

Linux is an open‑source, free operating system kernel originally created by Linus Torvalds in 1991. It is known for stability, efficiency, and security, widely used in servers and increasingly in personal computers, mobile devices, and embedded systems. Based on UNIX design principles, Linux offers high customizability and extensibility under a permissive license.

2. What is the difference between Unix and Linux?

Unix and Linux share many concepts but differ in several aspects:

Development history: Unix was developed by AT&T Bell Labs and commercialized; Linux was created by Linus Torvalds based on Unix concepts.

Open‑source nature: Linux is fully open source; Unix was historically closed source, though some open‑source variants exist.

Portability: Linux runs on a wide range of hardware platforms; Unix is often tied to specific architectures.

Community support: Linux benefits from a massive global community; Unix relies more on vendor support.

Standardization: Linux follows POSIX standards, while Unix implementations may vary.

3. What are the components of a Linux system?

Linux kernel – core of the OS, managing hardware resources, scheduling, file systems, drivers, etc.

Shell – user interface that interprets commands (e.g., Bash, Zsh).

File system – organizes data storage (e.g., ext4, XFS).

GNU tools – collection of open‑source utilities, compilers, editors, debuggers.

Application libraries – such as glibc, GTK+, Qt.

User‑space utilities – command‑line tools, network utilities, editors, etc.

These parts together form the Linux operating system, supporting applications and user interaction at various layers.

4. What are the components of the Linux kernel?

Process management – creation, scheduling, termination, and inter‑process communication.

Memory management – handling physical and virtual memory, paging, allocation.

File system support – read/write operations for various file system types.

Device drivers – interface with hardware devices.

Network stack – TCP/IP and other protocols, plus network device drivers.

System call interface – entry points for user‑space programs to request kernel services.

Interrupt handling – processing hardware interrupt signals.

Scheduler – decides which process runs at any given time.

5. What is the role of the Memory Management Unit (MMU)?

Address translation – converts virtual addresses used by programs into physical addresses.

Memory protection – enforces access permissions to isolate processes and kernel space.

Page replacement – swaps out rarely used pages to disk when physical memory is scarce.

Cache management – assists in maintaining consistency between CPU caches and main memory.

6. Common operating‑system process scheduling strategies

First‑Come, First‑Served (FCFS)

Shortest Job Next (SJN)

Priority scheduling (static or dynamic)

Round Robin (RR)

Multilevel feedback queue

Shortest Remaining Time Next (SRTN)

7. I/O subsystem hierarchy

User interface layer – GUI or CLI where users issue I/O requests.

Device‑independence layer – abstracts hardware, providing a uniform API.

Device driver layer – specific drivers that communicate directly with hardware.

I/O controller layer – hardware controllers (disk, network adapters) that move data between memory and devices.

Bus/medium controller – bridges between devices and controllers, handling data transfer protocols.

8. Differences among logical, linear, physical, bus, and virtual addresses

Logical address – the address used in source code, abstracted from actual hardware.

Linear (virtual) address – result of segment translation, later mapped to physical memory via paging.

Physical address – actual hardware location in RAM.

Bus address – address placed on the system bus to select a specific memory location or device.

Virtual address – the address seen by a process after paging, independent of physical layout.

9. Types of operating‑system memory management and their pros/cons

Single contiguous partition – simple but wastes memory and cannot support multitasking.

Fixed partitions – allows multiple processes but suffers internal fragmentation.

Dynamic partitions – flexible allocation, may cause external fragmentation.

Paging – fixed‑size pages improve utilization, but adds overhead (page tables, TLB).

Segmentation – reflects program structure, but can lead to external fragmentation.

Segmented paging – combines benefits of paging and segmentation, at the cost of added complexity.

Choosing the appropriate method depends on system requirements and hardware constraints.

10. User‑space and kernel communication mechanisms

System calls – the primary interface for requesting privileged services.

Interrupts – hardware or software events that switch the CPU to kernel mode.

Signals – lightweight notifications of events.

Shared memory – fast data exchange by mapping the same memory region.

Pipes – half‑duplex byte streams between related processes.

Special files – accessing device nodes under /dev.

11. What does the kernel do when read()/write() is called?

For read() :

Validate parameters (file descriptor, buffer pointer).

Locate the file table entry.

Check read permissions.

Allocate a temporary kernel buffer.

Transfer data from the device to the buffer (disk I/O, etc.).

Update the file offset.

Copy data to user space and return the byte count.

For write() the steps are analogous, but data flows from user space to the device.

12. Purpose of system calls

Access hardware devices.

Perform file operations (open, read, write, close).

Control processes (create, wait, IPC).

Manage memory (allocate, free).

Handle network communication (sockets).

Enforce security and privilege checks.

13. Relationship among boot loader, Linux kernel, and root file system

During boot, the boot loader (e.g., GRUB) initializes hardware, loads the Linux kernel into memory, and transfers control to it. The kernel then performs its own initialization, mounts the root file system, and starts the first user‑space process (init).

14. Two stages of the bootloader startup process

Stage 1 – Bootloader stage: firmware hands control to the bootloader, which initializes hardware, presents a menu (if multiple OSes), loads the kernel image, and sets kernel parameters.

Stage 2 – Kernel boot stage: the bootloader jumps to the kernel entry point; the kernel initializes drivers, mounts the root file system, and launches the init process.

15. Common Linux commands

File and directory operations: ls , cd , pwd , mkdir , touch , cp , mv , rm .

File viewing/editing: cat , less / more , head / tail , nano / vi / vim .

Permission management: chmod , chown / chgrp .

System information: uname , top / htop , df / du .

Process management: ps / top , kill .

Network utilities: ifconfig / ip addr , ping / traceroute , curl / wget , ssh / scp / rsync .

16. What is a Shell script?

A shell script is a sequence of shell commands saved in a text file (usually with a .sh extension) that automates tasks such as file manipulation, process control, and system configuration. It can include control‑flow constructs like conditionals and loops.

17. Roles of GCC, GDB, and Makefile

GCC – the GNU Compiler Collection, used to compile C, C++, and other languages into executable binaries.

GDB – the GNU Debugger, provides breakpoints, variable inspection, stack tracing, and step‑by‑step execution.

Makefile – a script for the make utility that describes file dependencies and build commands, automating compilation of large projects.

18. What is a Makefile?

A Makefile lists targets, their dependencies, and the commands needed to build each target. make reads this file, determines which files are out‑of‑date, and executes the appropriate commands, simplifying and speeding up builds.

19. Inter‑process communication (IPC) methods

Pipes (anonymous)

Named pipes (FIFOs)

Semaphores

Shared memory

Message queues

Signals

Sockets

20. Thread synchronization mechanisms

Mutexes

Reader‑writer locks

Condition variables

Semaphores

Barriers

Atomic operations

21. Differences between threads and processes

Resource usage – processes have separate address spaces and file descriptors; threads share the same address space.

Execution unit – a process contains at least one main thread; multiple threads can exist within a process.

Communication – processes need IPC mechanisms; threads communicate via shared memory.

Scheduling – context switches between processes are heavier than between threads.

Creation overhead – creating a thread is cheaper than creating a process.

22. What is a deadlock and its causes?

A deadlock occurs when two or more processes (or threads) wait indefinitely for resources held by each other. The four necessary conditions are mutual exclusion, hold‑and‑wait, no preemption, and circular wait.

23. The four necessary conditions for deadlock

Mutual exclusion – at least one resource can be held by only one process at a time.

Hold and wait – a process holds resources while waiting for additional ones.

No preemption – resources cannot be forcibly taken away.

Circular wait – a closed chain of processes each waiting for a resource held by the next.

24. Deadlock handling methods

Deadlock prevention – break one of the four conditions.

Deadlock avoidance – dynamically check resource allocation (e.g., Banker's algorithm).

Deadlock detection and recovery – detect cycles and recover by terminating processes or preempting resources.

Ignore (deadlock tolerance) – accept deadlocks when their impact is negligible.

25. How to prevent deadlocks

Eliminate mutual exclusion where possible.

Require processes to request all needed resources at once (break hold‑and‑wait).

Allow preemption of resources.

Impose a linear ordering on resource acquisition to avoid circular wait.

26. Topics covered by basic networking knowledge

Network concepts and architectures (client‑server, peer‑to‑peer).

Protocols (TCP/IP, HTTP, FTP, DNS, etc.).

IP addressing and subnetting (IPv4/IPv6).

Network devices (switches, routers, firewalls).

Network security (authentication, encryption, firewalls).

Network management and monitoring.

Wireless technologies (Wi‑Fi, Bluetooth).

Cloud computing and network virtualization (SDN, NFV).

27. What is TCP programming?

TCP programming involves using the Transmission Control Protocol to create reliable, connection‑oriented network applications. It includes creating sockets, binding to addresses, listening for connections, accepting clients, and performing read/write operations over the established connection.

28. Difference between kernel mode and user mode

Kernel mode grants full access to hardware and privileged instructions; it is used by the OS for tasks such as process management, device drivers, and memory handling. User mode runs regular applications with restricted privileges; any request for privileged operations must go through system calls.

29. Relationship between processes and threads

Resources – each process has its own address space and file descriptors; threads share the process’s resources.

Execution – a process contains at least one main thread; additional threads share code but have separate stacks.

Context switching – switching between processes saves the full context; switching between threads saves only the thread context, which is cheaper.

Synchronization – processes use IPC mechanisms; threads communicate via shared memory and variables.

30. User‑space to kernel communication methods

System calls – the primary mechanism for requesting kernel services.

IPC – pipes, message queues, shared memory, semaphores can cross the user/kernel boundary.

Memory mapping – mmap() maps files or devices into user space.

Special device files – reading/writing to /dev/* interacts directly with kernel drivers.

All interactions must respect safety and security policies defined by the operating system.

kernelLinuxInterviewOperating SystemEmbedded Systems
Deepin Linux
Written by

Deepin Linux

Research areas: Windows & Linux platforms, C/C++ backend development, embedded systems and Linux kernel, etc.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.