Communication Protocols · Interview question

You have a board with eight sensors, an EEPROM, and an RTC, and very few free pins. Which bus?

A strong answer

I2C. Its defining advantage is that many devices share just two wires (SDA, SCL), selected by address rather than a chip-select line, so adding the ninth or tenth device costs zero additional pins, exactly what a pin-starved board needs. These devices (sensors, EEPROM, RTC) are typically low-bandwidth, so I2C's modest speed is fine, and its ACK/NACK lets you detect a missing device. SPI would cost a chip-select GPIO per device, ten devices, ten CS lines, which defeats the pin budget; UART is point-to-point and can't multi-drop without extra hardware. The one thing to plan for with I2C here is address conflicts: if two of the sensors are the same part with the same fixed address, you'd need address-select pins, a second I2C bus, or an I2C mux. But for "many low-speed devices, few pins," I2C is the textbook choice.

What a weak answer sounds like

You know the answer. Do you know what gets you dinged?

Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.

From the lesson

Choosing UART, SPI, or I2C

A side-by-side comparison and a decision framework: pick by speed, device count, pin budget, and distance, and know when none of the three fits and you need CAN or RS-485.

More Choosing UART, SPI, or I2C questions

Browse all 472 interview questions
You have a board with eight sensors, an EEPROM, and an RTC, and very few free pins. Which bus? | EmbeddedPrep.io