Article View: comp.lang.c.moderated
Article #2054Re: Good C Interview questions?
From: Network News
Date: Sat, 17 Feb 1996 18:05
Date: Sat, 17 Feb 1996 18:05
47 lines
2467 bytes
2467 bytes
Mike Rubenstein <miker3@ix.netcom.com> wrote:
>: Picture a table like the following:
>:
>: A B C D E F G ... Z
>: A A B C D E F G ... Z
>: B B C D E F G H ... A
>: C C D E F G H I ... B
>: : : : : : : : : ::: :
>: Z Z A B C D E F ... Y
...
>I wonder how many students could compute this table correctly. It's
>fairly difficult if one restricts oneself to standard C and makes no
>assumptions about the character set other than those demanded by the
>standard.
It's not *that* difficult:
char lookup(int x, int y)
{
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[ (x+y) % 26 ];
}
Or maybe it is: I think I've seen about two versions of the above
function on this thread so far, both wrong.
Returning to the matter of debuggers, I tend to agree, in broad terms,
with the assertion that programmers that have consistently used
debuggers tend to be worse programmers. I, personally, almost never
use symbolic debuggers (and I can't abide the GNU autoconf software
that puts -g in the default CFLAGS, and software developers that let it
get its own way on this issue). I know a number of good programmers
that are very attached to gdb, and are quite lost when they have to
debug something without it.
That said, debuggers are occasionally particularly useful in tracking
down certain types of bug. I sometimes use gdb to help track a pointer
that is getting trashed, and the like. And, of course, a core dump is
damn near useless without a debugger. (Not that I often use core dumps
-- I generally have them disabled.)
In summary, then, familiarity with a debugger is more likely an asset
than a weakness, at least from the point of view of an interview
question. It is *reliance upon* a debugger that is undesirable.
-zefram
--
Andrew Main <zefram@dcs.warwick.ac.uk>
Technical Details
Message-ID:
<4g55ch$auc@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4emaqj$3ng@solutions.solon.com> <4fjnch$oqq@solutions.solon.com> <4fp1ks$h6r@solutions.solon.com> <4fsv3k$2vv@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Network News <news@dcs.warwick.ac.uk> Newsgroups: comp.lang.c.moderated Subject: Re: Good C Interview questions? Date: 17 Feb 1996 12:05:05 -0600 Organization: Department of Computer Science, Warwick University, England Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4g55ch$auc@solutions.solon.com> References: <4emaqj$3ng@solutions.solon.com> <4fjnch$oqq@solutions.solon.com> <4fp1ks$h6r@solutions.solon.com> <4fsv3k$2vv@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Nntp-Posting-Host: stone X-Stardate: [-31]7066.38 X-Us-Congress: Moronic fuckers