🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Good C Interview questions?

#2167
From: Miguel Carrasquer Vidal
Date: Mon, 04 Mar 1996 04:15
28 lines
1223 bytes
a1s@ix.netcom.com (Andrew Snyder) wrote:

>Ari Lukumies <aril@cmt.lpr.mail.carel.fi> wrote:

>>Good C interview questions? Consider asking what this function does and why:

>>char	xxx(int n)
>>{
>>	return "0123456789ABCDEF"[n];
>>}


>consider n > 15

consider n < 0

Interview question: a) what does this function do and why?
b) rewrite the function to handle arbitrary input.

[The correct answer to b) is, of course, "what should I return for
 values out of range?" -mod]

==
Miguel Carrasquer Vidal                     ~ ~
Amsterdam                   _____________  ~ ~
mcv@pi.net                 |_____________|||

========================== Ce .sig n'est pas une .cig
Technical Details
Message-ID: <4hdqo5$8r6@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4h2s1m$l8@solutions.solon.com> <4h75c1$4nh@solutions.solon.com> <4h81fv$aou@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: mcv@pi.net (Miguel Carrasquer Vidal)
Newsgroups: comp.lang.c.moderated
Subject: Re: Good C Interview questions?
Date: 3 Mar 1996 22:15:01 -0600
Organization: Planet Internet
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4hdqo5$8r6@solutions.solon.com>
References: <4h2s1m$l8@solutions.solon.com> <4h75c1$4nh@solutions.solon.com> <4h81fv$aou@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: Forte Free Agent 1.0.82