Article View: comp.lang.c.moderated
Article #2546Re: Good C Interview questions?
From: karree46
Date: Mon, 08 Apr 1996 16:11
Date: Mon, 08 Apr 1996 16:11
46 lines
2310 bytes
2310 bytes
In article <4jv7ri$dam@solutions.solon.com>, mholcomb@BIX.com says... >Ed.L.Karrels@zippo.com (actually karree46@sol.acs.uwosh.edu) wrote: > >I've read a lot of posts in this thread about what _would_ be good > >interview questions. Well, I have a few that _were_ asked of me when > >I had a telephone interview with SGI a few weeks ago. > > >What type of position was this interview for????? Entry, Middle Senior??? Entry. Summer internship. Found out on 3-31 that I did get the job :-) >Bill Wendling wrote: > >} Why isn't the size 2*sizeof(int)+2*sizeof(char)? > > > >Byte alignment? > > > >} How could you decrease the size of the structure without removing > >} any members? > > > >Rearrange the elements. > > >Aren't these questions platform dependent? Yes, but if you don't know any platforms you're not worth as much. As I think I mentioned in the original post, my first answer was "implementation specific". He told me to pick an implementation and answer the question for that. Other people have complained that the xor trick with linked lists is not technically legal. Sure, I know that. But that doesn't change the fact that knowing this trick earned me good points in the interview, since that was exactly what he was looking for. Apparently, my interviewer uses a GNU library that uses this trick and he considers this somewhat standard. Also, the job is to program for a particular architecture, and knowing the capabilities of the architecture is always a plus. In a different job, when I was writing code that _did_ get ported to all those different architectures with different pointer representations and 64-bit longs, I followed this newsgroup and the ANSI C standard closely, and made sure to write only code with well-defined results. Ed -- Ed L. Karrels karree46@sol.acs.uwosh.edu http://www.uwosh.edu/students/karree46
Technical Details
Message-ID:
<4kbdqs$ecl@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4jmcn5$lq6@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: karree46@sol.acs.uwosh.edu Newsgroups: comp.lang.c.moderated Subject: Re: Good C Interview questions? Date: 8 Apr 1996 11:11:08 -0500 Organization: Zippo Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4kbdqs$ecl@solutions.solon.com> References: <4jmcn5$lq6@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com