The code
Embedded Linux C. It compiles. There are 3 real bugs in it: the kind that pass a bench test and fail in the field.
int diag_ping(const char *host, char *out, size_t cap)
{
char cmd[64];
sprintf(cmd, "ping -c 1 -W 1 %s", host);
FILE *f = popen(cmd, "r");
size_t n = fread(out, 1, cap, f);
out[n] = '\0';
pclose(f);
return 0;
}What an interviewer expects
- Point to each line you'd stop in a code review.
- Say what actually breaks: the failure mode, not just the rule it violates.
- Fix it, then defend the fix when asked the follow-up.
The bugs, reference fixes and the follow-up question are in the practice app, after you've tried it.
Companies that test this
Matched on the skills each company's embedded roles emphasise.
Amazon devices (Lab126, Kuiper)Consumer devices · India hiring: MediumGoogle (Pixel, Nest, Fitbit)Consumer devices · India hiring: LowHarmanAutomotive supplier · India hiring: HighSchneider ElectricIndustrial · India hiring: HighSiemensIndustrial · India hiring: HighAcsia TechnologiesEngineering services · India hiring: MediumAMD IndiaChipmaker · India hiring: MediumAptivAutomotive supplier · India hiring: Medium
Related challenges
Character driver read()Embedded Linux · Medium · 3 bugs · ~7 minSerial GPS reader on LinuxEmbedded Linux · Medium · 4 bugs · ~6 minGPIO through /dev/memEmbedded Linux · Medium · 3 bugs · ~6 minTouch driver interrupt handlerEmbedded Linux · Hard · 3 bugs · ~7 minADC over spidevEmbedded Linux · Medium · 3 bugs · ~6 min
Flag the lines, say what breaks, then fix it and build it with clang in your browser.
Find the bugs