Interview Embedded Software Questions

The company I work for is in the process of interviewing several embedded software candidates.

What types of questions could we ask to make sure the interviewee is an embedded software candidate and not just a high level CS major?

We've asked questions about whether they would feel more comfortable doing low level drivers or application level stuff? The usual answer we get is "I can do all of that"..... No, most people are better suited for one or the other... many can do both, but that person usually has strengths in one or the other.

Another sample questions is "What steps would you have to go through to set up an interrupt on a mirco?"

Any other ideas for interview questions?

Reply to
Eric
Loading thread data ...

You ask them questions that involve writing code, on a whiteboard, to do realistic but simple embedded systems tasks. Another good question to asks is getting them to explain their understanding of how an embedded system starts up - which leads on to their understanding of code and data sections, interrupt vectors, linkers and loaders etc.

A good open-ended question we used to ask was

... int x=1; int y=2; int z;

z = x+y;

Reply to
Pete Fenelon

Hi,

[..]

You've got me. If I was asked this in an interview I'd be stumped. What kind of non-seriously broken system could have z not being equal to three?

Cheers,

Al

Reply to
Al Borowski

Ask them to explain where you would use a volatile variable. That's always a good test to see if they've been paying attention.

Reply to
Tom Lucas

Maybe I can get one right....

1) With certain optimisers then the value of z may not be assigned until it is used. 2) z may not get used elsewhere and get completely optimised out. 3) Cosmic radiation altering the register. (clutching at straws now)
Reply to
Tom Lucas

Me too. All I can think of is that the debugger is flawed, and actually setting the breakpoint before the completion of the statement. Alternatively the code has been optimized so that the bp location no longer makes sense, indicating that the compilation should be with optimization disabled.

--
Chuck F (cbfalconer at maineline dot net)
   Available for consulting/temporary embedded and systems.
Reply to
CBFalconer

My first guess would be a system where z was never used in any further operation and the compiler optimized out the addition.

If you actually look at the assembly code when debugging, that kind of problem should be obvious.

Mark Borgerson

Reply to
Mark Borgerson

This response illustrates nicely that cute interview questions do not select good employees, merely employees who know the answers to trick questions.

Reply to
larwe

Did I say the system wasn't broken?

pete

--
pete@fenelon.com "he just stuck to buying beer and pointing at other stuff"
Reply to
Pete Fenelon

Interrupt run amok or bad prologue/epilogue. In a tasking system, too small a stack and the local storage has wandered into an actively used area of memory.

If the variables are global rather than function local (as seemes to be implied) then bad startup initialization also comes to mind.

My first step would be to figure out what x and y were.

Robert

Reply to
Robert Adsett

The compiler hasn't seen a reason to evaluate z yet. Z may not even have storage allocated, optimized out. If used later z may be simply replaced with the constant 3, but the debugger doesn't know this.

Declare z to be volatile and the compiler will be obliged to do what you said, not what it thinks you intended.

Reply to
David Kelly

As always, Google is your friend. Google for _volatile embedded_ in google groups. It gives you a pointer to a thread called "Embedded software interview question collection" which may be useful.

Regards

Josep Duran

Reply to
Josep Duran

Some good answers. It's far from being a 'trick' question, it's aimed at seeing the sort of questions candidates ask and the assumptions they make.

pete

--
pete@fenelon.com "he just stuck to buying beer and pointing at other stuff"
Reply to
Pete Fenelon

With a good optimizer, z might not even exist at the breakpoint ;-)

I'm thinking compiler bugs, optimizer quirks, ground bounce, rogue interrupts, ESD, bad MCU, bad SRAM (if the stack is in SRAM), debugger bugs, bad debug cable.

Reply to
DJ Delorie

Good tools should say z = 3 regardless of what follows. My guess is z at that moment in time is located in a register or flow evaluated so it is stored to RAM and the source level debugging information should reflect where z actually is. I am not so sure that I wouldn't be stumped on this one.

w..

Reply to
Walter Banks

That's certainly what I would hope. If it's not meant to be the start of a discussion on how you would approach the problem then it does become a trick question. A list of possibilities should just be the starting point for determining how to eliminate or confirm them.

Robert

Reply to
Robert Adsett

Is the UK currently experiencing a surplus of jobs for engineers? I'm currently recruiting a contractor/permanent hardware engineer and I've had several not even bother to turn up for the interview. This would imply that there are so many jobs available that they are not having to put any effort into finding them. Or perhaps they just take one look at the rough estate our premises are on and turn around :-)

Reply to
Tom Lucas

One thing is for certain, z should be 3 or the compiler is broken period. Although this is NOT 100% true if we talk about the debugger!

In C:

... int x=1; int y=2; int z;

are "local" defined variables ( even for main() ), they live in the stack "assigned" to the function. Since x and y are initialized statically we can assume that they do live in the stack (or scratch registers depending on the compiler of course), z on the other hand could be located in a register for optimization purposes, that is why a Debugger wouldnt be able to catch Z as a variable...

The real answer would be based on how the debugger behaves given the code generated by the compiler, optimization flags set and the rest of the code for that particular function.

Rene

Walter Banks wrote:

Reply to
rTrenado

Eric a écrit :

My company decided a long time ago we needed to be taught how to write software. They hired a consultant who arrived in a nice red sports car. We told him we were making software for devices that had no keyboard and no screen. It was hard to convince him that such things could be useful.

Reply to
Lanarcam

That was my reaction as well. If z != 3, how did the code execute well enough to even get to this point? Seems akin to the computer hardware diagnostic program contradiction -- if the hardware's working well enough to run the diagnostic program, you don't need to run it.

Reply to
Everett M. Greene

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.