<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Firmware Prep</title>
    <description>The latest articles on DEV Community by Firmware Prep (@firmwareprep).</description>
    <link>https://dev.to/firmwareprep</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4245253%2F27881d60-a560-4603-8fcf-cc8a2d20a4e5.png</url>
      <title>DEV Community: Firmware Prep</title>
      <link>https://dev.to/firmwareprep</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/firmwareprep"/>
    <language>en</language>
    <item>
      <title>15 embedded interview questions that trip up strong candidates</title>
      <dc:creator>Firmware Prep</dc:creator>
      <pubDate>Sun, 15 Nov 2026 01:22:15 +0000</pubDate>
      <link>https://dev.to/firmwareprep/15-embedded-interview-questions-that-trip-up-strong-candidates-3hho</link>
      <guid>https://dev.to/firmwareprep/15-embedded-interview-questions-that-trip-up-strong-candidates-3hho</guid>
      <description>&lt;p&gt;Firmware interviews are not inverted LeetCode. The questions that actually decide a screen are usually short, and they are designed to find out whether you know the &lt;em&gt;limit&lt;/em&gt; of a tool, not just its textbook definition. Strong candidates still miss these, because the wrong answer often sounds fluent.&lt;/p&gt;

&lt;p&gt;Below are fifteen that come up constantly. Each one includes the distinction that interviewers are listening for. If you can say these out loud, cleanly, you are already ahead of most mid-level loops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. What does &lt;code&gt;volatile&lt;/code&gt; do?&lt;/strong&gt;&lt;br&gt;
It forces the compiler to perform the loads and stores you wrote, because the object may change or have side effects the translation unit cannot see. Use it for memory-mapped registers and for simple ISR flags when you are not using atomics. It does &lt;em&gt;not&lt;/em&gt; give you atomicity, a hardware memory barrier, or a safe 64-bit access on a 32-bit CPU. For that, use C11 atomics or a lock.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;code&gt;const int *p&lt;/code&gt; versus &lt;code&gt;int *const p&lt;/code&gt;?&lt;/strong&gt;&lt;br&gt;
The first is a pointer to const: you may move &lt;code&gt;p&lt;/code&gt;, you may not write through it. The second is a const pointer: &lt;code&gt;p&lt;/code&gt; itself may not be pointed elsewhere. They combine as &lt;code&gt;const int *const p&lt;/code&gt;. This is a 20-second question that still eats people who have used &lt;code&gt;const&lt;/code&gt; for years.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Why is &lt;code&gt;1 &amp;lt;&amp;lt; 31&lt;/code&gt; a problem?&lt;/strong&gt;&lt;br&gt;
If &lt;code&gt;1&lt;/code&gt; is a signed 32-bit &lt;code&gt;int&lt;/code&gt;, shifting it into the sign bit is undefined behavior. Write &lt;code&gt;1u &amp;lt;&amp;lt; 31&lt;/code&gt;. Do bit work on unsigned types, and never shift by a count greater than or equal to the width of the type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Why can't you detect signed overflow with &lt;code&gt;if (a + b &amp;lt; a)&lt;/code&gt;?&lt;/strong&gt;&lt;br&gt;
Because signed overflow is undefined in C. The compiler may assume it never happens and delete your check. Widen to &lt;code&gt;int64_t&lt;/code&gt;, add, and clamp; or use a checked builtin. Unsigned wrap is defined; signed overflow is not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Is a packed struct a portable on-wire format?&lt;/strong&gt;&lt;br&gt;
No. Packing removes padding, which can match a datasheet layout, but it can generate unaligned accesses and it does nothing about endianness. Serialize fields explicitly. &lt;code&gt;memcpy&lt;/code&gt; of a native integer onto a big-endian protocol is a bug waiting for a different host.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. What is legal in an ISR?&lt;/strong&gt;&lt;br&gt;
Acknowledge the hardware, copy a small amount of data, set a flag, give a semaphore or send to a queue with the FromISR API, and request a context switch if needed. Do not block, do not &lt;code&gt;malloc&lt;/code&gt;, do not call a sleeping mutex, and do not &lt;code&gt;printf&lt;/code&gt; to a blocking console. Keep it short and predictable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Mutex or binary semaphore?&lt;/strong&gt;&lt;br&gt;
A mutex has ownership and, on a good RTOS, priority inheritance. Use it to protect data. A binary semaphore is a signaling object with no owner and no inheritance; an ISR can give it, a task can take it. Using a semaphore as a mutex is one of the most common mid-level mistakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. What is priority inversion, and how do you fix it?&lt;/strong&gt;&lt;br&gt;
A high-priority task is ready but blocked on a mutex held by a low-priority task, and a medium-priority task runs instead, so the delay is unbounded. Fix it with priority inheritance or a priority-ceiling protocol. “Make everything high priority” is not a fix. The public textbook case is the Mars Pathfinder reset in 1997.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Which way do Cortex-M priorities run?&lt;/strong&gt;&lt;br&gt;
On the NVIC, a &lt;em&gt;numerically lower&lt;/em&gt; priority value is &lt;em&gt;more&lt;/em&gt; urgent. That is the opposite of many RTOS task-priority conventions. If you mix them up while configuring preemption, you will not notice until an ISR you thought was low-priority starts interrupting everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Is I2C just a slower SPI?&lt;/strong&gt;&lt;br&gt;
No. I2C is a two-wire, open-drain, addressed bus with ACK/NACK, optional clock stretching, and multi-master arbitration. SPI is typically four wires, push-pull, full duplex, chip-select per device, and has no standard acknowledgement. They fail differently. A missing I2C part NACKs its address; a missing SPI part often just returns 0x00 or 0xFF.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. A SPI device always reads 0xFF. What first?&lt;/strong&gt;&lt;br&gt;
Confirm the mode (CPOL and CPHA, one of four), chip-select polarity, and that the clocks actually reach the part. Getting the mode wrong is the first thing to check when a device “does not respond.” Then look at whether MISO is actually driven, and at wiring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. What extra bugs does DMA introduce?&lt;/strong&gt;&lt;br&gt;
Buffer lifetime (do not touch it until completion), cache coherency (clean before the engine reads CPU-written data; invalidate after it writes memory the CPU will read), alignment and length constraints, and error/completion handling. The DMA engine talks to memory, not to your cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. What does the CAN ACK bit actually mean?&lt;/strong&gt;&lt;br&gt;
At least one healthy receiver heard a valid frame and drove the ACK slot dominant. It is not “the destination sent me a reply.” Classical CAN is content-addressed; higher-layer protocols add destination semantics on top. A missing ACK means no healthy receiver heard the frame.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. A 32-bit millisecond tick wraps. How do you compare times?&lt;/strong&gt;&lt;br&gt;
Use a signed difference: &lt;code&gt;(int32_t)(now - deadline) &amp;gt;= 0&lt;/code&gt; means the deadline has been reached, provided the intervals you care about are shorter than 2^31 ticks (about 24.9 days at 1 ms). Do not use &lt;code&gt;now &amp;gt; deadline&lt;/code&gt; as an unsigned compare if wrap is possible. A 32-bit millisecond tick wraps in about 49.7 days.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. A CRC on a firmware image is enough, right?&lt;/strong&gt;&lt;br&gt;
A CRC (or a hash) is integrity: it catches transport and programming errors. It is not authenticity. If the threat model includes an untrusted sender, you need a signature or a MAC. And a reliable update design still needs a protected bootloader, two slots or a staging area, an atomic commit, a health check, and a rollback path that survives a power cut at every step.&lt;/p&gt;

&lt;p&gt;If you take only one habit from this list, take this: say what is defined and what is not — in C, in a protocol, and in a timing budget.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was drafted with AI assistance and reviewed for technical accuracy by Firmware Prep.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>c</category>
      <category>career</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
