After interviewing a lot of people I realized that some of them could hardly be
categorized as programmers. So my favourite questions :-
1. Write a function to calculate the factorial of a number. I explain to them
what a factorial is before they start.
2. Write the factorial function without using recursion.
Another favourite is (for C++)
Write some code that relies on a member function being virtual. That is, write
some code that illustrates how a virtual member function is different from a
non-virtual function.
And here's another one that is a favourite with a number of people.
1. Why are manholes and manhole covers round?
Martin
May 18th, 1998, 03:26 AM
I do a lot of database things, so I let people sketch a small db-design, e.g. a plan for our company's library, to be developed in just a week.
From their answers I see their knowledge, I've already got everything from a flatfile solution to a fully featured relational database - the flatfile guy has to learn a lot about databases, the other one about estimating realisation efforts :-)
Owen
June 9th, 1998, 12:08 PM
Unfortunately, the manhole question has been used so much that everyone knows what the answer is without having to figure it out.
Also, seems to me that anyone who calls him/herself a programmer should be ashamed if they don't know what a factorial is! I think that's the first program I ever wrote (in Pascal no less) to demonstrate how functions worked.
Howard Uman
June 10th, 1998, 02:07 PM
There's a room with 3 light bulbs and outside the room are three switches. You are only allowed to enter the room once. How do you find out which switch operates which bulb?
Jayashree
June 12th, 1998, 07:12 AM
should we have enter the room to find out which bulbs is associated with what switch. We can as well see the lights burning from outside.
Howard Uman
June 12th, 1998, 07:35 AM
No. The room has a door and all walls, ok? You can't see in it. You only are allowed to go in once. How do you figure out which button operations which switch?
It is possible to do this, btw.
Florence Gwite
June 18th, 1998, 05:03 PM
Answer: Turn Switch 1 on and keep it on for some time. Then just before entering the room, turn Switch 1 off and turn Switch 2 on. Switch 2 operates the bulb which is on, Switch 1 operates the bulb which is hot, and Switch 3 operates the bulb which is cold!
My favourite question was asked to me at my first interview. The panel of three asked me if I was the best of the lot (it was a campus interview)!! Unexpected question!! Threw me off for a just a bit, but then I said yes (ofcourse). I got the job.
Owen
June 22nd, 1998, 12:19 PM
The answer to what? The manhole cover.... Think about it a while. It's the one and only shape that has the necessary property (given that the actual hole in the ground is actually slightly smaller than the cover).
Ed Halley
June 22nd, 1998, 05:22 PM
Q:
Three switches outside a room, one lightbulb inside the room. You can't see the light from outside the room. You can only go into the room once. Determine which one of the three switches controls the lightbulb.
A:
Stay outside the room. Turn off all the lightswitches. Turn on one and only one lightswitch and leave it on for five minutes or more, to let the bulb get nice and hot if it is on, or nice and cool if it's off.
Turn off that lightswitch and turn on a different one.
*Then* you can enter the room to check out the bulb.
-> If the bulb is on, it was the second switch.
-> If the bulb is off, but warm, it was the first switch that you left on for a little while.
-> If the bulb is off, and cool, then it was not turned on recently, so it was the third switch.
Ed Halley
June 23rd, 1998, 05:10 AM
A manhole is a hole in a street or sidewalk that lets a person get under the street or sidewalk to fix pipes or other things. A manhole cover is a flat circular lid that keeps things from falling into a manhole when nobody's using the manhole. Manhole covers are usually made of very heavy metal so they won't rattle around or get stolen.
The question: why is a manhole cover round?
The reason: if it were any other shape (square, triangular, bean-shaped), it could accidentally be turned the wrong way and fall through the hole.
Why are we asking it here?
When interviewing a person for a thinking job, such as computer programming, you need to find out if the person can think. Asking questions that are related to their training will determine if the person can *remember* what they learned in school. Asking questions that are unrelated to their training will determine if the person can think about a problem and solve it. Unfortunately, this example has been used too often, and has appeared in puzzle books. Asking this particular question will usually determine if the person has read any puzzle books.
phil
June 26th, 1998, 04:46 PM
My favorite, and probably most asked, question is:
Do you have experience with MFC?
followed with the question:
Do you have experience with Visual C++?
followed with the question:
Do you have question:
Do you have experience with C++?
Phil
June 26th, 1998, 04:46 PM
My favorite, and probably most asked, question is:
Do you have experience with MFC?
followed with the question:
Do you have experience with Visual C++?
followed with the question:
Do you have question:
Do you have experience with C++?
Gary Grant
July 1st, 1998, 02:33 PM
My niece answered, "Because the manhole is round."
Ed Halley
July 2nd, 1998, 09:42 PM
Hire her. :)
Paul Todd
July 8th, 1998, 09:06 AM
My favourite is to ask the interviewee if they had to teach C++ to a class of x number of people with no object skills how would they structure a 5 day course and what would it cover.
Dan Rad.
July 8th, 1998, 10:25 AM
As an engineer, I think that the question is ridiculous.
Given some thought this question could be answered by any
high school geometry student.
It is simply intuitive geometry.
By the way, an equilateral triangle shaped manhole cover
would not fall in to the hole either.
Furthermore, round provides more space than triangular and
is much easier to install since you need not be concerned
with its orientation.
In addition, on a more technical and less sigificant note,
the round shape of the cover distributes forces more evenly
and is thus more resistant to lateral stress.
Also, the build up of dirt is mininized for the manhole
since their are no corners, etc...
Dan Rad.
Shawn
July 9th, 1998, 03:11 AM
Name 5 MFC classes?
Name 5 window messages?
Name 5 Notification messages?
I was asked these questions in a recent interview. I was kind of amazed at the joy the recruiter had when I spouted off 10 or 20 of each. He told me I was the first one to answer these question correctly, after he had interviewed 15 to 20 other applicants all with experience in MFC and Windows Programming. These questions were the first clue to being offered $10 an hour to take the job.
shawn
July 9th, 1998, 03:11 AM
Name 5 MFC classes?
Name 5 window messages?
Name 5 Notification messages?
I was asked these questions in a recent interview. I was kind of amazed at the joy the recruiter had when I spouted off 10 or 20 of each. He told me I was the first one to answer these question correctly, after he had interviewed 15 to 20 other applicants all with experience in MFC and Windows Programming. These questions were the first clue to being offered $10 an hour to take the job.
Karl Spaelti
July 9th, 1998, 10:11 AM
Fear for your job, Dan. Who says that the thing has to be held flat?
Or: Am I missing something ... and *I* have to fear for *my* job?
Karl
PS. Seems to me that this is one of these questions you may have heard of as a kid. If you did and you know the answer, it's easy. If - not knowing the answer - anybody has ever figured it out *in an interview*, I am impressed. By the way: How about the foreign language programmers who do not even know what a manhole is? (I am one of them; probably not one of the good ones but certainly one of the ones who did not know what a manhole is before I read this thread). I'd rather my coworkers know how to translate "inheritance" than "manhole".
Dan Rad.
July 9th, 1998, 01:40 PM
Karl,
Yes, I agree with you that foreign programmers are at a disadvantage
when asked the question due to the language barrier.
But, if the question is explained properly and in detail, I don't
think that it should make a big difference.
I never heard this question before reading it here either.
I was able to figure it out in about 2 minutes, but thats me.
Given time, any technically inclined person should be able
to figure it out.
Furthermore, I maintain that any REGULAR POLYGON with an odd
number of sides would not fall through the manhole.
A circle would go about half way in, an equ. triangle would
go about 99 percent and hang by the corners. As the number
of sides (ODD) increase, the shape becomes more like a circle
and would go in less in that proportion. Think about it.
And Yes, a question about "inheritance" is much more appropriate.
Dan
P.S. A Regular Polygon can be described as a symetrical
closed geometric shape with sides of equal length
and with equal angles.
Karl Spaelti
July 9th, 1998, 03:23 PM
Dear Dan.
It's amazing how much time one can spend over a manhole. And what tragic consequences it has. I did indeed lose my job because of your reply. Oh well, perhaps you will join me in my misery...
The reason is the following:
The 'heigth' (the distance from one vertex to the midpoint of the opposite edge) of the regular triangle is more than 10 per cent shorter than a side. Now (1) make sure the cover of the manhole is held such that one of its (equal length) sides is perpendicular to the sidewalk (we are talking manholes, aren't we?). When you lower the cover into the manhole, make sure that (2) the midpoint of the cover side which meets condition (1) and the opposite vertex at some point both touch one side of the manhole, thereby not giving up condition (1). It falls through nicely. And the the 5 per cent on each side allow for a thicker cover.
The conclusion? Who said you have to go through the middle? Either I still do not understand what a manhole is or your "proof" is not formulated clearly enough so that my limited capacity for logical/technical allows me to agree with you. (Am I not nice? I give you another chance to convince me!)
Regards. Karl
PS. Not only is my thinking limited. So is my writing. A pity ASCII does not allow for some reasonable drawing. Therefore: Try it, by cutting a regular triangle out of a piece of paper.
Dan
July 10th, 1998, 10:41 AM
Karl,
There is no tragedy here. This is just a forum.
Is it not wonderful how much spice can be added to
a topic as mundane as manholes.
I did not say the triangle could not fit through the hole.
I said that it would not fall through..
The key words are fall and would.
If you know manholes as I'm sure you do by now,
you know that they are very heavy and would be
extremely difficult to hold in the manner you describe.
A eq. triangle manhole would not fall through ,
it would only fit through that way on purpose.
A manhole cover slides in to place and would always
fall in corner first. As the number of sides increase,
this effect is less pronounced and is overridden by the
significance of the thickness of the lip that holds up the
cover.
What looks possible on paper is not alway practical
in the real world and it is possible to design a cover
that could not fall in, that is not round.
The question is ridiculous because it can be answered
in many ways by many people and reveals little about
the applicants ability to program well. If you are looking
for a specific answer, then the question must be asked
in a specific way. It is obvious the a circular cover could
fall through, not so obvious that the one I describe "would"
not. The fact that the circle could not fall through is an
advantage of that shape. Calling it the most important
advantage is certainly debatable.
I am now done discussing manholes.
Dan
John
July 11th, 1998, 01:11 PM
I was recently asked a good logical question to get feel on how I went about solving a problem. It didn't have any bearing on the interview and was, in fact, asked by one of the technical people I interviewed with.
Given 2 rectangles of arbitrary size and rotation and the fact that 1 had to fit within the other, draw 1 line that bisects both.
Think about it for a while. It took me about 7 - 10 minutes with 3 hints to get it...
john
July 11th, 1998, 01:11 PM
I was recently asked a good logical question to get feel on how I went about solving a problem. It didn't have any bearing on the interview and was, in fact, asked by one of the technical people I interviewed with.
Given 2 rectangles of arbitrary size and rotation and the fact that 1 had to fit within the other, draw 1 line that bisects both.
Think about it for a while. It took me about 7 - 10 minutes with 3 hints to get it...
Kyle Crane
July 12th, 1998, 04:24 AM
I would hazard to guess that any line drawn through a rectangle that includes its center point would have to bisect the rectangle therefore a line drawn through both centerpoints would also bisect both rectangles. I'm no geometry whiz but it looks like it works on paper anyway. Am I right?
Kyle
Kyle crane
July 12th, 1998, 04:24 AM
I would hazard to guess that any line drawn through a rectangle that includes its center point would have to bisect the rectangle therefore a line drawn through both centerpoints would also bisect both rectangles. I'm no geometry whiz but it looks like it works on paper anyway. Am I right?
Kyle
Humble Programmer
July 12th, 1998, 10:13 AM
One of my favorite interview questions for potential programmers is:
"What is the difference between GOOD code and BAD code?"
Most newbies will answer that "Good code works" and "Bad code doesn't", while more experienced programmers will launch into issues like readability, complexity, efficiency, and so on. It's almost like newbies don't realize that if the code doesn't work, then it's not "code" yet...it's still a work in progress.
Cheers!
Humble Programmer
,,,^..^,,,
Petar Konovski
July 13th, 1998, 06:50 PM
Favorite interview question:
A cat and a half eats away a mouse and a half for an hour and a half.
How much time is needed for two cats to eat away two mice?
Is there only one correct answer? Can you precise the question?
And also:
Is it possible a half of a cat to eat anything?
A,Davidson
July 13th, 1998, 06:57 PM
This seems **** easy!!! Did you word it correctly?
(put the small one in the center of the big one and draw a line through the middle)
John
July 14th, 1998, 11:12 AM
Ahh, but that's just a specific case. What if it's given to you? The general case has already been answered.
It only took me so long because I was never any good at geometry, and I was on my second interview of the day with a splitting headache talking to the 4th person on the list after already being there 4 hours! :)
john
July 14th, 1998, 11:12 AM
Ahh, but that's just a specific case. What if it's given to you? The general case has already been answered.
It only took me so long because I was never any good at geometry, and I was on my second interview of the day with a splitting headache talking to the 4th person on the list after already being there 4 hours! :)
John
July 14th, 1998, 11:14 AM
That's it!
john
July 14th, 1998, 11:14 AM
That's it!
John
July 14th, 1998, 11:17 AM
That's it! The idea is to answer the general case not any specific case. It gives the interviewer a glimpse inside your head. It lets 'em know if you're going to answer specific cases or generalize.
john
July 14th, 1998, 11:17 AM
That's it! The idea is to answer the general case not any specific case. It gives the interviewer a glimpse inside your head. It lets 'em know if you're going to answer specific cases or generalize.
Tony Hoyle
July 22nd, 1998, 02:56 PM
I've never been asked the manhole question.
Probably because its basic premise is wrong. Manholes are not always round. Quite a few of them here (in the UK) are rectangular.
Chuck Costarella
July 24th, 1998, 01:18 AM
Don't all these solutions assume that the wiring of all switches is according to some standard configuration? How do we know this?
Chuck Costarella
July 24th, 1998, 01:24 AM
I was asked at an interview in 1996 if I had "at least 5 years experience programming in Java?" I bit the side of my mouth and answered, "Almost, but not quite yet."
Simple Programmer
August 29th, 1998, 12:11 PM
Wrong. Manhole covers are round, because manholes are round.
Simple Programmer
August 29th, 1998, 12:14 PM
The first and the second questions do not neccessarily follow. Watcom has been a compiler that distributed MFC for some time now. Also with the advent of Win/U, you have been able to write MFC code for Unix platforms. I am told that this is a more efficient way of programming some of the Unix/Motif/X Windows interfaces, than accessing them directly.
phil
August 29th, 1998, 02:11 PM
Learn something every day!
Phil
August 29th, 1998, 02:11 PM
Learn something every day!
Peter Sjöström
September 25th, 1998, 09:04 AM
I am Swedish and 31 years old. I'm a Masters programmer, with some 20 years of programming experience. I speak English fluently as I've kept reading magazines of all kinds from UK and US for 20 years, watched television longer and been living with my Amercian girlfriend for 5 years.
I did not know what a manhole was.
Peter Sjöström
September 25th, 1998, 09:09 AM
Thing is there are always vandals (?) out there that will make life harder for us regular citizens. By making a round manhole it *cannot* go through, unless you destroy it first. Triangluar manholes can be made to fall through and will be made to fall through on late Saturday nights.
Just a man with life experience ignoring theory for a moment. (love the topic :-)
Dan Fish
October 6th, 1998, 06:53 AM
Seems to me that all these discussions about regular polygons, distribution of forces, the manhole cover falling through the hole, etc, etc... may have some merit of truth...
But I suspect the *real* reason manhole covers are round is much simpler...
Ever try to dig an 8-foot deep "odd-sided regular polygon" shaped hole?
I don't think John Deere has an auger that will do that :-)
Petar Konovski
October 11th, 1998, 05:02 AM
> Yes, if a cat and a half can eat a mouse, so can half a cat.
This is an acceptable approach - you think about the cats as a resource with
> Yes. If a cat and 1/2 can eat a mouse and 1/2 in an hour and 1/2, it stands to
> reason that 1 cat can eat a mouse in 1 hour.
Wrong! Try again!
Petar Konovski
October 13th, 1998, 03:33 AM
If a cat and 1/2 can eat a mouse and 1/2 in an hour and 1/2,
it stands to reason that 1 cat can eat a mouse in an hour and 1/2,
isn't it?.
Your approach (the linear one) is the most common, because
the problem is similar to those solved in the scool, and
there such an approach is the only one.
Your mistake is also the common one, because (maybe) of the
similar and easy to calculate numbers there. If there
were numbers insisting calculatons on paper, the solver
would stop for a minute and would find the right answer.
Apropos, over 50% of the interviewed people choose the
wrong answer.
It is honestly to give a chance to the solver to PRECISE
the problem. It is a cance for him to find more than one
approach, and to demonstrate non-traditional thinking.
femotee
October 15th, 1998, 12:33 AM
Two cats with eat two mice in an hour and a half.
If you take time as a basis
so in one and half hours, one/half cats eat one/half mice
then within that time
one cat would definetely eat one mouse
hence two cats would eat two mice within that same time
QED.
Annoyed
October 17th, 1998, 08:14 PM
Dan,
Ok, I think I've read enough of you flexing your "engineering biceps" with all this equalateral tetroloid schmolongus talk. We get the point, there are many other answers besides a circular shape, as well as more benefits that just the cover falling through the hole. POINT MADE. Thank you so much for this wonderful information. Now back to the original topic...
benf
October 20th, 1998, 03:56 AM
Hire a cs major to stand inside the room while you stand outside and try each switch. When he yells "its on" you've got the right switch.
Babar Ahsan
October 30th, 1998, 05:28 PM
I got first job is SQL SERVER using VB4, question are on entiy relationship, master detail form and different sort of queries.
Joshua Muskovitz
November 5th, 1998, 12:39 AM
I've always thought that inheritance was what would allow me to retire and live a life of leisure, rather than chase polymorphic pointers for a living, and constantly upgrading my **** compiler tools. :-)
Joshua Muskovitz
November 5th, 1998, 12:50 AM
1. If you could be any major household appliance, what color would you be?
2. Describe the coolest piece of code you've ever seen (written by anyone).
3. How important is coding quality to the success of a software company?
4. Name two professsional programming societies.
5. Who is Fred Brooks?
My answers:
1. Avacado green or Harvest gold. (You had to be in the US in the 1970's for this.) I like this question because it tests the malleability of the interviewee's psyche. Bonus Question: Why is this a valuable piece of information?
2. Swapping the values of two registers without using a third.
A <- A xor B
B <- A xor B
A <- A xor B
This blew my mind the first time I saw it. (Thank you, Dave Cook!)
3. This one separates the idealists from the jaded. I'll let you guess which one I am.
4. Do they know how to code, or are they software professionals?
5. If you haven't read "The Mythical Man-Month", go out and buy a copy today. The new edition just came out recently!
Joshua Muskovitz
November 5th, 1998, 01:00 AM
At my last job, we interviewed people and gave them what I considered to be insultingly stupid questions. What shocked me was that 90% of the applicants failed miserably.
1. Write a function in pseudocode that which takes a 32-bit unsigned integer, and returns the number of "1" bits in the value.
2. Given an array of 100 *sorted* random integers, write a function which determines if a given value is in the array. What are other solutions to this problem? What is the best one? (Trick question -- define best.)
3. We are organizing a tennis match, which is a single elimination style. (This means that once you lose once, you're out of the match.) There are 100 people to begin. 72 of the people are paired off and play 36 games, eliminating 36 people. The other 28 who did not play advance to the next round automatically (it's not fair, but so what.) This leaves 36 + 28 = 64 players for the second round, then 32 for the third round, etc. Question: How many games must be played to declare a winner? What if there were 200 people to begin? How many games must the winner play?
Only one person we found was able to answer all three, and he was thoroughly irritated that we were asking them. (I know I would have been.) We hired him, partly because he was irritated...
BJ
November 5th, 1998, 12:32 PM
Actually, you need go no farther than looking at the Canadian one dollar coin (aka the "loonie".) It is an 11-sided coin with slightly rounded edges, and has the property that it's diameter is constant (good for vending machines, etc.) So just use a great big loonie instead! Some might say plugging holes is the only use for a Canadian dollar these days.
In any event it is a rather silly question. Why not ask if the candidate has some formal training in *real* mathematics instead? This used to be a requirement for a degree in Computer Science (at least up here,) but, alas, seems to have gone in the same direction as the requirement for basic literacy (at least judging from some of the job candidates I have been seeing lately.)
B.J. (Bryce) Brogan
Calgary, Alberta, Canada
Scott
November 5th, 1998, 06:03 PM
Actually, it's a basic calculus problem: The reason that manhole covers are round is because a circle gives us the greatest area while using the least amount of material, ie: the cheapest way to cover a certain area is with a circle...
This is also why beer/soda cans are round - they use the least amount of aluminum.
Xiaolong Wu
November 11th, 1998, 08:17 PM
I failed most of the interviews I took. Many times I felt like a mouse being played by a cat.
As I see it, many interviewers just want to use some puzzle like questions to defeat the applicants. So they can feel proud of themselves. The company's true needs is at best the secondary consideration for them. They found rarely used functionalities in a language or math from some dark basement corner to defeat applicants and enjoyed that they found them. I could have found hundreds of such questions to defeat all the interviewers if we reversed positions. (by the way, I have a Ph.D. in math)
Worst of all, when a technical interviewer finds the applicant is stronger than him, he can always find a descent reason to reject the applicants, and the true reason is protecting his position.
So to all interviewers, please do not enjoy your favorate questions. Just ask what the company's job really needs. Give applicants a break.
Xiaolong Wu
Dan O'Connell
November 19th, 1998, 09:07 AM
When I interview someone and ask certain questions I rarely expect the interviewee to get the right answer the first time. If he/she does I think they must have heard the question before and I come up with another one. I am not looking for the right answer and I explain this as I ask. What I am looking for is the thought process. The amount of brain power this person brings to the table. I am also looking for signs of toughness and drive. I hate when people look a the whiteboard for a few seconds and then say "I don't know", they've lost the job right there and then.
What I want is someone who tries and with a little prodding eventually figures out the answer.
By the way, my favorite interview question(which I stole from an interview being conducted on myself)
Find the n'th from the end of a singly linked list?
Answer lower.....
You take two pointers and start one till it gets out n then you start the second pointer at the beginning and march the tow pointers till the first one get to the end, then the second one will point to the n'th from the end.
Viktor Martensson
November 19th, 1998, 05:57 PM
Hi!
Getting out of line here, but if they wanted to use as little aluminium as possible, the can would be spherical. ;)
Also, one should not underestimate the manufacturing costs savings achieved by beeing able to ignore the "horizontal direction" of the can itself.
Viktor 'Nothing to do' Martensson
ps. If my deficient english blurs the intent of this message ; Dont take it seriously ds.
phil
November 21st, 1998, 10:15 PM
i get it... windows 95... 9 million lines of work in progress... i think people have a knack for programming... the people that were tinkering around at 12 with programming get good...
phil :)
oh, and everyone knows 'good code' is the code "you "wrote... if anything bad happens it's because of that **** DLL that XYZ made.
Phil
November 21st, 1998, 10:15 PM
i get it... windows 95... 9 million lines of work in progress... i think people have a knack for programming... the people that were tinkering around at 12 with programming get good...
phil :)
oh, and everyone knows 'good code' is the code "you "wrote... if anything bad happens it's because of that **** DLL that XYZ made.
Steve
November 22nd, 1998, 12:47 AM
Only one? Out of how many?
Questions like that don't irritate me, they make me nervous because of how seemingly easy they are. They make me think there must be some sort of slick trick to solving the problem that I don't know of. Then I think they're not interested in my solution, they really want to know if I know of the slick trick!
I had a "take-home" programmer's test on which some of the problems were like #3. I solved them, but the entire time I was worried I wasn't doing them the way they wanted! Must have done it properly since they're flying me in for an interview.
BTW, I liked your previous post. Yes, that switching 2 registers only using 2 registers blew me away! Really clever! Immediately, I had to experiment and see if it really worked! Still don't get the significance of appliance colors. I was born in 74 so I think most appliances should be the color black because it looks sleek and new.
I also liked the tip on "what do you mean by best" in reguard to making a function. I'm used to putting run-time speed and minimal memory use automatically at the top without thinking. That definately isn't always the case.
Steve
November 22nd, 1998, 01:07 AM
This kind of technique can at least let you know what kind of environment you're applying at. If the interviewer seems like a backstabber, someone who would crush you in a second just to get a promotion, I wouldn't want to work there even if they hired me.
I knew someone who got hammered with all sorts of technical questions with a test. She was given this programming test, and the interviewers watched her take it. They commented to themselves on everything thing she did, if she skipped a question, they say something. She found it very annoying and nerve wracking! She said she did horrible on the test and that she hated the people, but a few days later they called and either asked her to come in again or gave her the job. I forget which.
I think some people do this intentionally to see how well the person holds up in a stressful situation. I think it's a bit rude, after all the whole interview process is stressful enough!
Whenever I have an interview, my philosophy is "have fun with it because there's always another company somewhere else" this helps keep the pressure down which in turn makes you perform better. You only know what you know. Getting nervous only keeps you from expressing what you know.
Joshua Muskovitz
November 22nd, 1998, 01:18 AM
One out of a half dozen or more. I was horrified at the crappiness of the candidates. It was quite an eye opener.
I like the appliance color question simply because I am a bit twisted, and I like to see how people handle it. If you think about it, the question is so absurd that there can't possibly be a correct answer. So I am simply looking to see if the candidate can hold their own in a conversation. After all, I'm not looking to hire someone who does what I tell them, I'm looking to hire someone who knows what to do without my telling them. As for avacado and gold, they were grotesquely popular colors back then. Eek.
So, did you figure out the trick to question #3? It took me a few minutes before I got it myself.
As for the register swapping, I had the same reaction when I first saw it. I had to immediately sit down and work it out on paper. What's even cooler is that it takes the same amount of time as using a third register!
If we had had a better applicant pool, I would have gotten into a discussion with them about the meaning of "best way" to do something. But alas, the simpler questions thinned the herd sufficiently.
What I don't understand about interviewing is this: There are so many jobs and so few qualified people, why would anyone be nervous about interviewing? Just be yourself. If being yourself turns them off, then you wouldn't want to work there anyway. It is much more likely that your relaxed state and thoughtful answers will impress them. It certainly won't make them like you less.
Of course, there are always interview oops that happen. When I was interviewing for my first job in the MIS department of a major bowling manufacturer, I jokingly said, "If I take this job, it doesn't mean I have to bowl, does it?" They replied, "Well, you don't have to join the company league, if that's what you mean." Oops. Thank you, I'll be slinking off now. Not surprisingly, they didn't offer me the job. Looking back, I'm grateful they didn't. I can't imagine how my career would have turned out if I had gone to work in their windowless linoleum floored cubicles. I probably would have beaten myself to death with a bowling pin.
Steve
November 23rd, 1998, 02:39 AM
I'm surprised at the lack of ability in answering the questions. I'd think it would be a lack of programming training from college, but in my case that was all they taught me. None of the classes dealt with any of the other topics many other computer people discuss: internet programming, hardware, MIME format, and unix. OK, they did give us a little unix experience but not much.
Looking at question 3, and playing around with the "what about 200" part, I figured out that all that was going on with the 72 was just making round 2 be a power of 2. From what I gather, any even total number of players you do this with requires (players - 1) games to find a winner. Is this right? I was looking for a "trick" and think that that is it.
You made me notice that I'm a bit of a hypocrite! I posted that questions like that make me nervous, but in a following post I mention how I go into interviews with a "whatever" type attitude so that I'm not nervous! I even gave the exact same reasons you posted for not caring if I don't fit in. Well, I go into them with that attitide, then stuff like that makes me nervous I suppose!
Joshua Muskovitz
November 23rd, 1998, 02:05 PM
It is easy to say "relax, stay cool" while at the same time being unable to follow your own advice. It took me ten years before I was able to give a calm interview, and I was still nervous on the inside. I think the thing which helped me the most was *recognizing* that I really do know what I claim to know, and that I really *can* do the job. Once you realize that, the interview becomes (a) explaining why that is true, and (b) deciding whether you actually *want* the job they are offering.
As for (a), it is fairly easy, once you believe it yourself. If you don't, then there is no way you are going to be relaxed.
As for (b), I found it very interesting to be able to shift an interview away from them grilling me to me grilling them. Of course I can do the job, now lets move on. Benefits? Job responsibilities? Who would I report to? Salary advancement? Vacation? Creative input into the project? Flextime? When is my first review?
As the applicant, my favorite question to ask a potential employer, BY FAR, is "Why would I want to come work for you?" This question makes it clear to them that you *know* that you know you are qualified, and that you are not just bargaining for your initial offer, but setting a tone for your entire career there.
Remember, it is just as important to plan for your career FUTURE as it is to negotiate your career now.
===
Now for the question 3 spoiler:
Yes, you must play n-1 games (regardless of the value of n), because in order to declare a winner, you must eliminate n-1 players (at a rate of one per game). Duh. The trick question is that the final winner must play in at least one game, in order to eliminate the one other remaining player. Beyond that the answer depends on how you structure the games.
===
As for being the interviewer, I'm much more concerned at how a potential employee thinks on their feet, since this is how work is actually done most of the time. How many projects have you worked on that weren't designed standing in front of a whiteboard? It is hugely important that people be able to work in that environment. Specific skills, knowledge of particular APIs, languages, and such can all be learned. In my mind the questions come down to:
1. Can you code? Do you know how to indent? Do you know how to comment your code?
2. Can you write clearly? Can you write a 2-5 page spec for some module you are designing? Can you communicate your design clearly?
3. Are you flexible? Can you accept the possibility that someone else might have an alternate or even better way of doing something? Are you able to objectively see flaws pointed out in your designs?
4. Can you listen? Are you able to hear someone out, let them get their point across, before you pounce on them for being wrong?
5. Can you speak? Can you stand up for what you believe in? If you really think that the design someone just presented sucks, will you say so?
I think that all of these are hugely important, but if I had to pick one as the most important, I think it would be #2. Good writing is probably the most difficult of these to learn. Most people spent a lot more time in school learning #1 than #2. And #3, 4, and 5 mostly require shifts in attitude, which can be learned on the job.
Lest anyone think that #2 isn't important, go scan the discussion board, and see how many of the questions posted are clearly written. Would you want that person working with you? Yikes.
Joshua Muskovitz
November 23rd, 1998, 02:17 PM
>> 1. a clear chainsaw (thow them a loop)
Good answer! Except that a chainsaw isn't a household appliance (small quibble), this is just what I'm looking for. Here is a golden opportunity to say whatever the hell you want... go for it!
>> 3. none, marketing is everything... promise them the moon and the stars and print a pretty box... then give them nothing (don't use microsoft as example unless intervew is for netscape or DOJ)
As long as you smile while saying it, this is an acceptable answer. It shows that you recognise that the goal of a software company is to make money, not software. Of course, you can expect at least 20 minutes of discussion about your true feelings, which could exclude you from the running if you aren't careful.
>> 5. Garth's dad ?
This one made me laugh. Good one. Seriously, though, I'm amazed at how many people have never heard of The Mythical Man-Month. I think that every company should hand out a copy to every new hire on their first day.
Steve
November 25th, 1998, 03:50 AM
>>As the applicant, my favorite question to ask a potential employer, BY FAR,
>>is "Why would I want to come work for you?" This question makes it clear to
>>them that you *know* that you know you are qualified, and that you are not
>>just bargaining for your initial offer, but setting a tone for your entire >>career there.
I completely agreed with what you posted before this, but this question seems to come dangerously close to seeming arrogant! I suppose if your attitude from the rest of the interview reflected an open, fair type personality this question would be OK, but it still seems a bit risky.
Have you ever tried that one? (I hope at the place you're working now!)
The idea of grilling the interviewer is great. I've heard this before. I liked many of the questions you posed. After all, most of the time when someone interviews another, that person really doesn't know what they're doing. They also don't want to be doing it! This can really make you look like a great catch!
>>I think that all of these are hugely important, but if I had to pick one as
>>the most important, I think it would be #2. Good writing is probably the most
>>difficult of these to learn.
It's not that schools don't spend enough time teaching good writing skills, they spend that time teaching useless writing skills.
Most English classes give out writing assignments, but they want you to write these verbose, bloated, purely academic papers few would ever read in real life! In reality, people don't read- They scan! Especially in business, people don't have time to read an essay! The best english class I ever had was one called "Technical Writing". It taught writing with the purpose of getting the message read by trimming down the size and making visually interesting documents. I had hated all English classes prior to this class. This one was actually interesting and all computer science majors should take such a class!
>> Lest anyone think that #2 isn't important, go scan the discussion board, and
>> see how many of the questions posted are clearly written. Would you want
>> that person working with you? Yikes.
I agree, but with technical type questions where I only see the text someone wrote, I generally cut them a break. Many of these people don't speak english so that really makes communication in english difficult. On a message board, you can't always tell who knows english and who doesn't! I know nationality doesn't justify not having good communication skills but I still tend cut people a break and try harder to understand their point.
BTW, my gut tells me that most of those posts on the message board are by people who speak english every day...
Joshua Muskovitz
November 29th, 1998, 04:25 PM
> Have you ever tried that one? (I hope at the place you're working now!)
Yes, actually. At the last three places. In each case it had the desired effect. But I only said it *after* I demonstrated substantial talent at the interview.
Usually it works because, as you noted, the interviewer often doesn't know what they are doing. So, after the first awkward pause, you simply take control of the situation by saying "let me show you some of my work" and then laying it out on the table. Lots of it if possible. Then, you proceed to tell them about each of the projects.
Hopefully, in the process you will have demonstrated that you have way more talent than they could ever hope to exhaust. At *that point* you sit back, relax, and then ask the question.
It is smug. And if you don't have the expreience to carry it off, then maybe you shouldn't try it. But if you do, it is a good way to cut through the crap and get to the end in the shortest time possible.
Mircho
December 1st, 1998, 05:32 AM
I wonder why there are such simple questions on interviews, whch seem to disturb most of the interviewed, (maybe those are hard for them).
It's strange that people without a knowledge on basic (BASIC :)) algorithms have the selfconfidence to go to interview and request a job that involves programming.
But you know when Microsoft issue the new tool that you do programming with just speaking to the computer, when that day comes I will establish a carpenter school and teach my own philosophy based on that when they cut the electricity off and all appliance is dead we - the carpenters will be the most wanted technical stuff on the Earth :)
And quicksort, and binary representations, and multiple inheritance - it all will be gone.
The triumph of wood!!!!
(so waiting for the puwer cut :) , but till then I'll do some programmig and learn the new type of wood :))))
Mircho
December 4th, 1998, 03:27 AM
or maybe it'll be
(Wood)Chop sim v1.0
Joshua Muskovitz
December 6th, 1998, 11:39 PM
Despite all of the glaring errors which I will list below as a spoiler (and hopefully catch them all :-), I wonder whether this code will run on a tolerant system. For example, would this give the proper result on a DOS box? In other words, would all of the stack overruns just happen to work out?
Now, for the list of bugs I can spot without attempting to compile it:
1. 256x256 blows out of a short, so the value will truncate to 0, this answers my first question. No, it will not print out the proper result (65536).
2. Passing a pointer to short to a function expecting a pointer to long. Hmm, this one is tougher. The short is declared in the stack frame for main. What will be the 16 bits which follow it? At the time of the call, it will probably be the input to the function, which is a memory address. The value of Num will most likely depend on whether the machine is big endian or little endian. This could be guessed if we know that the stack was initialized with some known value, but I don't think this is very likely.
3. ReturnString is not large enough to hold the resultant string, but it is declared on FormatNumber's stack frame, past the inputs. So it will not get overwritten by the return value, and will likely survive the call to FormatNumber.
4. That having been said, there are two parameters to the printf in main, and so I suspect that the first four bytes of ReturnString will get trashed. There are four bytes in front of it. Those were used to pass *Num in the previous call, and will contain the address of the formatting string. Interestingly, the next four bytes (starting at the address of ReturnString) will contain the address of ReturnString!
So, depending on whether there is a zero byte in the address of ReturnString which will prematurely terminate the string (and whether the machine is big- or little-endian), I would expect the output to be one of:
The answer is
The answer is ?
The answer is ??
The answer is ???
The answer is ????er=[some random value between 0 and 65535]
The answer is ????er=[65536*some random value between 0 and 65535]
(where ? is some possibly non-printing character).
I would guess that it would run in a single tasking process space without bombing. But that's just my guess. Anyone care to check?
Paul Doherty
December 21st, 1998, 08:42 AM
> So, your first product will be WoodPerfect 1.0? :)
Ouch.
PD
Gary Grant
December 29th, 1998, 12:56 PM
As an extension?
Your code has infinite loops.
My code has dynamic halts.
Gary Grant
December 29th, 1998, 01:13 PM
Wood for Window Sashes?
Mark L
December 30th, 1998, 01:26 AM
1. Why are manholes and manhole covers round?
ANSWER: They're not. They are triangular. (at least in Nashua, NH ) I'm not quite sure why the fad never caught on.
Ross Faneuf
January 13th, 1999, 06:44 PM
Manhole covers a round so they can't fall into the manhole. Note, though, that there ARE occasional elliptical and square covers none the less!
I rarely ask detailed coding questions during an interview, in part because I have a colleague who always does, and is good at it. I ask a series of questions about recent work, which vary depending on the response, in order to get a sense of how clearly the candidate grasps what they have created, why, and why they have decided to structure things as they have.
I ask a bunch of questions about peripheral and non-technical issues because I want to get a sense of how the person will fit into the team and the company. Having a personality and style which meshes productively with the folks already here is important, and for me an incompatible personality will disqualify a person quickly.
I always ask what a candidate's hobbies are, and it is perhaps the most important single question. I very much want to hear one of the following: I'm into strategy games; I perform or write music; I like to build things (particularly complex things); I do mathematical or logic puzzles. I DON'T want to hear they spend all their spare time programming. What I'm looking for is an indication that the candidate really is skilled at and interested in activities which require excellent abstracting, structural, and relationship skills. I once hired someone who had no programming experience at all but was a piano teacher; she proved to be a wonderful programmer. I hired another programmer who was also excellent, who built model airplanes - and chose planes to build by reading magazines, and building them in his head first just from the published plans (try it). So my answers above aren't the only acceptable ones - just the commonest.
My favorite question to ask prospective employers is 'why should I really, really want to work here?'
Joshua Muskovitz
January 29th, 1999, 01:01 PM
Ross,
You nailed it on the head.
-- josh
Dianna Dearborn
February 12th, 1999, 07:15 AM
Want a woman's point of view? I like a lot of what you had to say Joshua and would like to add my two cents worth to the thread.
I have been in the biz since 1963 and have been on both sides of the interview a few times. I've gotten every job that I really wanted except one and I was so depressed after my mother's death that even I wouldn't have hired myself.
In the begining, I took any job I could get. As I got more experience certain things about a job became more important to me than others. More than any other criteria, the degree of wanting to get up in the morning and get back to the job has proven to be the best measure. On an interview, I look for:
1) Will the job be interesting? To me, that usually means something new and challenging with a new skill to learn. No matter how well you get along with your manager or how good a company is to its employees, if your work is boring the job will become hell within a few months.
2) Can you find something you really like (or hate) about your manager - at least by the second interview? How about the rest of the team you meet? No matter how interesting your work is, if the boss or a co-worker is a certifiable jerk the job will become hell within a few months.
3) How good is the company to its employees? Look around on the tour: check the facilities, the equipment, the furniture and the tools - do they fit the context? Most importantly, check out the other people in their offices, cubicles, labs and open spaces... are they sweating bullets or do they look like zombies? No matter how interesting the job might be or how nice the boss is, if the place is depressing you will become depressed, too, within a few months. The exception is, if the rest of the team is enthused and energetic in contrast to the rest of the company, the boss knows how to insulate his crew from the BS and it may be a good job anyway.
Salary is negotiable and a reason to consider a company, but once you get used to the higher pay, it is not enough to keep you happy with a job.
Flex time, telecommuting and paid seminars and books are always important to me. But they vary in importance to the desire of doing the work.
Benifit packages are fixed, everyone gets the same and should only be considered if you have special requirements like maternity coverage for younger employees or pre-existing clauses if you or a familly memeber has a pre-existing health condition. No benifit makes one happy with a job.
Equity positions are usually fixed by the Board of Directors, but may be negotiable if you are senior enough or have special talents. Anyway, you usually don't find out what that will be until the offer letter because the manager can't influence that, especially in larger corporations. It helps if you were invited to interview rather than answering an ad. Always try to get a financial snapshot of the company before making any demands.
>Usually it works because, as you noted, the interviewer often doesn't know
>what they are doing.
You probably don't want to work for that guy (gal?).
>So, after the first awkward pause, you simply take control of the situation
>by saying "let me show you some of my work"
A few examples of your best work is enough. Always preen you code and make it pretty. And, if you didn't do it when you wrote it COMMENT IT BEFORE YOU SHOW IT. Tricky code might show how clever you are, but remember, the senior people usually write code and the more junior (less skilled) maintain it. Make it easy to understand and maintain. The best feedback I have ever gotten on my code is that it was a "pleasure to work on!"
>As the applicant, my favorite question to ask a potential employer,
>BY FAR, is "Why would I want to come work for you?"
Perhaps it's the female perspective but I soften this a bit. My first questions at this stage are, "What do you like most about working here?" followed by, "What is the least?" Asking another for their opinion is always flattering to them and you can often learn more about whether you want to work there or not from those two questions than three interviews of power game playing.
Then, rephrasing a bit, I ask, "Why do you think I should want this job?" First, it is less smug and confrontational. And, it puts the interviewer into the mode of trying to sell you on himself and on the job instead of defending himself and the job. He (or she) is now virtually asking you to take the job. Promises are hinted at and the possibility of you working for him is firmly in his mind.
If I want the job at the end of the interview, I say something like, "The job sound interesting and I will give it some earnest thought. Think about how well I would fill the position and, if you think you want me, let's set up a second interview." If you get the second interview, you usually get the job. The second interview is for meeting the bosses management and closing the deal.
My last job required 5 interviews because I met nearly everyone in the management team (a large corp.) including the V.P. The job I have now (a medium sized startup) I was hired on the spot without an interview and I sent my resume to personnel only because it was required. The CEO had seen my work and knew my reputation. Cool, huh?
Well, I guess I added a nickle's worth or more. It is just my opinion.
Tomaz Stih
February 13th, 1999, 07:28 AM
Hear, hear, Dianna. From my humble experience I only have to add this:
Check the company values in the work process for compatibility with yours.
I had experience with a consulting company. Everything was fine but there was this attitute towards software development as something technical and thus not complex... This would not be a problem if the projects were 85% analysis and design and 15% coding. But to write complex software by project plans made by someone with a personal instead of professional attitude...
Jerry
March 9th, 1999, 05:16 PM
ReturnString being a local variable is undefined on exit of FormatNumber, so
the return of FormatNumber will be stray pointer to
deallocated memory.
WRONG!!!
March 11th, 1999, 03:05 PM
>The reason: if it were any other shape (square, triangular, bean-shaped), it >could accidentally be turned the wrong way and fall through the hole.
A triangle can't fit through a smaller triangle, no matter how you turn it!!!
So a triangular manhole cover would be almost as effective as a round one, less the acute angles (not all that easy for a person to squeeze through).
Just my 2 cents.
Once and Future Consultant
March 11th, 1999, 03:46 PM
The height of an equilateral triangle is just less than .87 of the edge length of an
equilateral triangle. This means if the edge length were one meter, then the edge
length of the hole could be no more than about 87 cm. (About, because of the
thickness of the triangular cover.) Otherwise, the triangular cover could be made
to go down the hole by turning it up on edge, which is a normal way of opening
a manhole. You get a big prybar and reef it out fo there.
The circular shape actually has little to do with going down the hole. Drain covers
are square or rectangular.
The hole has to be large enough to accomodate service people going in, who are
usually donut eating men. The walls of the hole are expensive, so there is a reason
for the walls to be round to use minimum material per size of hole. Corners would
not add all that much to the usefullness of the hole in terms of getting large men down
it, but would add to the costs. Same for the flanged rim that the manhole cover
sits on. Covers are round because holes are round.
Also, manholes tend to be out in the middle of the street where heavy traffic goes
over them. They need to be strong, so they need to be thick. If they were square,
the corners would add to the weight but not much to the strength.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.