Docsity

LFD116 Software Engineering Basics for Embedded Systems Practice Exam, Exams of Technology

Toggle sidebar
bg1
LFD116 Software Engineering Basics for
Embedded Systems Practice Exam
**Question 1.** Which of the following best defines an embedded system?
A) A general‑purpose computer running a full operating system
B) A dedicated computer system designed to perform a specific function within a larger device
C) A mobile phone that can run multiple applications
D) A cloud‑based service for data analytics
Answer: B
Explanation: An embedded system is a specialized computer that performs dedicated tasks,
often with real‑time constraints, and is part of a larger mechanical or electronic system.
**Question 2.** Which characteristic is *least* likely to be a constraint for an embedded
system?
A) Low power consumption
B) Unlimited memory resources
C) Strict timing (real‑time) requirements
D) Cost sensitivity
Answer: B
Explanation: Embedded systems are typically limited in memory; “unlimited memory” is not a
realistic constraint.
**Question 3.** In which domain are safety‑critical embedded systems most prevalent?
A) Social media platforms
B) Automotive electronic control units (ECUs)
C) Online gaming consoles
D) E‑book readers
Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e

Partial preview of the text

Download LFD116 Software Engineering Basics for Embedded Systems Practice Exam and more Exams Technology in PDF only on Docsity!

Embedded Systems Practice Exam

Question 1. Which of the following best defines an embedded system? A) A general‑purpose computer running a full operating system B) A dedicated computer system designed to perform a specific function within a larger device C) A mobile phone that can run multiple applications D) A cloud‑based service for data analytics Answer: B Explanation: An embedded system is a specialized computer that performs dedicated tasks, often with real‑time constraints, and is part of a larger mechanical or electronic system. Question 2. Which characteristic is least likely to be a constraint for an embedded system? A) Low power consumption B) Unlimited memory resources C) Strict timing (real‑time) requirements D) Cost sensitivity Answer: B Explanation: Embedded systems are typically limited in memory; “unlimited memory” is not a realistic constraint. Question 3. In which domain are safety‑critical embedded systems most prevalent? A) Social media platforms B) Automotive electronic control units (ECUs) C) Online gaming consoles D) E‑book readers Answer: B

Embedded Systems Practice Exam

Explanation: Automotive ECUs must meet stringent safety standards such as ISO 26262, making them safety‑critical. Question 4. Which architecture separates program and data memories, allowing simultaneous access? A) Von Neumann B) Harvard C) RISC D) CISC Answer: B Explanation: Harvard architecture has distinct memory spaces for instructions and data, enabling parallel fetches. Question 5. A microcontroller typically integrates which of the following on a single chip? A) CPU, RAM, Flash, and peripheral interfaces B) CPU, GPU, and high‑speed networking C) Only a CPU core, external RAM required D) None of the above Answer: A Explanation: MCUs combine a processor core, on‑chip RAM, non‑volatile memory, and peripherals. Question 6. Which memory type retains data without power and is commonly used for firmware storage? A) SRAM B) DRAM

Embedded Systems Practice Exam

A) They replace the need for an operating system. B) They provide an abstract interface between hardware registers and application code. C) They are only written in assembly language. D) They are executed only during system boot. Answer: B Explanation: Drivers encapsulate hardware details, presenting a clean API to higher‑level software. Question 10. Cross‑compilation is required in embedded development because: A) The target processor usually runs a different instruction set than the host PC. B) It improves the speed of the final executable. C) It eliminates the need for a debugger. D) It automatically generates hardware schematics. Answer: A Explanation: The host (e.g., x86) and target (e.g., ARM Cortex‑M) use different ISAs; a cross‑compiler generates code for the target. Question 11. Which debugging interface provides direct access to the processor’s registers and memory via a hardware probe? A) GDB remote debugging B) Printf logging C) JTAG D) Ethernet trace Answer: C Explanation: JTAG (Joint Test Action Group) allows low‑level inspection and control of the target CPU.

Embedded Systems Practice Exam

Question 12. In the Waterfall model, which phase follows “Requirements Specification”? A) Implementation B) Testing C) Design D) Maintenance Answer: C Explanation: The classic Waterfall sequence is Requirements → Design → Implementation → Verification → Maintenance. Question 13. One advantage of iterative development for embedded projects is: A) Fixed cost estimation from the start B) Early detection of integration issues through repeated cycles C) No need for documentation D) Guarantees zero defects Answer: B Explanation: Iterative cycles allow testing and refinement early, revealing integration problems sooner. Question 14. In Agile Scrum, what is the term for a short, time‑boxed development cycle? A) Sprint B) Milestone C) Phase D) Gate Answer: A

Embedded Systems Practice Exam

D) Factory Answer: C Explanation: The State pattern encapsulates state‑dependent behavior and transitions. Question 18. In hardware‑software co‑design, partitioning refers to: A) Dividing the code into multiple source files. B) Deciding which functions will be implemented in hardware (e.g., FPGA) and which in software. C) Selecting a compiler optimization level. D) Choosing a version control system. Answer: B Explanation: Partitioning allocates functionality between hardware accelerators and software to meet performance, power, and cost goals. Question 19. Which of the following is NOT a core service typically provided by an RTOS? A) Task scheduling B) Memory protection C) Graphical user interface rendering D) Inter‑process communication Answer: C Explanation: GUI rendering is an application‑level function, not a core RTOS service. Question 20. In a preemptive RTOS scheduler, a higher‑priority task can: A) Only run after the lower‑priority task finishes voluntarily. B) Interrupt (preempt) a currently running lower‑priority task.

Embedded Systems Practice Exam

C) Never be scheduled if any task is already running. D) Run only in a separate CPU core. Answer: B Explanation: Preemptive scheduling allows higher‑priority tasks to take over the CPU immediately. Question 21. Rate Monotonic Scheduling (RMS) assigns priorities based on: A) Task deadlines (earliest deadline gets highest priority). B) Task periods (shorter period → higher priority). C) Task memory usage. D) Random selection at runtime. Answer: B Explanation: RMS is a static priority algorithm where tasks with shorter periods receive higher priorities. Question 22. Earliest Deadline First (EDF) is classified as: A) A non‑preemptive algorithm. B) A dynamic priority algorithm. C) A round‑robin scheduler. D) A priority inversion technique. Answer: B Explanation: EDF calculates priorities at runtime based on the nearest absolute deadline. Question 23. Priority inversion occurs when: A) A low‑priority task holds a resource needed by a high‑priority task, and a medium‑priority task preempts the low‑priority task.

Embedded Systems Practice Exam

A) Mutual exclusion B) Hold and wait C) Circular wait D) Preemptive multitasking Answer: D Explanation: Preemptive multitasking does not contribute to deadlock; the four Coffman conditions are mutual exclusion, hold‑and‑wait, no preemption, and circular wait. Question 27. To avoid deadlock, a common strategy is to: A) Allow unlimited resource allocation. B) Impose a total ordering on resource acquisition. C) Disable interrupts globally. D) Use only non‑blocking I/O. Answer: B Explanation: Enforcing a global order prevents circular wait, eliminating one Coffman condition. Question 28. In C, the keyword volatile is used to indicate that: A) The variable should be stored in read‑only memory. B) The variable can be changed by hardware or an interrupt outside the normal program flow. C) The compiler may optimize away accesses to the variable. D) The variable is a constant. Answer: B Explanation: volatile tells the compiler not to assume the value stays unchanged between accesses.

Embedded Systems Practice Exam

Question 29. Which C++ feature is discouraged in safety‑critical embedded code due to unpredictable runtime overhead? A. Templates B. Exceptions C. Namespaces D. Inline functions Answer: B Explanation: Exceptions can cause stack unwinding and dynamic memory usage, which are problematic for deterministic, resource‑constrained systems. Question 30. Bitwise AND (&) of a register value with a mask 0x0F is typically used to: A) Set the upper four bits. B) Clear the lower four bits. C) Extract the lower four bits. D. Toggle all bits. Answer: C Explanation: ANDing with 0x0F zeroes all bits except the lower four, effectively extracting them. Question 31. MISRA C Rule 2.2 states that: A) All switch statements must have a default case. B) No use of the goto statement is allowed. C) The volatile qualifier may only be applied to objects of scalar type. D) No more than 5 levels of nested if statements. Answer: C Explanation: MISRA Rule 2.2 restricts volatile to scalar objects to avoid unintended side effects.

Embedded Systems Practice Exam

Explanation: Mocks provide a software representation of hardware interfaces, allowing isolated testing of logic. Question 35. Hardware‑in‑the‑Loop (HIL) testing primarily helps to: A) Verify software logic without any hardware. B) Test the complete system with real hardware components under simulated conditions. C) Measure power consumption of the development board. D) Replace the need for unit tests. Answer: B Explanation: HIL integrates actual hardware with a simulated environment to validate system behavior in realistic scenarios. Question 36. The mean time between failures (MTBF) of a component is: A) The average time a system spends in the failure state. B) The expected time between two consecutive failures under normal operation. C) The time required to repair a failed component. D) The total operational lifetime of the device. Answer: B Explanation: MTBF quantifies reliability by estimating how long a component operates before a failure occurs. Question 37. Which security mechanism ensures that only authorized code can be executed on boot? A) Watchdog timer B) Secure boot C) DMA controller

Embedded Systems Practice Exam

D) JTAG lockout Answer: B Explanation: Secure boot verifies cryptographic signatures of firmware before allowing execution. Question 38. A buffer overflow vulnerability in an embedded device can be mitigated by: A) Disabling all interrupts. B) Using stack canaries and bounds checking. C) Increasing the clock speed. D) Removing all global variables. Answer: B Explanation: Stack canaries detect overwrites, and bounds checking prevents writes beyond allocated buffers. Question 39. In IEC 61508, the term “Safety Integrity Level (SIL)” refers to: A) The number of CPUs in a safety system. B) The required risk reduction achieved by safety functions. C) The amount of memory allocated for safety code. D) The temperature range of operation. Answer: B Explanation: SIL defines the performance and reliability targets for safety‑related functions. Question 40. Failure Modes and Effects Analysis (FMEA) is performed primarily during which phase? A) Coding B) Requirements definition and design

Embedded Systems Practice Exam

Question 43. Which C language construct is most appropriate for defining a memory‑mapped hardware register at a fixed address? A) typedef struct with a pointer cast to the address. B) enum declaration. C) #define with a constant integer. D) static inline function. Answer: A Explanation: Defining a struct that matches the register layout and casting a constant address to a pointer allows direct field access. Question 44. What does the term “deterministic” mean in the context of an RTOS scheduler? A) The scheduler can change priorities at runtime arbitrarily. B) The execution order of tasks is predictable and bounded in time. C) Tasks are executed in random order to improve security. D) The scheduler uses machine learning to decide task order. Answer: B Explanation: Determinism ensures that task response times are known and repeatable, which is essential for real‑time guarantees. Question 45. Which of the following is a non‑functional requirement related to power for a battery‑operated sensor node? A) The node shall sample temperature every 10 ms. B) The node shall transmit data over BLE. C) The node shall consume less than 5 mW in sleep mode. D) The node shall store readings in flash memory.

Embedded Systems Practice Exam

Answer: C Explanation: Power consumption limits are non‑functional constraints. Question 46. In a real‑time system, jitter refers to: A) The average execution time of a task. B) The variation in task start or completion times relative to its period. C) The number of context switches per second. D) The CPU temperature fluctuation. Answer: B Explanation: Jitter measures the inconsistency of timing, which can affect predictability. Question 47. Which of the following best describes a “singleton” design pattern in embedded C++? A) A class that can have multiple instances across the system. B) A class that ensures only one instance exists globally. C) A class that provides thread‑safe queues. D) A class that automatically generates hardware registers. Answer: B Explanation: The Singleton pattern restricts instantiation to a single global object. Question 48. The static keyword applied to a function at file scope in C means: A) The function can be called from any translation unit. B) The function has internal linkage and is visible only within its source file. C) The function will be inlined automatically. D) The function will execute only once.

Embedded Systems Practice Exam

C) The deadline can be adjusted at runtime. D) The deadline is only relevant for low‑priority tasks. Answer: B Explanation: Hard real‑time constraints must always be met; violations can cause catastrophic outcomes. Question 52. A watchdog timer in an embedded system is primarily used to: A) Measure execution time of tasks. B) Detect and recover from software lock‑ups by resetting the system. C) Provide a high‑resolution clock source. D) Store configuration parameters. Answer: B Explanation: The watchdog must be periodically refreshed; failure to do so triggers a reset, recovering from hangs. Question 53. Which of the following is a safe way to share a variable between an ISR and main code without using a mutex? A) Declare the variable as volatile and ensure atomic read/write size (e.g., 32‑bit on a 32‑bit MCU). B) Use a busy‑wait loop inside the ISR. C) Disable all interrupts for the entire duration of the main loop. D) Store the variable in flash memory. Answer: A Explanation: volatile forces the compiler to read/write each time, and atomic accesses avoid race conditions.

Embedded Systems Practice Exam

Question 54. In a typical automotive ECU, which communication protocol is mandated for safety‑critical data exchange? A) USB B) CAN with CAN‑FD extensions C) Ethernet (100BASE‑T1) D) LIN Answer: B Explanation: CAN (and its CAN‑FD variant) is widely required for deterministic, fault‑tolerant automotive communication. Question 55. Which of the following is a primary advantage of using a microprocessor (MPU) instead of a microcontroller (MCU) in an embedded design? A) Integrated flash memory reduces cost. B) Higher processing power and ability to run full operating systems. C) Simpler peripheral set. D) Lower power consumption. Answer: B Explanation: MPUs typically lack on‑chip peripherals but offer higher performance and can run OSes like Linux. Question 56. When performing a code review for safety‑critical embedded software, which of the following items should be checked first? A. Variable naming conventions. B. Compliance with MISRA or other coding standards. C. Number of comments per function. D. Use of third‑party libraries.