Subj : Re: Reverse words in a string (Another Interview question) To : comp.programming From : Randy Date : Thu Sep 29 2005 06:59 pm Scott Moore wrote: > Jaspreet wrote On 09/29/05 09:36,: .... > Two classic interview stories of mine: > > One was a company that gave me a simple C problem about what result would > be returned from a function. I replied that the program was not valid C. > It wasn't, the guy was relying in an uninitialized local variable, which > is a no-no in standard C. He was relying on his on particular implementation > of C. The interview went rapidly south as you might imagine. I won't lie > to get a job. Of course, you had more than two choices. If you had pointed out the semantic mistake, then immediately proceeded to say, "But on compilers that initialize such variables to zero, the result would be this...", you might have gotten the job. > > Second was an assembly language job where the guy asked me to describe > accessing a table in a small microprocessor's assembly language. I > wrote a solution on the board, and he smiled at me much as you would to > a small child, then proceed to tell me how with "advanced thinking" you > could locate the table on a page boundary so that the lower bits were > zero, and simplify the code by relying on the lower address bits being > zero. It's a common assembly language technique. > > I told him that I knew that quite well, but I don't program using such > dependent tricks. They usually aren't worth the headache of having to > always keep that table specially aligned, in trade for an instruction or > so saved. Pretty much all assembly is CPU and O/S specific. I don't think using a "trick" is an unreasonable thing to do, especially unless the boss indicated that code portability was important. And since a trick shows your familiarity with the subtleties of the ISA, it's probably to your advantage to be as clever as possible up front, and THEN say, "But if you wanted portability, I wouldn't do this, and here's why..." It's the same phenomenon that make buzzwords a handy thing to put on your resume, (especially now that most resumes are digital and searchable for buzzwords). > > By the time I left there, he was visibly angry. I didn't mind. I don't > want a boss like that in any case. If this is a representative sample, I suspect you've had a lot of unpleasant interviews. :-/ Most bosses were once technical, but have since chosen to do more managing and less programming. As such, it's hardly a surprise that your technical skills are more up-to-date, and probably more in depth. If you want a manager to hire you, you need to respond to their needs: in the interview, and later in the job. If you refuse to "play the game" in the interview, when everyone is on their best behavior, that's a really good sign that you'll turn out not to be a prima donna after you're hired, and not a team player, which is what all bosses want. IMHO, you need to keep your attitude to yourself during the interview (since you might be working with someone else in the company whom you like a lot more than this interviewer). Later, you can choose not to take their job offer. But if you give them attitude up front, the decision not to hire you has been made before you're even out the door. Randy .