
Recall first from Debugging and security scenarios
- A running PID can belong to a service that has stopped making progress.
- A useful core backtrace depends on matching the deployed executable, libraries, and debug symbols.
- A trial boot can succeed at the OS level while the product function fails.
Answer behavioral questions with evidence
4 min readTechnical depth needs a human story; this lesson covers behavioral questions and the pitfalls interviewers listen for.
A configuration update can return success and leave the running device reading the new file, yet the update can be lost after a power cut. Linux documents this distinction: rename() can replace a destination atomically, while fsync() on the file alone does not necessarily persist its directory entry. In an interview, identifying that failure is only the beginning. The interviewer can also ask when you noticed it, how you raised it with the team, and what evidence supported the fix. rename(2): change the name or location of a file, fsync(2): synchronize a file's in-core state with storage
Use STAR, which stands for situation, task, action, and result. Give enough situation to establish the device, the symptom, and the constraint that affected your decision. State what you were responsible for. Spend most of the answer on what you did and why you did it in that order. End with an observation, test, or decision that someone else could verify. A course project is a valid example. Say where you tested it and describe any verification that remained open. If you did not record a number, name the observed outcome in words.
Working with hardware. When asked about an intermittent peripheral, identify the board and revision if known, then describe how you separated a software hypothesis from a board, wiring, or power hypothesis. For example, explain how you kept the image and test procedure fixed while comparing a suspect setup with a known-good setup. Say who checked the wiring or signal trace and what the comparison established. If most of your testing used a mock hardware abstraction layer, name the error behavior it verified and any electrical or timing assumption that still needed a board test.
Debugging under pressure. Start with the user impact and your first decision. For a device that stops reporting, explain whether you preserved logs before restarting or restored a critical function immediately because the outage took priority. Say what you communicated, which observation narrowed the cause, and how you checked recovery. Distinguish restoration from diagnosis. If a restart restored reporting and the cause remained unknown, say so and identify what evidence you wanted on the next occurrence.
Documenting architecture. Describe a decision another engineer needed to understand. A diagram might show who owns the local telemetry queue and where the network boundary sits. An architecture decision record can capture why you chose a bounded queue, which records may be dropped, and who owns the recovery behavior. Name the reader and explain what they could verify or implement with the document. If nobody reviewed it, describe that as an open verification step.
Reviewing code. Quote the substance of a review comment you wrote or received. Explain the failure condition, what change or test you requested, and how the discussion resolved it. A useful comment might ask whether a synchronous upload can keep a timer callback from running during a slow network request. The follow-up could be a test that injects a delayed response and measures timer lateness. If a teammate proposed the final design, credit them and describe your contribution to verifying it.
Explain the failure behind each pitfall
3 min readWhen you spot a pitfall in an interview, point to the operation or missing control, describe the condition that exposes it, and state the consequence for the device. Then give one change and one way to verify it. Scope your answer around the product's requirements. A telemetry sample and an alarm may have different retention rules, even when both travel through the same process.
Blocking the event loop. A synchronous network request, disk operation, or long computation inside a callback occupies the loop thread. While the callback runs, that loop cannot dispatch its other ready callbacks, including timers and socket work. An epoll-based loop can report readiness, but the application still has to return to dispatching events. Use nonblocking I/O where it fits, or offload blocking work to a bounded worker queue and return results to the loop. Delay the dependency in a test and measure whether unrelated work still meets its deadline. epoll(7): the epoll interface
Skipping fsync(). If the device promises that a configuration change survives power loss, a successful write and rename are insufficient evidence. For a replacement file on a filesystem that supports the required synchronization, write the temporary file in the same directory, check the writes and fsync() the file, then rename it over the destination and fsync() the containing directory. Check each step before acknowledging durable success. Test interruption and recovery around the update on representative storage. Killing the process can test application recovery, but it leaves the kernel running and can leave its cached writes intact. fsync(2): synchronize a file's in-core state with storage, rename(2): change the name or location of a file
Hardcoded secrets. A broker password compiled into the program ships with every copy that contains it. Deleting it from the current source leaves copies in earlier images and possibly repository history. Provision per-device credentials where supported, restrict access to the service that needs them, and revoke or rotate exposed credentials. Explain how you would check release artifacts for the old value and verify that the broker rejects it after rotation. Keep the secret itself out of logs and review comments.
No watchdog. A service that stops making progress may retain its process ID, so a restart policy triggered by process exit can miss the hang. Use a service watchdog when restarting that service is the desired recovery. A supported hardware watchdog can reset the system when its keepalives stop. Define the progress signal that permits a keepalive. A separate thread that keeps sending heartbeats regardless of worker progress can hide the failure you intended to detect. Inject a stall in the monitored work and verify recovery at the intended scope. The Linux Watchdog driver API
Unbounded queues. During a broker outage, a producer may continue adding messages while the uplink removes none. Memory then grows with the backlog. A disk-backed queue also needs a storage limit. Set a capacity and describe what happens when it is reached. A gateway might coalesce replaceable readings while reserving capacity for alarms, with an explicit rejection or backpressure policy when that capacity fills. Observe queue depth and dropped or rejected records during an outage, then check the reconnect behavior.
Score a mock interview
2 min readUse one gateway scenario so the interviewer can follow the consequences of a decision across the system. The gateway reads a sensor, stores selected readings locally, publishes to a broker, and receives over-the-air (OTA) updates. Start by asking which data must survive a reboot and how long the device is expected to operate offline. If the interviewer leaves a requirement open, state a working assumption and show where it affects your answer. Use a genuine experience for the behavioral question and label hypothetical design decisions as such.
Score each area from 0 to 2, for a total out of 12. Give 0 for a missing or incorrect answer, 1 for a correct decision with an incomplete explanation, and 2 for a correct decision that names a failure condition and a specific verification. Record one sentence of evidence for each score so the candidate can revise the answer.
| Area | What earns 2 points |
|---|---|
| App layers | Assign sensor access and publishing to named components. Describe the interface behavior when the sensor is absent and how you would exercise it. |
| Networking | Explain what reconnect does after a broker outage and how a test checks the stated policy for pending messages. |
| Data | State which change must survive power loss, when success is acknowledged, and what recovery test checks the guarantee. |
| Security | Explain where broker credentials come from, who can read them, and how you would confirm that a revoked credential fails. |
| OTA | Explain when a signed update is accepted, when a new boot is marked healthy, and how you would verify rollback when health checks fail. |
| Debugging | Connect a symptom to a hypothesis, name a measurement that could disprove it, and state what that result would change. |
For behavioral feedback, record whether the answer made the candidate's responsibility, decision, and observed result clear. Ask one follow-up about the weakest claim. If the candidate says the restart fixed the issue, ask what was measured after restart and whether it established the cause. Ask for a revised answer and compare it with the original using the same rubric.
The next lesson, The knowledge assessment, checks whether you can recall and apply the concepts you have been explaining aloud.
Key takeaways
- A behavioral answer identifies your contribution and gives evidence for the result.
- A blocking callback delays other work on the same event loop, while an unbounded queue can exhaust memory.
- Durable file replacement requires synchronizing the new file and its containing directory.
- A watchdog should receive keepalives only while the work it monitors is making progress.
Reflect
- Explain to a colleague, in two sentences: structure a behavioral answer around a situation, task, action, and result.
- Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
- What surprised you when you ran the commands yourself?
On a real board
Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.
References and further reading
- Man pageepoll(7): the epoll interface
- Man pagefsync(2): synchronize a file's in-core state with storage
- Man pagerename(2): change the name or location of a file
- Kernel documentationThe Linux Watchdog driver API
Official documentation first. Links checked when the lesson was published.