Explain how the CAN bus works and why it is popular in automotive and industrial systems.
What the interviewer wants to hear
- Differential two-wire bus with 120 ohm termination at each end
- Message IDs, not node addresses; ID also sets priority
- Non-destructive bitwise arbitration with dominant and recessive bits
- Built-in CRC, ACK, error counters and fault confinement
- CAN FD for larger payloads and faster data phase
Model answer
CAN is a multi-master serial bus on a twisted differential pair, CAN_H and CAN_L, terminated with 120 ohms at each end. That makes it resistant to the electrical noise in cars and factories. Frames carry a message identifier rather than a destination address, and any node can listen to any message. The ID also sets priority: when nodes transmit together, dominant zero bits override recessive ones, and a node that loses backs off without destroying the winning frame. CAN has strong built-in error handling with CRC, acknowledgement bits, bit stuffing checks, and error counters that move a faulty node to error-passive and finally bus-off, so one broken node cannot block the bus. Classic CAN carries up to 8 bytes at up to 1 Mbit/s; CAN FD allows 64 bytes and a faster data phase. Higher layers like CANopen or J1939 add structure.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Embedded Systems Engineer questions
- How would you write a driver for a new I2C temperature sensor?
- Explain the difference between a mutex and a semaphore in an RTOS, with examples.
- A device freezes randomly once every few days in the field. How do you debug it?
- Explain the memory layout of a typical microcontroller program: .text, .data, .bss, stack and heap.
- When would you use fixed-point arithmetic instead of floating point on a microcontroller?
- What is DMA, when would you use it, and what pitfalls do you watch for?
- Design firmware that receives text commands over UART, like "SET LED 1", and responds reliably.
- Your firmware is close to the flash and RAM limits of the MCU. How do you reduce memory usage?
- How would you design a watchdog strategy for firmware running several RTOS tasks?