[nycbug-talk] MSNBC on the decline of technology jobs

Marc Spitzer mspitzer
Wed Jun 22 15:00:13 EDT 2005

On 6/22/05, alex at pilosoft.com <alex at pilosoft.com> wrote:
> On Wed, 22 Jun 2005, Francisco Reyes wrote:
> If you want me to give examples in software development, my favorite
> interview question is "c=0; c=c++;" what is the value of c?  The right
> answer is 'undefined', it can be 0, 1, or 500. Now, its all about how

actually I would say 1, compilers may differ but according to what I
remember of C, been years, it should be 1.  Here is why:

1: c=0
2: c=c ( c=0)
3 : c++ ( c = 0 + 1)

that is how it should work, gcc 3.3.3 agrees with me.  The 500 thing
is not plausable, 0 and  1 are though.

here is a more fun one:
c=0; c =+ ++c;

here I would vote for 2, gcc says 1
1: c=0
2: ++c ( c= 0+1)
3 c= c+c (c = 1+1)

> someone thinks about resolving this: Break the statement into operations,
> and try to figure whether assignment or post-increment will happen first.

by definition post incrament happens after assignment, again compilers
may vary but that is how it should work

> It shows whether you know what expression is, what rvalue/lvalue is, what
> the code is going to be *compiled* to, etc.
> C has a lot of "gotchas" - if you don't know them and can't recognize
> them, you'll fail my interview. I like to give examples that'd make a
> difference between signed int/unsigned int, proper casting, why you
> shouldn't use strcpy, why you shouldn't cast a pointer into an int. (Note:
> just merely knowing that you *shouldnt* doesn't give you any points on
> this test, you need to know why). Those questions I consider

cast a pointer into an int bad for 2 reasons:
1: size mismatch, shoe horn 64 bits into 32 bad
2: the null pointer is not gaurenteed to be 0, if I remember my triva
correctly dec alpha chips used an address that could not be addressed
by the hardware as the null address of the pointer in question and it
did not equal 0.  I may be wrong on this could have been mainframes. 
I do think they did a compiler hack to map the NULL to 0 but it was
only 1 way.

Face it people should use Common Lisp for applacations.

> 'intermediate'. Certainly, if you don't know the answer, I consider that
> you "don't get it".
> For database people, I have boatloads of questions, more theoretical, as
> it is very easy to write bad sql. As in, why do you use stored procedures,
> why should you try to do things in sql vs stored programming language
> (set-a-time vs row-at-a-time), proper schema design (3bnf), indexes and
> how they operate, how optimizer operates and how to help it pick the right
> path, why are sql statements compiled on the backend and pitfalls (cache
> of the execution path), proper use of permissions on tables/stored
> procedures, etc.
> > Also someone's technical abilities have nothing to do with someone's
> > ability to search for jobs. Heck I have met great tech people that were
> > awfull at interviews.
> Absolutely. I used to suck at the management interviews (you know,
> answering questions "so, tell me about yourself" and "what are your
> greatest weaknesses"). But fortunately, those questions have 'right
> answers' and once you learn the right answer, you'll breeze through the
> management interview. ;)

Is the correct answer "I really hate answering these stupid questions?"?


> _______________________________________________
> % NYC*BUG talk mailing list
> http://lists.nycbug.org/mailman/listinfo/talk
> %Be sure to check out our Jobs and NYCBUG-announce lists
> %We meet the first Wednesday of the month

More information about the talk mailing list