10 Essential Embedded Software Engineering Interview Questions *

最优秀的嵌入式软件工程师可以回答的最基本的问题. 在我们社区的推动下,我们鼓励专家提交问题并提供反馈.

Hire a Top Embedded Software Engineer Now
Toptal logois an exclusive network of the top freelance software developers, designers, finance experts, product managers, and project managers in the world. Top companies hire Toptal freelancers for their most important projects.

Interview Questions

1.

描述在中档微控制器上使用通用实时操作系统(RTOS)的优缺点.

View answer

RTOSes can significantly ease the development of complex products, which can translate into faster development cycles. They often support compartmentalizing code into tasks, implement cross-task communication mechanisms, and commonly include abstractions (“drivers”) for platform-specific hardware, which makes porting firmware to new hardware easier. Because of all that, they also introduce overhead in code size and CPU usage, which is not acceptable for all projects.

2.

What are some common issues when handling interrupts?

View answer

中断处理程序几乎总是需要快速完成它们的执行——细节取决于设备和应用程序——这限制了它们代码中可以完成的事情的复杂性. Also, the context in which the interrupt handler code is executed can, for either hardware or software reasons, prevent the usage from within the interrupt handler code of:

  • Common library functions
  • Access to peripherals and devices
  • Even certain types of CPU instructions

缓解这种情况的通常方法是让中断控制器设置一个由非中断代码观察到的特殊变量, and which can then perform arbitrary actions

3.

In platforms with significant constraints on memory size, is it more preferable to allocate memory statically or dynamically?

View answer

在内存大小为低千字节及以下的平台上,最好使用静态内存分配. This is because data overhead, CPU overhead, 在使用动态内存分配时,内存碎片可能是一个严重的问题.

Apply to Join Toptal's Development Network

and enjoy reliable, steady, remote Freelance Embedded Software Engineer Jobs

Apply as a Freelancer
4.

为什么C和c++在嵌入式固件开发中仍然非常流行并得到广泛支持?

View answer

Hardware constraints, both for memory sizes and CPU speed, limit what can be done on embedded devices. C和c++通常开销很小,并且在提供给开发人员的抽象方面非常“接近硬件”. This makes them suitable for even the smallest devices.

5.

在两个设备之间可靠地实现类似ttl的串行通信需要多少条线, and why?

View answer

类似ttl的串行通信通常用于将基于微控制器的小型设备与大型计算机系统连接起来, either for general communication or for uploading firmware. This type of communication uses two wires, one for each direction, called TX (transmit) and RX (receive.),但这些设备之间还需要有一个共同的电气接地水平, 因此,可靠地实现TTL串行通信的最小导线数是三根. (The requirement for common electrical ground is also present in I2C and SPI.)

6.

既然有32位和64位微控制器,为什么还在使用8位微控制器呢?

View answer

The general reason is picking the right tool for the job. 三个最常见的原因是向后兼容性、价格和电力消耗. 在与现有基础设施进行接口时,向后兼容性非常重要, especially in industrial environments, where in many cases, 电气和操作限制影响微控制器的选择.

一般来说,较小的微控制器(具有较窄的主寄存器)也更便宜. 但是它们可以包含非常多的外设和接口选项, 因此它们可以用于许多需要高级功能但不需要高CPU速度的情况.

Smaller microcontrollers also generally require less power to operate, which is especially important for IoT and battery-powered devices.

7.

固件和数据嵌入在微控制器通常安全下载, tampering, or hacking?

View answer

No. 除非微控制器是专门构造的,以提供对抗固件下载和/或修改的对策, 任何上传到微控制器的代码和数据都应该被认为是相对容易下载和修改的. (Such hardened microcontrollers are usually expensive.)

8.

Describe the role of a watchdog timer.

View answer

看门狗定时器是许多微控制器的一个特性——通常用特定的专用硬件实现——可以用来检查微控制器上运行的软件是否挂起.

Microcontrollers are designed to be sturdy and resilient. But there’s still any number of issues that can affect hardware stability. There can also be an unhandled combination of events on the software side. Both of these can cause microcontrollers to “hang,” either electrically or in an infinite loop in software.

看门狗定时器是一个子系统,需要软件显式地通知它一切都按预期运行, within a specific amount of time. If the watchdog does not receive the notification it expects, it will perform some action, such as resetting the microcontroller, or even the whole device. This is usually done periodically, 看门狗定时器将执行它的动作,如果它没有收到通知后,可配置的时间量,从上次通知.

9.

What are the most important characteristics of UART-based (also called RS-232-like and TTL-like) serial communication, I2C communication, and SPI communication?

View answer

简单的基于UART的串行通信(有或没有UART硬件)是实现要求最低的通信协议, but comes with severe limitations:

  • It’s intended to connect only two devices.
  • 它是异步的,这意味着设备之间没有明确的时钟速率协议.
  • It’s most commonly used at slow bit rates (up to 115,200 bps).

I2C can connect up to 127 devices on the same electrical bus, and each device is individually addressable. One of the devices, a master device, generates a clock signal shared by all the others, called slave devices. There is only one data wire, so all communication is unidirectional. (It’s commonly used to communicate with sensors on a PCB, which often use simple request-response protocols.)

The SPI bus is designed for fast, bidirectional communication with complex devices, which can involve cases such as transferring a large volume of data in bulk. With SPI, all devices share the data and clock wires, 但也有单独的寻址线,使通信与特定设备.

10.

讨论嵌入式设备之间无线通信的几个选项.

View answer

On the high end of cost and complexity, wireless communication can be implemented using one of the wifi standards. 这些提供了很大的带宽,可以与许多其他设备互操作,并且可以是远程的. But wifi standards are also fairly complex and require dedicated hardware.

蓝牙是在不同类型的硬件之间进行短距离接口的合理选择, i.e., those of up to 15 yards (~14 meters). 它还需要专门的硬件,但这些硬件通常便宜且易于使用. 使用蓝牙进行通信的设备通常会模拟它们之间的串行线.

也有定制的基于无线电的通信设备和协议,它们与WiFi和蓝牙在相同的频率上工作(大约2.4 GHz), but with simpler protocols that are incompatible with the standard ones. They are usually cheaper than Bluetooth and simpler to implement.

There are also transceivers operating at low frequencies such as 433 MHz. 虽然它们在10码(约9米)的短距离内提供非常低的比特率,但它们非常便宜且易于实现. If larger distances are required and a small bitrate is acceptable, which is often the case in IoT devices, solutions like LoRa, SigFox, and NB-IoT can be used.

Finally, 红外通信在很短的距离(几码)也可以是一个有效的选择.

There is more to interviewing than tricky technical questions, so these are intended merely as a guide. Not every “A” candidate worth hiring will be able to answer them all, nor does answering them all guarantee an “A” candidate. At the end of the day, hiring remains an art, a science — and a lot of work.

Why Toptal

Tired of interviewing candidates? Not sure what to ask to get you a top hire?

Let Toptal find the best people for you.

Hire a Top Embedded Software Engineer Now

Our Exclusive Network of Embedded Software Engineers

Looking to land a job as an Embedded Software Engineer?

Let Toptal find the right job for you.

Apply as an Embedded Software Engineer

Job Opportunities From Our Network

Submit an interview question

Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of Toptal, LLC.

* All fields are required

Looking for Embedded Software Engineers?

Looking for Embedded Software Engineers? Check out Toptal’s embedded software engineers.

David Marín

Freelance Embedded Software Engineer
SpainToptal Member Since July 2, 2015

David是一名开源和开放数据爱好者,拥有超过23年的专业开发经验. He has acquired various skills, including web programming (PHP and JavaScript), C, C++ (under Linux and Windows), and systems management. Of these skills, David擅长web编程,并拥有基于Symfony php的后端全栈经验, jQuery front ends, and WordPress/WooCommerce-based sites.

Show More

Federico Albanese

Freelance Embedded Software Engineer
ArgentinaToptal Member Since January 9, 2019

Federico is a developer and data scientist who has worked at Facebook, where he made machine learning model predictions. He is a Python expert and a university lecturer. His Ph.D. research pertains to machine learning. 他可以在这个过程中不断学习和实现最先进的算法,每天都成为一名更好的数据科学家.

Show More

Szabolcs Dombi

Freelance Embedded Software Engineer
RomaniaToptal Member Since July 1, 2019

Szabolcs is an experienced Python, C, and C++ developer, who uses the Python C API to build Python extensions, and to embed Python into other applications. 他的业余项目是为Python构建的高性能渲染库. Szabolcs凭借其优雅而成功的编程技巧赢得了几次比赛, and finds simplicity, maintainability, and performance important when making design decisions.

Show More

Toptal Connects the Top 3% of Freelance Talent All Over The World.

Join the Toptal community.

Learn more