These questions assess Module 2 and prepare students for embedded Linux, IoT, robotics, DevOps, and systems-engineering interviews. Strong answers state assumptions, compare alternatives, and describe evidence. Attempt the questions before reading the answer key.
Q1. Give three requirements that favor embedded Linux and three that favor a microcontroller.
Q2. Why might a mobile robot use both a Raspberry Pi and a microcontroller?
Q3. Describe the boot path from power-on to a supervised application.
Q4. What problem does the device tree solve, and why is it especially important for board-level hardware?
Q5. Why can sudden power loss corrupt more than the file most recently written?
Q6. Compare a read-only root file system, journaling, atomic file replacement, and application transactions. What different risks do they address?
Q7. Explain public-key authentication and SSH host-key verification. Which keys must remain secret?
Q8. A deployment script disables SSH host-key checking. What risk has been introduced, and what is the better approach?
Q9. Why should an application service use a dedicated account instead of root?
Q10. Explain the difference between systemctl start, enable, restart, and daemon-reload.
Q11. What does After=network-online.target guarantee, and what does it not guarantee?
Q12. Why might Restart=always be harmful for an application with invalid configuration?
Q13. Distinguish liveness, readiness, and useful externally observed behavior.
Q14. Where should executable code, configuration, secrets, durable state, runtime state, and logs normally be kept, and why separate them?
Q15. Why can incorrect time break TLS and make field diagnosis difficult?
Q16. Design a rollback method for a service whose new version changes the database schema.
Q17. A service is reported as active, but no measurements reach the server. Give a disciplined diagnostic plan.
Q18. Which evidence would convince you that a Raspberry Pi deployment can recover from realistic power and network interruptions?
A1. Linux is favored by complex networking, large libraries, protected processes, storage, remote administration, or high-level applications. A microcontroller is favored by strict timing, very low power, instant startup, simple dedicated control, or tight cost and memory limits. Requirements must be quantified.
A2. The microcontroller can maintain deterministic sensing, motor control, and watchdog behavior, while the Pi performs vision, planning, storage, networking, UI, and updates. Any claimed safety function or safe shutdown path requires separate engineering justification. The communication failure mode between them must be explicitly safe.
A3. Processor boot code starts firmware or a bootloader, which loads the kernel and device description. The kernel initializes resources and mounts the root file system, starts PID 1, and systemd activates dependencies and the application service.
A4. Board-level buses cannot always enumerate attached devices. The device tree tells the kernel which compatible device exists at which bus address and with which interrupt, clock, GPIO, and status, allowing a driver to bind correctly.
A5. Application data, directory metadata, allocation structures, journals, and controller-internal flash mapping may all have outstanding writes. Cached or reordered writes can leave mutually inconsistent state.
A6. A read-only root reduces uncontrolled system writes; journaling helps restore file-system metadata consistency; atomic replacement prevents readers from observing partial replacement files but needs synchronization for crash durability; transactions preserve application-level invariants across related data. None alone solves every layer.
A7. The client proves possession of its private key; the server holds the authorized public key. The server proves identity with its private host key; the client records or verifies the host public-key fingerprint. Both private keys remain secret.
A8. The client can be tricked into authenticating to an impostor. Maintain verified known-host records, distribute fingerprints through a trusted channel, and handle legitimate device replacement explicitly.
A9. A dedicated account limits readable files, writable directories, devices, and damage after compromise. Root defeats much of the operating system’s containment. Grant only the specific groups, capabilities, or paths required.
A10. start launches the current unit; enable configures boot-time activation; restart stops and starts the service; daemon-reload makes systemd reread changed unit definitions. Enabling does not necessarily start immediately.
A11. It orders startup after the target if that target is activated. It does not pull the target into the startup transaction; use an appropriate dependency such as Wants=network-online.target when needed. The network manager and wait-online configuration define what online means. It does not guarantee DNS, Internet access, a broker, credentials, or permanent connectivity. Applications still need reconnection behavior.
A12. A permanent configuration fault can cause rapid restart loops, log growth, load, and obscured evidence. Use validation, backoff, start limits, and a visible failed state.
A13. Liveness means the component is progressing; readiness means it can currently serve useful work; external behavior confirms that the intended result is actually observed. A process can satisfy a weak internal check while output is stale or blocked downstream.
A14. Code belongs in a protected versioned release, configuration under system policy, secrets under narrower protection, durable state in a writable persistent location, runtime state in volatile /run, and operational logs in the journal or bounded log storage. Separation improves permissions, upgrades, backup, diagnosis, and rollback.
A15. Certificates are valid only within time intervals, and distributed records require a credible ordering. Bad time can reject secure connections, reorder events, and make causes appear after effects. Record synchronization status and use monotonic time for durations.
A16. Preserve a compatible database snapshot or design a reversible migration; version both schema and software; stop or quiesce writers; test forward and backward migration; switch releases atomically; health-check; and define the point after which rollback requires data restoration rather than executable replacement.
A17. Check whether new local measurements exist and are timely; inspect service logs and restart count; verify sensor/device access; inspect queue depth; check address, route, DNS, and time; test transport and TLS; verify endpoint, credentials, and authorization; inspect server receipt; and compare timestamps and identifiers across layers.
A18. Evidence should include repeated controlled power interruption tests, file-system and application integrity checks, successful automatic boot and service start, bounded data loss defined in advance, offline buffering, reconnection and backlog delivery, restart limits, preserved logs or counters, and successful rollback. One successful reboot is not a reliability demonstration.