Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Embedded software interview question collection

3,338 views
Skip to first unread message

dream...@hotmail.com

unread,
Sep 12, 2006, 9:33:16 PM9/12/06
to
Hi all,

Lately I've been assigned to interview many candidates. Sometimes it's
hard to ask questions that actually can reveal candidate's true
potential, skills, etc.

I'm trying to collect some good interview questions for embedded
software engineer positions
Can anyone contribute? Thanks!

Yuriy K.

unread,
Sep 12, 2006, 11:45:06 PM9/12/06
to
dream...@hotmail.com wrote:

> Lately I've been assigned to interview many candidates. Sometimes it's
> hard to ask questions that actually can reveal candidate's true
> potential, skills, etc.

I don't believe you would be able to do in during interview. Rejecting a
bad candidate is the best thing interviewer could expect.

> I'm trying to collect some good interview questions for embedded
> software engineer positions
> Can anyone contribute? Thanks!

Start with the definition of "volatile".

--
WBR, Yuriy.
"Resistance is futile"

Clifford Heath

unread,
Sep 13, 2006, 12:05:03 AM9/13/06
to
dream...@hotmail.com wrote:
> I'm trying to collect some good interview questions for embedded
> software engineer positions
> Can anyone contribute? Thanks!

Describe a situation where you had to diagnose a bug caused by priority inversion.

charl...@hotmail.com

unread,
Sep 13, 2006, 12:47:12 AM9/13/06
to

Give them a circuit diagram of one of your products and ask them to
look over it for a few minutes and then have them describe to you what
the components are for, why pins are connected in a certain way etc.
You don't necessarily expect an embedded software engineer to be able
to design the circuit, but this will give you an idea of whether they
are comfortable working at that level.

- Charles

Kelly Hall

unread,
Sep 13, 2006, 1:46:01 AM9/13/06
to
dream...@hotmail.com wrote:
> I'm trying to collect some good interview questions for embedded
> software engineer positions
> Can anyone contribute? Thanks!

Ask them about their favorite programming language, CPU, or EDA
software, bench scope, etc. Ask them what features in it they hate the
most.

A person who can't list the faults or shortcomings in their tools
haven't used them enough.

Kelly

Tim Wescott

unread,
Sep 13, 2006, 1:59:30 AM9/13/06
to
We would:

* Ask them to calculate the number of pixels on the screen that
corresponded to some real-world distance.

* Ask them to write said calculation in C (it was just one line -- at
least if we were going to hire them).

* Ask them to rewrite said calculation without using floating point.

* Then we'd ask some leading questions to see if they'd realize that
they had an overflow or underflow problem (with 16-bit integer
arithmetic you either had one or the other).

* Ask them how to avoid underflow.

* Ask them how to avoid overflow.

* As a bonus, if they were still standing we'd ask them how to rearrange
the calculation so that it would round to the nearest 1/2, instead of
always down.

It's amazing how many telecom guys have never realized that 'int' means
'could be 16 bit' and how many 16-bit processor guys have never realized
that 'long' means 'at least 32 bits'.

We would _not_ look for people to get all of the answers right while
standing there by the white board. What we _did_ look for was a general
knowledge of C, flexibility, the ability to listen to guidance from
fellow engineers, and grace under pressure.

Later on we'd ask them to describe some project that they'd worked on.
We were looking both for communications skills and for indications that
they had actually participated in the project somehow, and not just been
responsible for keeping the coffee warm.

Then we'd hand them off to the EE's, who would make them read
schematics. Once again they wouldn't necessarily be expected to know
how to do circuit design, they were just expected to know how to hook up
an oscilloscope -- even knowing how to ask an EE to hook up an
oscilloscope was considered sufficient.

And Lewin, if you're listening -- we didn't ask one C++ question, yet
when we trained them up on it they did just fine.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google? See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html

Tim Wescott

unread,
Sep 13, 2006, 2:05:12 AM9/13/06
to
Yuriy K. wrote:

> dream...@hotmail.com wrote:
>
>> Lately I've been assigned to interview many candidates. Sometimes it's
>> hard to ask questions that actually can reveal candidate's true
>> potential, skills, etc.
>
>
> I don't believe you would be able to do in during interview. Rejecting a
> bad candidate is the best thing interviewer could expect.
>

-- snip --

I disagree. While you can't always identify good people, you can craft
interviews so that good people can shine, and the bad candidates are
revealed (mostly).

I think the biggest suggestion that I would make is that you shouldn't
ask questions that have specific answers. Ask big, open-ended questions
and pay careful attention to the responses. If your company is big
enough to have an HR department this will give them fits, because the
best way to avoid lawsuits is to put on blindfolds and have candidates
fill in scan-tron sheets. Persevere, however.

I try to look for:

* General competence with embedded systems design (not just writing
programs in C or Ada or whatever).

* General problem solving skills and a will to participate.

* Curiosity and interest beyond just the software.

Steve at fivetrees

unread,
Sep 13, 2006, 3:44:44 AM9/13/06
to
"Tim Wescott" <t...@seemywebsite.com> wrote in message
news:bemdnaBBKJ-zA5rY...@web-ster.com...

> dream...@hotmail.com wrote:
>> Hi all,
>>
>> Lately I've been assigned to interview many candidates. Sometimes it's
>> hard to ask questions that actually can reveal candidate's true
>> potential, skills, etc.
>>
>> I'm trying to collect some good interview questions for embedded
>> software engineer positions
>> Can anyone contribute? Thanks!
>>
> We would:
>
> * Ask them to calculate the number of pixels on the screen that
> corresponded to some real-world distance.
>
> * Ask them to write said calculation in C (it was just one line -- at
> least if we were going to hire them).
>
> * Ask them to rewrite said calculation without using floating point.

Huh? Why would calculating the number of pixels on a screen involve floating
point?

Steve
http://www.fivetrees.com


Peter Dickerson

unread,
Sep 13, 2006, 4:15:31 AM9/13/06
to
"Steve at fivetrees" <st...@NOSPAMTAfivetrees.com> wrote in message
news:yeWdnRhvg58HJJrY...@pipex.net...

I took it that Tim was asking about distance on-screen, which I took could
be diagonal. In that case, assuming the screen was flat, the natural
solution would require a square root. Performing the calculation without
floating point would demonstrate some skills useful in low-end embedded
systems - how to get good enough answers. Of couse it might just be a trick
question as in max(abs(x1-x2),abs(y1-y2))...

Well, that was my interpretation anyway.

Peter


Julian Gardner

unread,
Sep 13, 2006, 4:14:18 AM9/13/06
to

"Yuriy K." <ykt...@mail.ru> wrote in message
news:ee7uqq$268$1...@news.netins.net...

Well ive been arguing with a company because they cant get to grips what
volatile really does and because of this the new piece of hardware they have
released witb an embedded processor does not work if the cache is switched
on!!!!

I have tried for 2 years to get them to understand but they still screw the
design up.

I now need to got through all my code and try to move every variable into a
seperate block of memory so there will be no memory corruption.

joolz

Tom Lucas

unread,
Sep 13, 2006, 4:27:36 AM9/13/06
to
<dream...@hotmail.com> wrote in message
news:1158111196.1...@p79g2000cwp.googlegroups.com...

I would ask what they have done outside of work that is relevent. If
someone is passionate about something then they will do it for fun as
well as when they have to.


Peter

unread,
Sep 13, 2006, 4:46:48 AM9/13/06
to

<dream...@hotmail.com> wrote in message
news:1158111196.1...@p79g2000cwp.googlegroups.com...

Show the candidate "coax" on a sheet of paper and ask how many syllables it
has. The correct answer is of course two.

Peter


Steve at fivetrees

unread,
Sep 13, 2006, 5:34:37 AM9/13/06
to
"Peter Dickerson" <first{dot}sur...@tesco.net> wrote in message
news:D6PNg.1072$2g5...@newsfe7-win.ntli.net...

Ah, my bad. I missed the "that corresponded to..." bit. Oops.

Steve
http://www.fivetrees.com


Michael N. Moran

unread,
Sep 13, 2006, 7:09:44 AM9/13/06
to
Julian Gardner wrote:
>
> Well ive been arguing with a company because they cant get to grips what
> volatile really does and because of this the new piece of hardware they have
> released witb an embedded processor does not work if the cache is switched
> on!!!!
>
> I have tried for 2 years to get them to understand but they still screw the
> design up.
>
> I now need to got through all my code and try to move every variable into a
> seperate block of memory so there will be no memory corruption.

Off topic, but ... maybe it's because my brain hasn't clicked on yet,
but what has the use of volatile got to do with cache?


--
Michael N. Moran (h) 770 516 7918
5009 Old Field Ct. (c) 678 521 5460
Kennesaw, GA, USA 30144 http://mnmoran.org

"So often times it happens, that we live our lives in chains
and we never even know we have the key."
The Eagles, "Already Gone"

The Beatles were wrong: 1 & 1 & 1 is 1

Peter

unread,
Sep 13, 2006, 7:53:51 AM9/13/06
to

"Michael N. Moran" <mi...@mnmoran.org> wrote in message
news:2CRNg.59500$e9....@bignews4.bellsouth.net...

> Julian Gardner wrote:
>>
>> Well ive been arguing with a company because they cant get to grips what
>> volatile really does and because of this the new piece of hardware they
>> have released witb an embedded processor does not work if the cache is
>> switched on!!!!
>>
>> I have tried for 2 years to get them to understand but they still screw
>> the design up.
>>
>> I now need to got through all my code and try to move every variable into
>> a seperate block of memory so there will be no memory corruption.
>
> Off topic, but ... maybe it's because my brain hasn't clicked on yet,
> but what has the use of volatile got to do with cache?
>

volatile on a variable stops a compiler from doing optimisations like
caching. This is useful if there is more than one thread using the variable
because the actual variable and a cached copy would not match.

Peter


Stef

unread,
Sep 13, 2006, 8:12:44 AM9/13/06
to
In comp.arch.embedded,
And how would the compiler do this? Will it insert a complete cache
flushing sequence after the variable update?

On the other hand, if you only worry about different threads, you do not
need to worry about the cache. All threads run on the same CPU (multi
core excluded here ;-) and will therefore use the same cached value, no
problem.

You only need to worry about the cache if there is some kind of DMA at
work. You might also run into problems with self modifying code using
separate data and instruction caches.

Use volatile for variables that get updated outside the normal execution
flow (from an interupt or from another thread). This prevents the compiler
from re-using a value read into a register, but this has nothing to do
with caches.


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

CBFalconer

unread,
Sep 13, 2006, 9:28:44 AM9/13/06
to
"Michael N. Moran" wrote:
> Julian Gardner wrote:
>>
>> Well ive been arguing with a company because they cant get to
>> grips what volatile really does and because of this the new piece
>> of hardware they have released witb an embedded processor does
>> not work if the cache is switched on!!!!
>>
>> I have tried for 2 years to get them to understand but they still
>> screw the design up.
>>
>> I now need to got through all my code and try to move every
>> variable into a seperate block of memory so there will be no
>> memory corruption.
>
> Off topic, but ... maybe it's because my brain hasn't clicked on
> yet, but what has the use of volatile got to do with cache?

Say the variable is really a hardware status bit, memory mapped.
If declared volatile in the code there will be a memory access for
each read. If the hardware diverts that read to the cached value,
it will no longer reflect reality. So the system needs some means
of automatically invalidating the cache. To me, this is a primary
objection to using memory mapped i/o ports, which can easily be
avoided with a separate i/o space.

I don't know if this is the OPs problem, but it seems likely.

--
"I was born lazy. I am no lazier now than I was forty years
ago, but that is because I reached the limit forty years ago.
You can't go beyond possibility." -- Mark Twain

--
Posted via a free Usenet account from http://www.teranews.com

Vladimir Vassilevsky

unread,
Sep 13, 2006, 11:03:34 AM9/13/06
to

dream...@hotmail.com wrote:

> Hi all,
>
> Lately I've been assigned to interview many candidates.

You can use the online testing at brainbench.com as the input filter for
the bulk.

> Sometimes it's
> hard to ask questions that actually can reveal candidate's true
> potential, skills, etc.

Ask about the design challenges that he dealt with in the past, and the
real accomplishments.


> I'm trying to collect some good interview questions for embedded
> software engineer positions
> Can anyone contribute? Thanks!
>

"Can you please tell me what are you good at".

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com

Tim Wescott

unread,
Sep 13, 2006, 11:04:32 AM9/13/06
to
Peter Dickerson wrote:

No square roots -- it's more like you need

distance_on_screen = distance_out_there * scale_factor,

and the scaling factor isn't an integer.

Besides, you could always do integer square roots.

Tim Wescott

unread,
Sep 13, 2006, 11:51:53 AM9/13/06
to
Vladimir Vassilevsky wrote:

>
>
> dream...@hotmail.com wrote:
>
>> Hi all,
>>
>> Lately I've been assigned to interview many candidates.
>
>
> You can use the online testing at brainbench.com as the input filter for
> the bulk.

Interesting. I didn't see one that really pertained to embedded
systems, but one could do some generic stuff.


>
>> Sometimes it's
>> hard to ask questions that actually can reveal candidate's true
>> potential, skills, etc.
>
>
> Ask about the design challenges that he dealt with in the past, and the
> real accomplishments.
>

No, don't. I've been there. Everyone is prepared to talk about design
challenges and accomplishments.

Ask them to choose some project that they feel proud about, and give a
45 minute chalk talk (you may have to explain what 'chalk' is to the
20-somethings). We* would ask them to give it as if we were engineers
new on the team, or visiting firemen, or whatever. In the course of the
chalk talk look for design challenges they overcame, and accomplishments
that they made.

If they can't talk about the project that they're most proud about and
make it clear what they've done personally then chances are they haven't
really done anything.

Note that you will have to make some judgments about personality, but
you can usually tell the difference between 'modest' and 'didn't do
anything'.


>
>> I'm trying to collect some good interview questions for embedded
>> software engineer positions
>> Can anyone contribute? Thanks!
>>
>
> "Can you please tell me what are you good at".
>

I always liked "Can you please tell me what you're bad at". I finally
ended up starting my answer with "Answering contrived, trendy interview
questions".

Once again, this is a canned interview question that folks will have
canned answers to. It's not a bad question to ask, but it's easy to
fake the answer.

For a while we were interviewing candidates, and for some reason
_everyone_ was bringing a physical sample of their work. We had EEs
bringing circuit boards they'd designed, software guys bringing sheafs
of paper. I'm sure that the mechanical engineers had to deal with
dripping hydraulic cylinders. Come to think of it, I'm glad I wasn't
interviewing for an engineer to develop sewage treatment equipment...

* I say "we" because this came out of a several-year long push at a
previous employer years ago. I was one of a few lead software engineers
that did a lot of interviewing. While I contributed to what was asked,
I was not the main developer of the interview strategy. I thought it
was really keen, however, and would certainly do it again should I ever
have to interview someone.

David Ashley

unread,
Sep 13, 2006, 11:56:53 AM9/13/06
to
CBFalconer wrote:
> Say the variable is really a hardware status bit, memory mapped.
> If declared volatile in the code there will be a memory access for
> each read. If the hardware diverts that read to the cached value,
> it will no longer reflect reality. So the system needs some means
> of automatically invalidating the cache. To me, this is a primary
> objection to using memory mapped i/o ports, which can easily be
> avoided with a separate i/o space.

Any caching system worth its salt ought to have a mechanism to
designate cacheable and non-cacheable regions. Just make sure
the i/o ports are non-cacheable.

Separate i/o vs memory space -- lots of cpu's only have memory
space (like ppc). Not always an option.

-Dave

--
David Ashley http://www.xdr.com/dash
Embedded linux, device drivers, system architecture

Tim Wescott

unread,
Sep 13, 2006, 12:07:00 PM9/13/06
to
Julian Gardner wrote:

Declaring a variable as 'volatile' wouldn't solve the cacheing problem,
at least not in any of the systems I've worked on. The 'volatile'
keyword will prevent the _compiler_ from caching a variable on it's own,
but it won't prevent the cache from caching it -- you have to do that
when you set up the MMU.

For that matter, if you're having true 'volatile' declaration problems
turning the cache off shouldn't fix it -- because it's a code generation
issue, not a cache handling issue.

Dingo

unread,
Sep 13, 2006, 12:53:24 PM9/13/06
to

I'm sure that question would stump many interviewees.

"I my free time I ... I ... I ...? There must be some
mistake. I thought this was an engineering position."

Julian Gardner

unread,
Sep 13, 2006, 1:08:22 PM9/13/06
to
Thats one of the problems, they have no cache area, just all memory and the
compiler also uses another instruction to access volatile.

Now when the cache is off then the two different commands work the same but
with the cache on a non-volatile write goes to cache (no write through) but
a volatile write bypasses the cache altogether, only when you move to a
different cache line is it written into memory. so if you have a volatile
variable in the middle of a block of data and you write to it then as soon
as you read/write outside the cached area the variable gets its old value
back.

joolz

"Tim Wescott" <t...@seemywebsite.com> wrote in message

news:LYudnVHqOegNsZXY...@web-ster.com...

Jim Stewart

unread,
Sep 13, 2006, 1:45:35 PM9/13/06
to
Peter wrote:

Then axe them how to pronouce "nuclear"


Steve at fivetrees

unread,
Sep 13, 2006, 1:53:38 PM9/13/06
to
"Jim Stewart" <jste...@jkmicro.com> wrote in message
news:u_-dnTOhyYvB3pXY...@omsoft.com...

> Peter wrote:
>
>> Show the candidate "coax" on a sheet of paper and ask how many syllables
>> it has. The correct answer is of course two.
>
> Then axe them how to pronouce "nuclear"

Or spell the word "ask" ;).

Sorry, couldn't resist...

Steve
http://www.fivetrees.com


Jim Stewart

unread,
Sep 13, 2006, 2:01:32 PM9/13/06
to
Steve at fivetrees wrote:
> "Jim Stewart" <jste...@jkmicro.com> wrote in message
> news:u_-dnTOhyYvB3pXY...@omsoft.com...
>
>>Peter wrote:
>>
>>
>>>Show the candidate "coax" on a sheet of paper and ask how many syllables
>>>it has. The correct answer is of course two.
>>
>>Then axe them how to pronouce "nuclear"
>
>
> Or spell the word "ask" ;).

Now you're being culturally insensitive (:

Steve at fivetrees

unread,
Sep 13, 2006, 3:44:12 PM9/13/06
to
"Jim Stewart" <jste...@jkmicro.com> wrote in message
news:Me2dnZIVeIiE2pXY...@omsoft.com...

LOL ;).

Steve
http://www.fivetrees.com


steve_s...@hotmail.com

unread,
Sep 13, 2006, 3:54:14 PM9/13/06
to
Julian Gardner wrote:
> Thats one of the problems, they have no cache area, just all memory and the
> compiler also uses another instruction to access volatile.

What processor is that? I've not run into ones that have special
machine instructions for volatile. Rather, the compiler mostly
avoids using registers for the memory in question, so that it
accesses the real location each time the variable is used.

> Now when the cache is off then the two different commands work the same but
> with the cache on a non-volatile write goes to cache (no write through) but
> a volatile write bypasses the cache altogether, only when you move to a
> different cache line is it written into memory. so if you have a volatile
> variable in the middle of a block of data and you write to it then as soon
> as you read/write outside the cached area the variable gets its old value
> back.

Cache is certainly an issue for the keeping things consistent, but
in my experience this is not related to "volatile". Rather, the cache
problem is avoided by explicitly turning off the cache where
necessary. For example, if I map a hardware register to a virtual
address, I tell the routine that gives me the virtual address that
caching should be turned off here. Not related to the compiler
like volatile is.

But if there is a processor with special machine instruction to
bypass cache, well, I learn something new every day... Not
sure I'd want to take advantage of it though since it sounds
rather unportable.

Regards,
Steve

Darin Johnson

unread,
Sep 13, 2006, 5:04:03 PM9/13/06
to
Yuriy K. wrote:
> Start with the definition of "volatile".

I've confused candidates by asking about "const volatile". I don't
think it's a useful question though, as it's mostly a trivia question.
When I asked this I always wanted to get an impression about how
the candidate thought about the problem, but it turned out that so
many spent enough time being baffled by the question that they
never got to the meatier issues.

Some people feel strongly that candidates should know all of the
subtleties of a language, but I don't think necessary in practice.
I sort of get the impression that the people who do best on the
trivia questions are often the bright people just out of school as
opposed to the bright people with lots of experience.

So I tend to ask things that indicate how much actual practical
experience they've had. Ie, say "give me an example of how
you've used this".

--
Darin Johnson

Julian Gardner

unread,
Sep 13, 2006, 5:05:43 PM9/13/06
to
its the arc core and it has a extension of .di which can be used in both ld
and st (ld.di and st.di) which is what the compiler produces for volatile
read/writes

if you turn this off then when you read a real volatile like the rs232
registers then the cache comes into play and you dont see the change in the
say status register.

So the only way i can see of getting this to work is by placing all
volatiles into a seperate region and then selectivly going through my code
and using a pragma turn on/off the compiler switch for the .di

joolz

<steve_s...@hotmail.com> wrote in message
news:1158177254.3...@i42g2000cwa.googlegroups.com...

PeteS

unread,
Sep 13, 2006, 5:40:46 PM9/13/06
to

Some many years ago [about 15, as I recall] I had to deal with with
'rate centres' (as they are known to BellCore) and wrote a program to
plot the picture on the screen of a VGA screen, using appropriate
scaling, of all known rate centres. It was a nice map of the USA
showing the major Interstates in lower density regions.

Interesting to do, certainly, and I had to do it in integer mathematics
as I had to provide pixel addresses :)

Cheers

PeteS

PeteS

unread,
Sep 13, 2006, 5:51:52 PM9/13/06
to
I once completely stumped a candidate with the simple question [1]:

'What is an embedded system?'

The poor guy floundered, which told me he had problems dealing with
'new' (perhaps unknown) territory, so he was ultimately rejected.

I am always interested in just what the candidate thinks what an
embedded system *is*; then we can move on to what *my* embedded systems
are :)

I also want to know how a person will react when confronted with
completely new things, which is common in embedded systems (those who
have been in it more than 20 years will understand this ;)


[1] There is enough debate about this amongst those of us who have been
doing it for decades. I can't expect someone new to *know* what it is
as we can't agree on what it is.
Indeed, if someone claimed to *know* what it is, as a definable object,
I would be very sceptical indeed; there's a difference between
confidence and arrogance (although it's not arrogance if you're right
;)

Cheers

PeteS

Paul E. Bennett

unread,
Sep 13, 2006, 6:11:18 PM9/13/06
to
Kelly Hall wrote:

> dream...@hotmail.com wrote:
>> I'm trying to collect some good interview questions for embedded
>> software engineer positions
>> Can anyone contribute? Thanks!
>

> Ask them about their favorite programming language, CPU, or EDA
> software, bench scope, etc. Ask them what features in it they hate the
> most.
>
> A person who can't list the faults or shortcomings in their tools
> haven't used them enough.
>
> Kelly

Having used quite a variety of different tools (of all sorts) I never found
that the shortcomings of any of them were more than a mere minor niggle. I
would expect any embedded engineer to be able to work around a few minor
shortcomings in the equipment and tools he is using and still turn out a
dependable system. Then, I never went in for needing extremely complex
equipment or tools in the first place.

I would be impressed if, given a non-working logic board, the candidate
could diagnose the probable fault with the simplest available tools.

--
********************************************************************
Paul E. Bennett ....................<email://p...@amleth.demon.co.uk>
Forth based HIDECS Consultancy .....<http://www.amleth.demon.co.uk/>
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-811095
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************

Jim Stewart

unread,
Sep 13, 2006, 7:01:25 PM9/13/06
to

Are you old enough to remember the time
before the term was used. In the 70's and
early 80's it was "dedicated computer system"
or possibly "OEM computer".

I saw lots of PDP8's embedded in the bellies
of instruments, typesetters and cnc machines
and none of them were referred to as "embedded"

I think EDN or Electronic Design coined the
term "embedded system"

Neil Cherry

unread,
Sep 13, 2006, 7:57:53 PM9/13/06
to
On 13 Sep 2006 14:51:52 -0700, PeteS wrote:
> I once completely stumped a candidate with the simple question [1]:
>
> 'What is an embedded system?'
>
> The poor guy floundered, which told me he had problems dealing with
> 'new' (perhaps unknown) territory, so he was ultimately rejected.
>
> I am always interested in just what the candidate thinks what an
> embedded system *is*; then we can move on to what *my* embedded systems
> are :)

I wouldn't mind if someone would describe what an embedded system
is. I tried to describe an ARM board with dynamic RAM and Linux as the
OS as embedded and caught a bit of trouble for it.

And before anyone gets too into it. I'm not a programmer (I know a
little software) and not a hardware engineer (EET by schooling). My
last 16 years have been in networking.

--
Linux Home Automation Neil Cherry nch...@linuxha.com
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
http://home.comcast.net/~ncherry/ Backup site

Yuriy K.

unread,
Sep 13, 2006, 8:16:51 PM9/13/06
to
Clifford Heath wrote:

>> I'm trying to collect some good interview questions for embedded
>> software engineer positions
>

> Describe a situation where you had to diagnose a bug caused by priority
> inversion.

And do not hire a good person who just have not worked with such
problems. Unless you are looking for very specific RTOS experience.

--
WBR, Yuriy.
"Resistance is futile"

Yuriy K.

unread,
Sep 13, 2006, 8:20:33 PM9/13/06
to
Tom Lucas wrote:

>> I'm trying to collect some good interview questions for embedded
>> software engineer positions
>

> I would ask what they have done outside of work that is relevent. If
> someone is passionate about something then they will do it for fun as
> well as when they have to.

As long as they are young. Then come wife, kids, house (not necessary in
this particular sequence :)).

Michael N. Moran

unread,
Sep 13, 2006, 8:47:16 PM9/13/06
to
CBFalconer wrote:
> "Michael N. Moran" wrote:
>
>>Julian Gardner wrote:
>>
>>>Well ive been arguing with a company because they cant get to
>>>grips what volatile really does and because of this the new piece
>>>of hardware they have released witb an embedded processor does
>>>not work if the cache is switched on!!!!
>>>
>>>I have tried for 2 years to get them to understand but they still
>>>screw the design up.
>>>
>>>I now need to got through all my code and try to move every
>>>variable into a seperate block of memory so there will be no
>>>memory corruption.
>>
>>Off topic, but ... maybe it's because my brain hasn't clicked on
>>yet, but what has the use of volatile got to do with cache?
>
>
> Say the variable is really a hardware status bit, memory mapped.
> If declared volatile in the code there will be a memory access for
> each read. If the hardware diverts that read to the cached value,
> it will no longer reflect reality. So the system needs some means
> of automatically invalidating the cache. To me, this is a primary
> objection to using memory mapped i/o ports, which can easily be
> avoided with a separate i/o space.

In cached systems, the MMU (or similar) is configured to prevent
caching to memory mapped I/O regions.

Even if you have memory mapped I/O registers (incorrectly) configured
as cached, using volatile will not help you. Volatile only prevents
the compiler from eliminating (optimizing away) what it views as
redundant loads or stores. Compilers don't even know if the generated
code is operating in/on cached or uncached regions of memory.

Even more interesting is that volatile by itself doesn't even
ensure that loads and stores are performed in program specified
order if the processor employs out-of-order execution. In this
case, the programmer must insert memory barrier instructions
such as the PPC eieio instruction between the appropriate
loads and stores (to volatile locations).

Michael N. Moran

unread,
Sep 13, 2006, 8:58:32 PM9/13/06
to
Julian Gardner wrote:
> Thats one of the problems, they have no cache area, just all memory and the
> compiler also uses another instruction to access volatile.
>
> Now when the cache is off then the two different commands work the same but
> with the cache on a non-volatile write goes to cache (no write through) but
> a volatile write bypasses the cache altogether, only when you move to a
> different cache line is it written into memory. so if you have a volatile
> variable in the middle of a block of data and you write to it then as soon
> as you read/write outside the cached area the variable gets its old value
> back.
>

Please don't top-post.

It sounds like you have an I/O region with caching enabled. Don't
do that, it hurts ;-) You need to set up your MMU /page tables
correctly to avoid this.

Eric

unread,
Sep 13, 2006, 9:06:59 PM9/13/06
to
dream...@hotmail.com wrote:

> I'm trying to collect some good interview questions for embedded
> software engineer positions

Give them a situation where they need to pick an MCU for a given task,
and give a reasonable number of facts about the task. Tell them to
explain the pros and cons of using various MCU devices and families in
this scenerio. Also, tell them that their final chip selection isn't
the issue here, but rather they'll be evaluated based on their general
knowledge of the tradeoffs and how well they "make the case" for their
choice.

Proper chip selection early in the design cycle is essential. Even if
your company only works within one chip family, there are almost always
a number of individual members that have to be considered. Pin counts
and functions, on-chip peripherals, RAM, flash, power dissipation,
speed, etc are all important.

You can also ask them which MCUs they've worked with, and once you have
the answer, ask a couple questions about them (best and worst features,
problems they encountered when working with them, etc). Look for
answers that hint about actual "hands on" experience. I even might not
count it against him if I disagree with his findings in a particular
case, but I'd like to hear words that don't come directly from a data
sheet. People need a good mind more than they need a good cheatsheet.

Eric

Kelly Hall

unread,
Sep 13, 2006, 9:13:04 PM9/13/06
to
Paul E. Bennett wrote:
> Having used quite a variety of different tools (of all sorts) I never found
> that the shortcomings of any of them were more than a mere minor niggle. I
> would expect any embedded engineer to be able to work around a few minor
> shortcomings in the equipment and tools he is using and still turn out a
> dependable system. Then, I never went in for needing extremely complex
> equipment or tools in the first place.

I'm not saying that every tool has major faults. But every tool I've
worked with for any length of time has demonstrated nits or
irregularities or something else that increased my frustration level by
some amount.

(Actually: one of the few tools I've used that hasn't demonstrated any
nits to me was my trusty HP-11C calculator. Maybe it was too simple to
have nits. Every PCB or schematic capture tool I've used has tweaked my
blood pressure, though.)

The goal of the question is to determine if the candidate has more than
passing familiarity with any tool they claim to know well.

Kelly

Michael N. Moran

unread,
Sep 13, 2006, 9:15:22 PM9/13/06
to
Julian Gardner wrote:
> its the arc core and it has a extension of .di which can be used in both ld
> and st (ld.di and st.di) which is what the compiler produces for volatile
> read/writes

Pretty please don't top-post.

Interesting compiler treatment of volatile by the compiler.

> if you turn this off then when you read a real volatile like the rs232
> registers then the cache comes into play and you dont see the change in the
> say status register.

IOW, your seeing the cached value of the memory location (which isn't
memory).

> So the only way i can see of getting this to work is by placing all
> volatiles into a seperate region and then selectivly going through my code
> and using a pragma turn on/off the compiler switch for the .di

What are the other variables on the cache line? More registers?
RAM? If registers, then you need to disable the cache for that
region of memory. It would be highly unlikely that the locations
surrounding a status register would be RAM used for "normal"
program variables.

Robert Adsett

unread,
Sep 13, 2006, 9:42:10 PM9/13/06
to

Darin Johnson wrote:
> Yuriy K. wrote:
> > Start with the definition of "volatile".
>
> I've confused candidates by asking about "const volatile". I don't
> think it's a useful question though, as it's mostly a trivia question.

Actually I use it fairly frequently for readonly status registers.
It's good code hygiene.

Robert

Darin Johnson

unread,
Sep 13, 2006, 10:27:12 PM9/13/06
to
Yuriy K. wrote:

> Clifford Heath wrote:
> > Describe a situation where you had to diagnose a bug caused by priority
> > inversion.
>
> And do not hire a good person who just have not worked with such
> problems. Unless you are looking for very specific RTOS experience.

I can't recall any situations where I had such problems. But I
certainly know what problems can occur, and ways to remedy them.
The project I'm working on now had the problem before I joined the
company. I've probably worked on other systems systems that had
priority inversion going on somewhere, but which didn't cause bugs
that were noticed or important enough to fix right away. (usually
only a portion of real-time code actually has timing requirements)

A much more commonly encountered bug though would be deadlock.
I've run across several candidates that don't do well even describing
what this is in the general case and draw a complicated diagram on
the whiteboard trying to explain them. (worse is when I find
this bug in a commercial RTOS component and their developer
working on the fix doesn't seem to understand deadlocks)

--
Darin Johnson

Tom Lucas

unread,
Sep 14, 2006, 5:38:59 AM9/14/06
to
"Yuriy K." <ykt...@mail.ru> wrote in message
news:eea76t$bk5$3...@news.netins.net...

I suppose the sequence may depend on the attractiveness and
responsibility of the candidate. Can't get a girl until he has a house
and then, once he has one whoops here come kids - better make her a wife
;-)

I think the need for extra-curricular activity decreases as you get
older but if I was recruiting fresh graduates then I would be very keen
to find out what they have done over and above their schooling.


Tom Lucas

unread,
Sep 14, 2006, 5:41:25 AM9/14/06
to
"Eric" <engle...@yahoo.com> wrote in message
news:1158196018.9...@p79g2000cwp.googlegroups.com...

And then tell him which processor he has to use because the manufacturer
gave the procurement department a particularly fine lunch and became the
preferred supplier
:-p


Clifford Heath

unread,
Sep 14, 2006, 7:21:01 AM9/14/06
to
Darin Johnson wrote:
> Yuriy K. wrote:
>> Clifford Heath wrote:
>>> Describe a situation where you had to diagnose a bug caused by priority
>>> inversion.
>> And do not hire a good person who just have not worked with such
>> problems. Unless you are looking for very specific RTOS experience.
> I can't recall any situations where I had such problems.

I agree. I'd ask the question mainly to see whether I got a baffled
expression or some kind of cogent response, whether or not they'd
actually had the face the problem. It's just always better to say
"tell me about a case where you had to ..." than to say "tell me
in what situation this might happen and how you would handle it".
IOW, ask for actual experiences, not taught techniques.

David Brown

unread,
Sep 14, 2006, 7:37:12 AM9/14/06
to
Stef wrote:
> In comp.arch.embedded,
> Peter <mel...@hotmail.com> wrote:
>> "Michael N. Moran" <mi...@mnmoran.org> wrote in message
>> news:2CRNg.59500$e9....@bignews4.bellsouth.net...

>>> Julian Gardner wrote:
>>>> Well ive been arguing with a company because they cant get to grips what
>>>> volatile really does and because of this the new piece of hardware they
>>>> have released witb an embedded processor does not work if the cache is
>>>> switched on!!!!
>>>>
>>>> I have tried for 2 years to get them to understand but they still screw
>>>> the design up.
>>>>
>>>> I now need to got through all my code and try to move every variable into
>>>> a seperate block of memory so there will be no memory corruption.
>>> Off topic, but ... maybe it's because my brain hasn't clicked on yet,
>>> but what has the use of volatile got to do with cache?
>>>
>> volatile on a variable stops a compiler from doing optimisations like
>> caching. This is useful if there is more than one thread using the variable
>> because the actual variable and a cached copy would not match.
>>
> And how would the compiler do this? Will it insert a complete cache
> flushing sequence after the variable update?
>
> On the other hand, if you only worry about different threads, you do not
> need to worry about the cache. All threads run on the same CPU (multi
> core excluded here ;-) and will therefore use the same cached value, no
> problem.
>
> You only need to worry about the cache if there is some kind of DMA at
> work. You might also run into problems with self modifying code using
> separate data and instruction caches.
>
> Use volatile for variables that get updated outside the normal execution
> flow (from an interupt or from another thread). This prevents the compiler
> from re-using a value read into a register, but this has nothing to do
> with caches.
>
>

In embedded programming, the biggest use of non-cache access (and of
volatile access) is for accessing memory mapped peripherals.

Sometimes it is possible for the processor to choose to avoid the cache
- the Nios soft processor from Altera uses the highest address bit to
indicate a non-cache access, and thus "volatile" avoids the cache.
However, that's an unusual case. The most common volatile/cache problem
is the misunderstanding that some people have when they believe that
"volatile" accesses avoid the cache.

Stef

unread,
Sep 14, 2006, 7:52:00 AM9/14/06
to
In comp.arch.embedded,
True, and this could be catagorized as DMA. The peripheral directly
modifies the memory mapped registers.

> Sometimes it is possible for the processor to choose to avoid the cache
> - the Nios soft processor from Altera uses the highest address bit to
> indicate a non-cache access, and thus "volatile" avoids the cache.
> However, that's an unusual case. The most common volatile/cache problem
> is the misunderstanding that some people have when they believe that
> "volatile" accesses avoid the cache.

I was not aware of such a processor. My only hands-on experience with
caches is on the AT91RM9200 (ARM 920T). On this one you can tell the
MMU which areas to cache and which not. As I understand it, this is far
more common the your Nios example. Volatile has no effect on the cache,
but is needed in addition to turning the cache off for the I/O areas.

Also got bitten by the cache when using a serial driver that uses the
PDC (sort of DMA on AT91 devices). I had to use an uncached area of
memory for the PDC buffers to get it working.


--
Stef (remove caps, dashes and .invalid from e-mail address to reply by mail)

David Brown

unread,
Sep 15, 2006, 4:03:04 AM9/15/06
to

That strikes me as a strange way to view it, but I suppose it depends on
where you are coming from - for my type of programming, caches and DMA
are very high-end features, while memory-mapped peripherals are accessed
continuously.

>> Sometimes it is possible for the processor to choose to avoid the cache
>> - the Nios soft processor from Altera uses the highest address bit to
>> indicate a non-cache access, and thus "volatile" avoids the cache.
>> However, that's an unusual case. The most common volatile/cache problem
>> is the misunderstanding that some people have when they believe that
>> "volatile" accesses avoid the cache.
>
> I was not aware of such a processor. My only hands-on experience with
> caches is on the AT91RM9200 (ARM 920T). On this one you can tell the
> MMU which areas to cache and which not. As I understand it, this is far
> more common the your Nios example. Volatile has no effect on the cache,
> but is needed in addition to turning the cache off for the I/O areas.
>

That's a much more common arrangement (and you can configure cache areas
on the Nios too) - I was just using it as an example.

> Also got bitten by the cache when using a serial driver that uses the
> PDC (sort of DMA on AT91 devices). I had to use an uncached area of
> memory for the PDC buffers to get it working.
>

Yes, DMA and caches are fun. Live is a lot easier when your cpu clock
speeds match your memory speeds and you don't have to bother with caches.


Paul Keinanen

unread,
Sep 15, 2006, 5:14:13 AM9/15/06
to
On Wed, 13 Sep 2006 19:16:51 -0500, "Yuriy K." <ykt...@mail.ru> wrote:

>Clifford Heath wrote:
>
>>> I'm trying to collect some good interview questions for embedded
>>> software engineer positions
>>
>> Describe a situation where you had to diagnose a bug caused by priority
>> inversion.
>
>And do not hire a good person who just have not worked with such
>problems. Unless you are looking for very specific RTOS experience.

There are quite a lot of people who do not lock multiple resources or
design their data structures in such a way that atomic variable
updates can be used or use the RTOS in a way that each data structure
has a clear owner.

I first heard the term "priority inversion" when NASA had some
problems with their Mars rovers perhaps a decade ago, but I had not
encountered that problem previously, even after working with various
real time kernels for more than a decade before that.

Paul

Stef

unread,
Sep 15, 2006, 9:26:47 AM9/15/06
to
In comp.arch.embedded,
David Brown <da...@westcontrol.removethisbit.com> wrote:
> Stef wrote:
>> In comp.arch.embedded,
>> David Brown <da...@westcontrol.removethisbit.com> wrote:
>>>>
>>> In embedded programming, the biggest use of non-cache access (and of
>>> volatile access) is for accessing memory mapped peripherals.
>>>
>> True, and this could be catagorized as DMA. The peripheral directly
>> modifies the memory mapped registers.
>
> That strikes me as a strange way to view it, but I suppose it depends on
> where you are coming from - for my type of programming, caches and DMA
> are very high-end features, while memory-mapped peripherals are accessed
> continuously.

Maybe a bit odd to look at it like that, but plausable. But I must admit
I only thought of it to get out of the fact that I had overlooked the most
obvious reason for using volatile. ;-) Sorry about that.

Darin Johnson

unread,
Sep 15, 2006, 3:06:06 PM9/15/06
to
Paul Keinanen wrote:
> I first heard the term "priority inversion" when NASA had some
> problems with their Mars rovers perhaps a decade ago, but I had not
> encountered that problem previously, even after working with various
> real time kernels for more than a decade before that.

It can be very subtle and difficult to detect. Usually when there
is some priority inversion effect it won't be noticed; the code
isn't stuck and the extra length of time that some operations take
to run aren't immediately noticed.

It's probably most common in larger systems that have lots of tasks
and broad use of RTOS or library services. Ie, if the memory
allocation
routines use a mutex (which is a very normal thing to do), then any
high priority task that uses these routines could be subject to
priority
inversion.

--
Darin Johnson

Rufus V. Smith

unread,
Oct 6, 2006, 11:45:19 AM10/6/06
to

"Paul E. Bennett" <p...@amleth.demon.co.uk> wrote in message
news:ee9vb6$im0$1$8300...@news.demon.co.uk...

> Kelly Hall wrote:
>
>> dream...@hotmail.com wrote:
>>> I'm trying to collect some good interview questions for embedded
>>> software engineer positions
>>> Can anyone contribute? Thanks!
>>
>> Ask them about their favorite programming language, CPU, or EDA
>> software, bench scope, etc. Ask them what features in it they hate the
>> most.
>>
>> A person who can't list the faults or shortcomings in their tools
>> haven't used them enough.
>>
>> Kelly
>
> Having used quite a variety of different tools (of all sorts) I never
> found
> that the shortcomings of any of them were more than a mere minor niggle. I
> would expect any embedded engineer to be able to work around a few minor
> shortcomings in the equipment and tools he is using and still turn out a
> dependable system. Then, I never went in for needing extremely complex
> equipment or tools in the first place.
>
> I would be impressed if, given a non-working logic board, the candidate
> could diagnose the probable fault with the simplest available tools.
>

A proud personal achievement of my own was when I turned a $10K+ logic
analyzer into a $25 voltmeter.

I just twiddled with the switching thresholds of several inputs, then
hooked them on the same line...

Not so instant A/D converter.

Although this is very useful when a signal is expected to stay within
a range.

Rufus


PeteS

unread,
Oct 7, 2006, 1:09:52 PM10/7/06
to

Reminds me of a time I showed an acquaintance the limits of a logic
analyzer - it doesn't tell you what voltages or ringing occured. All it
does is show a threshold was crossed.
I did some work with the menus in a HP (now Agilent) analyzer to trigger
a LeCroy scope to nail down a problem.

Cheers

PeteS

badal_akr

unread,
Apr 10, 2008, 10:06:13 AM4/10/08
to
I think, this guy himself is preparing for the interviews questions to
face.


>"Steve at fivetrees" <st...@NOSPAMTAfivetrees.com> wrote in message
>news:yeWdnRhvg58HJJrY...@pipex.net...
>> "Tim Wescott" <t...@seemywebsite.com> wrote in message
>> news:bemdnaBBKJ-zA5rY...@web-ster.com...
>> > dream...@hotmail.com wrote:
>> >> Hi all,
>> >>
>> >> Lately I've been assigned to interview many candidates. Sometimes
it's
>> >> hard to ask questions that actually can reveal candidate's true
>> >> potential, skills, etc.
>> >>

>> >> I'm trying to collect some good interview questions for embedded
>> >> software engineer positions
>> >> Can anyone contribute? Thanks!
>> >>

Everett M. Greene

unread,
Apr 10, 2008, 2:25:21 PM4/10/08
to

Perhaps this is a test to see if the interviewee is alert
enough to realize that the questions as presented are
impossible to answer without further information. If
that is the intent, it represents a common real-world
situation...

0 new messages