Re: Reverse words in a string (Another Interview question)



Roger Willcocks wrote:
> "Jaspreet" <jsingh.oberoi@xxxxxxxxx> wrote in message
....
>
> As an interviewer, I'd hope the first response was 'how do you define a
> word?'. Then 'do you want the whitespace folded?'. Then 'do you just want to
> just output the words, or will you want to process them further?'

Better yet, why not say: "Assuming a word to be 4 bytes, and assuming
the whitespace to be folded thusly, here's what I'd do..."

That way you don't obstruct the process; the interviewer gets his/her
answer quickly, gracefully, and without the possibility of your
embarrassing him/her or appearing hostile; and you make sure to
emphasize your deep understanding of the design trade offs.

Smart bosses like to hire people who know more then they do, since
thorny technical problems have to be solved by *someone* on their team.
But nobody likes to look foolish, or suspect that the interviewee might
be on a power trip, especially this early in the relationship.

Randy
.