Kurumo ([info]angrauko) wrote,
@ 2009-02-28 23:18:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Suppose you are given a language called C--. It is just like C, except
there is no if, no switch, and no tertiary operator: i.e. no conditionals
of any kind. Can we write all the same programs in it as in, say, C or C++,
and if so, how?

To make the problem more interesting, suppose we also remove all the
loop constructs?

I think I will ask this in interviews.



(3 comments) - (Post a new comment)


[info]vladimir000
2009-03-01 08:49 am UTC (link)
Нет проблем! Волшебное слово _asm никто не отменял:)

(Reply to this)


[info]hoack
2009-03-01 02:20 pm UTC (link)
You can use array of function pointers to emulate conditionals.

It is a good puzzle, but what's the point of asking it in interviews?

(Reply to this) (Thread)


[info]angrauko
2009-03-01 04:54 pm UTC (link)
To see if they are at least aware of the theory, maybe?
Follow up question might be to ask them how would they
write average of a set of integers.

(Reply to this) (Parent)


(3 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…