Interview questions / Electrical / Embedded Engineer
Electrical / Embedded Engineer interview questions
These are questions Electrical / Embedded Engineer candidates often hear, with a short note on what a strong answer covers. Reading them helps; saying your answers out loud helps more.
Why does each IC need a decoupling capacitor, and how do you choose and place it?
It supplies fast current locally because trace and via inductance stop the main supply responding at high frequency. Typical: 100 nF X7R/X5R ceramic right at the pin with a short via to the ground plane, plus a 1–10 µF bulk cap nearby. Watch DC-bias derating and self-resonance.
LDO or buck converter for 12 V to 3.3 V at 500 mA?
LDO loss = (12 − 3.3) × 0.5 ≈ 4.35 W, which is far too much heat, so use a buck. LDOs are quiet and simple when the drop or current is small; bucks are efficient but add switching noise and need careful layout. A buck followed by an LDO for sensitive analog rails is common.
State the ideal op-amp rules and design a non-inverting amplifier with a gain of 11.
With negative feedback, inputs draw no current and V+ = V−. Gain = 1 + Rf/Rg, so Rf = 10 kΩ, Rg = 1 kΩ. Then mention real limits: gain-bandwidth product, output swing (rail-to-rail?), input offset and bias current.
You need to sample a signal with content up to 1 kHz. How do you avoid aliasing?
Sample above twice the highest frequency, in practice 5–10× (say 10 kHz), and add an analog low-pass anti-aliasing filter before the ADC. Know the LSB size (Vref/2ᴺ) and make sure the source impedance lets the sample capacitor settle.
How do you drive a DC motor from a microcontroller?
Never from a GPIO pin. Use a MOSFET or H-bridge with a gate driver, PWM above hearing (~20 kHz) balanced against switching loss, dead time to prevent shoot-through, a path for inductive current (body or flyback diodes), current sensing and bulk capacitance on the supply.
How would you measure motor current?
Low-side shunt plus amplifier is simple but lifts the motor's ground. High-side catches shorts to ground but needs an amplifier with high common-mode range. Hall sensors give isolation. Size the shunt for I²R loss, use Kelvin connections, and sample in sync with PWM or filter the ripple.
I2C, SPI, UART or CAN: which do you use where on a robot?
I2C: 2 wires, addressed, slow, short runs, needs pull-ups. SPI: fast, full duplex, a chip select per device, board-level. UART: simple point-to-point. CAN: differential, noise-robust, multi-node with arbitration, 120 Ω termination at both ends; the usual choice for motor controllers across a robot.
How do you choose I2C pull-up resistors?
The bus is open-drain, so the pull-up sets rise time against bus capacitance: R_max ≈ t_r / (0.8473 × C_b). The lower limit comes from the 3 mA sink current: R_min = (Vcc − 0.4 V)/3 mA ≈ 970 Ω at 3.3 V. 2.2–4.7 kΩ is typical.
A sensor reads fine until the motors start, then gets noisy. How do you debug it?
Suspect shared ground return or EMI. Scope the sensor supply and ground relative to the MCU while the motors run. Fixes: separate high-current return paths, continuous ground plane, decoupling, twisted or shielded cables, ferrites, filtering, and sampling away from PWM edges.
How do you lay out a board that mixes motor power and sensitive analog?
Keep high-current loops small and away from analog. Give motor current its own return path to the supply. Keep an unbroken ground plane under signals and never route a signal across a plane split. Place decoupling at the pins and keep switching nodes small.
How do you read a quadrature encoder and estimate speed at both low and high RPM?
Channels A and B are 90° apart; the phase order gives direction, and counting every edge gives 4× resolution. Use the MCU's timer encoder mode. At low speed, time the period between edges; at high speed, count edges in a fixed window.
What is back-EMF and how does it affect motor control?
V = I·R + L·di/dt + Kₑ·ω. Back-EMF rises with speed and caps top speed for a given supply; torque is proportional to current (τ = Kₜ·I). When braking, the motor acts as a generator and can pump the supply rail up, so plan for bulk capacitance, a TVS or a braking resistor.
Pick a MOSFET to switch 24 V at 10 A.
N-channel low-side is easiest. Vds rating with margin (40 V or more), Rds(on) at the gate voltage you actually have (logic-level?), conduction loss I²·Rds(on), switching loss and gate charge, then thermal resistance and the safe operating area.
How do you connect a 5 V sensor to a 3.3 V microcontroller?
First check whether the pins are 5 V tolerant. For slow one-way signals a resistor divider works; for I2C use a bidirectional MOSFET shifter; for fast signals use a dedicated level translator.
What is the cutoff frequency of an RC low-pass with R = 10 kΩ and C = 100 nF?
f_c = 1/(2πRC) ≈ 159 Hz. It's −3 dB at f_c and rolls off at −20 dB/decade. Mention the phase lag it adds, which matters inside a control loop.
How do you make a robot fail safe if the firmware hangs or power dips?
Hardware watchdog and brown-out reset; motor driver enables pulled to off so drivers default to disabled; an e-stop that removes power in hardware, not just in software; and a defined safe state on reset.