🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2270

Re: Good C Interview questions?

#2270
From: David McReynolds
Date: Wed, 13 Mar 1996 12:40
34 lines
1922 bytes
Marc Espie (espie@clipper.ens.fr) wrote:
: In article <4hqebv$1k1@solutions.solon.com>,
: Chris Sonnack <cjsonnack@mmm.com> wrote:
: >My personal favorite:
: >
: >Given:
: >	char*  A = "hello" ;
: >	int    i =  3 ;
: >
: >It's obvious that:
: >
: >	A [i] == 'l'
: >
: >But what is:
: >
: >	i [A] == ???
: 
: >Any competent C programmer should know.
: 
: Any *competent* C programmer should know ??? Come on, have you *ever*
snip
: What is its incidence on reality, as defined by programs written to accomplish
: something and not to obfuscate ? Knowing the symetry of C arrays is fun,
: but there are loads and loads of more useful things that a C programmer

Nope, never seen it in practice.  But, I did have it drilled into my head
during my advanced C class.  The point is not that he knows something
obfuscated but, rather, he understands what the compiler is doing with
the given construct.  It really has more to do with the equivalency of
arrays and pointers than commutative properties.  If the interviewee can
answer the question then you know there is a good chance that he has
discussed things like a[i][j] == *( *( a + i ) + j ).  The fact that
the FAQ for this group has an entire chapter devoted to such a topic
simple underscores its relevance.
Technical Details
Message-ID: <4i6foq$p37@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4h2s1m$l8@solutions.solon.com> <4h75c1$4nh@solutions.solon.com> <4hqebv$1k1@solutions.solon.com> <4hv081$jdt@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: davidm@ssi.stratus.com (David McReynolds)
Newsgroups: comp.lang.c.moderated
Subject: Re: Good C Interview questions?
Date: 13 Mar 1996 06:40:58 -0600
Organization: Stratus Computer Inc, Marlboro MA
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4i6foq$p37@solutions.solon.com>
References: <4h2s1m$l8@solutions.solon.com> <4h75c1$4nh@solutions.solon.com> <4hqebv$1k1@solutions.solon.com> <4hv081$jdt@solutions.solon.com>
Reply-To: David_McReynolds@vos.stratus.com
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]