Discussion on:

81
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
My favorite continues to be 'How would you make a binary tree persist?'. That is, suppose you had a binary tree with an integer at each node stored in a program. How would you store it in such a way that you could retrieve it the next time you ran your program.

Back in the day, this typically involved C and a flat file. Now, there are a lot more ways to do it. If I get the two-line Java answer, I'm quite happy, but then move to "ok, suppose you didn't have serialization..."

I've only had 2 out of about 50 nail it.
If these are the type of questions being asked to senior highly skilled technical resources... and they are answered quickly and to the point you desire. The candidate is just out of school and don't have a clue about the real world of programming.

The questions here are total BS.
Ask them about:
-- the largest program written and their role in the process.
-- the most difficult program written and why.
-- if they have ever mixed (integrated) programming languages to solve a particular problem and why.
-- what is the difference between a low level program like assembler compared to 3 and 4 level gl languages... why/how do languages such as 'C', .NET, Java and Perl (or whatever) make these definitions cloudy.

The purpose of an interview is to determine experience and analytical skills not if they understand terminology that they have not encountered for years. Avoid creating a communication gap during the interview. The purpose is to find the best programmer, not the best test taker.
0 Votes
+ -
I (partially) disagree. The key purpose of an interview is to determine if the candidate lied on their resume. I won't waste my time interviewing someone that I don't think can do the job (based on their resume). I just need to know if I've been misled.

I do agree though that terminology isn't a focus as any team tends to develop its own "shortcut language" over time.

I tend to ask about
- the system (that they've worked on) that they are most proud of and why, and then drill down into their role and involvement in that.
- a recent complex problem and how they solved it

My $0.02 worth
... or the candidate has no formal Computer Science background, maybe they're not analytical and possibly they hack at stuff 'til it works.

Despite only 2 people nailing my favorite question, I've hired over 30. (gee, I guess I've asked it more than 50 times) A perfectly acceptable response is "I don't know" (that's better than faking it!). That response leads to some explanation which then leads to seeing how quickly they can think analytically on their feet.

Nothing wrong with your questions. Interviewing is a very dynamic and mostly subjective process. Do what works for you.
0 Votes
+ -
20 years ago when I started off, it was ?what do you know?. Now it is a case of where do I find the answer? That?s where the web comes in. I've already checked on the supposed Google interview questions, and if anybody asks me in an interview, I'll be able to answer them. Does that make me a good programmer, No does not, but it does make me a good problem solver, Yes. That?s what programming is all about. Find the problem and solve via (insert your own programming language here), T-SQL, VB.Net, VBA and 2 of my favourite pieces of software, Textpad and Excel.
I've been a developer since the days of punched cards but now I spend most of my time on the data side of the house. I'm okay with the initial set of questions, particularly the polymorphism question as that is a critical feature of OOP. However, as a data guy I rarely see even senior developers take any interest in addressing locking issues. It's a significant reason why I have a database performance consulting career. I might ask that question of a potential database developer or dba. It's rare but refreshing to find developers who consider performance issues on another tier but I wouldn't be the least bit surprised to find developers who don't even know what locking is. That's more of an architectural issue anyway. As the data guy on a project, I wouldn't want developers making the call, on their own, as to whether pessimistic or optimistic locking is appropriate for a given use case.

As for the white boarding examples, in 30 years I've never needed to code a fibonacci sequence or determine whether a number is prime. (I had to Google fibonacci to refresh my memory.) I'd much rather see a simple business use case.

I did like the section on drilling down into the specifics of the resume. Exaggerating one's importance on a resume is pretty common.
0 Votes
+ -
Keep it basic
Englebert 18th Feb 2010
Keep the questions as basic and general as possible.

Remember, the applicant is nervous and may not be able to think fast on his feet.

Take those same questions and use it on your existing developers in a different setting with a different interviewer and see how well they do.
0 Votes
+ -
forget it now!
viweed@... 18th Feb 2010
Once this list of questions is read by an offshore resource (shall we say politely) it's all over.... all over the net. So in a month every programmer in India will be able to answer those questions. Frankly, I have one key question I ask when the programmer shows up on 'day one'. If they cannot answer that question, good-bye. AND I change the question every time I hire someone, that I have not interviewed 'in person' but over the phone. Distrusting? You betcha! particularly with people who are NOT American and thus do not have our basic ethics and integrity. Think I'm wrong? Yeah, NOT.
I have (among other things) provided support to a group of 'coders' from a large company located in India - whose name could be described as a British farewell, for now) - and I was continually amazed at how little they actually knew.

If I ever get into management, I will never hire these people, no matter how cheap they may be.
0 Votes
+ -
My son did a job for a big company in America he solved thier problem, did another job and thy flew him to America he has been there now for two years he said that the programers there were 2 years behind him, now he is vertually running the show and telling them what to do, it does not prove that a person from another country cant do the job he was offers $100000 a year by the police department to work on the gold sector
He can get into any computer system that he wants to, but he wanted to work in America and show that people from other countrys are just as good if not better.
0 Votes
+ -
I was referring to a specific country and company.

I would consider it a great compliment to be able to move to Australia and work there.
0 Votes
+ -
no prob
harryolden@... 22nd Feb 2010
You are not the onlyone heaps pay 10 thousand and arrive by boat via indonesia
as reffugees and thy get help from the goverment so you are most welcom to come to Australia
Cheers
0 Votes
+ -
I agree
onner 23rd Feb 2010
I do not trust Americans!!
It is good to have a some impromptu questions. I agree. But...

You are making a strong statement saying everyone else except American do no have ethics and integrity. Now that shows your complete ignorance. This is a technical forum not a place for your Racist comments.
This quote says it all: "few managers and companies have the time to spend a full day interviewing job candidates" They need to MAKE the time. Think of how long you have to live with a 'bad' hire and how hard it is to get rid of a bad hire. It is well worth the entire team's day, let alone a manger or company.

I once heard that Microsoft knows they weed out good people, but that are trying to assure themselves that they don't hire and bad ones.
0 Votes
+ -
Contributr
I agree that most companies don't spend enough time doing interviewing. I have SOME insight into that... when I was heavily involved in hiring, we were ramping up the department so we needed to hire more than one person. We wouldn't get much filtering from the recruiters, and we had cast our net pretty widely due to lack of the right people locally. I was spending an hour a day reading resumes, many days I would spend an hour or two (or more) doing phone interviews, plus there would be a number of face-to-face interviews throughout the week. All said and done, the basic hiring process (before you even found someone you wanted for a second interview!) was consuming a huge portion of my week (as well as the other managers involved) with no compensating reduction in the rest of the workload, which was already a 50 hour/week job!

Under those circumstances, you can imagine that doing the Microsoft or Google day-long battery of interviews, tests, etc. just isn't possible. Maybe for companies hiring for just one position that is possible, or who do so much hiring that they have a massive staff of recruiters who have a locked down process to spare managers from the bulk of the work, but for you typical manager in a typical company... the time just isn't there, regardless of how important it is!

J.Ja
0 Votes
+ -
Yes this is for real. When you hear about the tests and all they do in the hireing process at some companies this is done by HR people and not by the actual person who is going to be the manager of this person(s).
I had to send people to lunch or to tell them to come back the next day for an interview with me after being so tired and unfocused that it was not possible to talk to the person.
Anyway when you start the process with hiring new staff, just rest assure it will take you a lot of your time, "an hour a day" be realistic!
0 Votes
+ -
I agree totally
gechurch 18th Feb 2010
I was going to make the same comment. I think hiring is the most important thing a company can do. I've worked for companies where they do pretty much everything else wrong, but they were succesful because they had good people who made things work. I've seen the total opposite also.

This is particularly so with programmers. A fantastic cleaner might be twice as fast as a pretty average one. But a great programmer can be tens of times faster than an average one, and will write more reliable and scalable code to boot. You are talking about hiring someone for years. If you can't justify spending the best part of a day with a handful of candidates then you are doing your company justice. If you get that great hire they will more than have repaid the time you invested within weeks. Then as they get more experience in your job they will become more and more efficient. For 40-50 hours a week. It doesn't take long for your initial investment in time to pay for itself.

People seem to have this attitude that you read resumes, maybe have a phone interview and then spend 45 minutes in an interview. That's how it's always been done, so it must be right. And only Google and Microsoft are big enough to warrant full day interviews. Because they have teams of people.

That's crap. They spend the time because they know it's vital to their business. And that's no different if your a 3-man company.

Now, the time has to come from somewhere, and other tasks don't stop existing just because you're interviewing. I agree this is a problem, but it is a separate issue from "should we spend a full day interviewing?".
0 Votes
+ -
Have candidates write code during the interview.

http://www.joelonsoftware.com/articles/fog0000000043.html

I used to do it when I was in management. It was part of a written test I gave all applicants. I even had one applicant get irate with me, "I had to take a test on my first interview 10 years ago, and I haven't had to take one since then. If you want to talk about programming that's one thing, but I will not take your test."

This person did not get hired...
0 Votes
+ -
Contributr
Joel's article is good. Sadly, few folks are able to replicate the environment at Fog Creek, and few of us have his candidate pool, either. He flys people to NYC and has them picked up in a limo at the airport for their interviews... for INTERNSHIPS. His interns get paid more than many full time developers. He has a network of the best CS professors all over the country and they funnel their best students to him.

The rest of us have to make do with what is found on Monster and CareerBuilder, and the hiring realities are sadly not the same. Joel's advice, while awesome if you have the candidate pool, would leave most companies completely understaffed because Joel's test would weed out 90% of applicants. sad

J.Ja
0 Votes
+ -
Quality people are easy to find, but a quality company is not.
0 Votes
+ -
S******...

Sod polymorphism, too many people know the answer without knowing what it means.

Let's get right down to the nitty gritty of commercial software devlopment.

How do you address code rot with no resources....

You have got to be f'ing kidding me.

The first word of the post is.

S ni gg er
Here's another (not many people get it right). Given 2 variables X and Y, swap their values without using a third (or temporary) variable. The answer is Y = X XOR Y, X = Y XOR X, Y = X XOR Y)
0 Votes
+ -
What is the point of asking how to do something that requires a little used trick? You will probably get someone who is intrigued with tricks.

What happens when another developer is debugging or modifying code that is full of tricks? You'll have a maintenance nightmare.

Once in a long while you will find a place where such tricks are appropriate. Hopefully, the trick will be explained in comments.

If your goal is to find a decent programmer stick to mainstream concepts.
0 Votes
+ -
Yes......
ejrg 18th Feb 2010
He think he is trying to be too smart for his own good. I believe Google has a ranking system for new hires - guess what those that are ranked highest generally aren't as good as those ranked lower - the rankings aren't an indicator of performance (this story maybe an Internet myth - I don't know). A persons attitude I think is more important than their skill set - skills can be learnt, it's much more difficult to change attitudes.
0 Votes
+ -
I had a professor once who gave quizzes from trick books. Unfortunately, it was a night class and most of the students were working developers.

We all agreed his ideas were cute but garbage. In the real world, you don't develop programs that cannot be easily modified or understood later. You don't use 5 dimensional arrays of triply-dereferenced pointers.

I ask questions about how the appplicant thinks of the end program. What modifications do you think the user will suddenly discover is absolutely necessary the first week it is used? Real life questions which have very little to do with programming but affect how you approach programming a real life solution for someone.
0 Votes
+ -
Really ?
Tony Hopkinson 18th Feb 2010
Fred XOR Wilma...

Hmmm I'm seeing a difficulty here....

That's not counting the fact that all you've done is express the problem without using at least one extra store.
Given implementing the operation would reguire at least one temporary variable, why would you bother not expressing it in it's simplest form
t = y
y = x
x = t

If anyone gave me that as solution to swapping two variables they'd fail big style in my book.

You'll be doing recursion where iteration would do the job, next.

Programming is a practical real world exrcise, not some quasi-intellectual game.
0 Votes
+ -
I'd give an interviewee a problem (domain) and ask them what questions they would ask the subject matter expert in regard to how the problem needs to be solved.

In other words, I'd be more interested in the interviewee's ability to analyze a problem and ask the correct questions to begin solving the problem.

There is a reason an unreasonably high percentage of software projects fail to meet expectations and get scrapped.

Clue: it isn't because developers can't solve questions like the ones posed by the OP.

If you have a room full of "genius" developers who don't understand the problem they are trying to solve, they will fail. Guaranteed.
fairly useful thing, but I put most failures down to

Denying things will change.

If you understood things will change, you wouldn't write incomprehensible code for instance.

To be quite honest the key thing I look for in a programmer, is a desire to program.

The key thing I look for in a developer, is that they know Change is a given, and that they understand this means the things most likely to change should be implemented in a way that they can be as easily as is practical.

Then when you find out the requirement has been misunderstood, squaring it up shouldn't impact the project too much.

It's assumptions that kill projects.
0 Votes
+ -
Clean Code
noogrub@... 25th Feb 2010
If you haven't yet, may I recommend reading "Clean Code" by Robert Martin? It's published by Prentice-Hall.
0 Votes
+ -
Most of my opinions on comprehensible code were formed at 2 in the morning, with lots of people shouting at me to hurry up.

I've read one or two books that hinted that clever dick code wasn't the best idea ever.

The clssic The Pragamtic Programmer is always a good one.

Danny Thorpe does some good stuff on component design as well.

Comprehensible code is foundation of successful implementation.
Bugs don't appear spontaneously, they proliferate in suitable environments.

Like head lice, the cleaner your hair the more likely they are to be spotted and eradicated.
0 Votes
+ -
This is just bad...
Slayer_ Updated - 19th Feb 2010
* Explain the difference between ?equality? and ?equivalence? (credits to TechRepublic member Tony Patton for this question).
Too ambiguous of a question. Especially on a language, do they mean how 1 "1". Because in VBA 1 = "1" but 1 cdbl("1").
Where as, & and + are equivalent operators with strings, but not with numbers. At what level are you asking this question?



* What is the difference between ?pass by value? and ?pass by reference?? How are these ideas different in object oriented systems and procedural systems?
It does not matter of its OO or procedural. Pass by reference means your passing a memory reference, pass by value means your passing a copy of the memory.

* Describe ?polymorphism.?
See Inheritance, also See over bloated code.
* Compare and contrast ?pessimistic locking? and ?optimistic locking.?
To a data base, or to a flat file, or to a network?


# Calculate the Fibonacci value for a number X
Whats a fibonacci?

# Determine whether or not a given number X is prime
Is it divisible by 2, 3, 5, 7 (i think those are the numbers...)

# Reverse an array without using a loop
Is this even possible?



-Edit
Looked up what a fibonacci was. Sounds useless unless your doing video game engine programming.
If you find yourself disliking many of these questions, or not knowing what the answers are, you are probably the sort of candidate they are trying to weed out.

I like the first question. Anyone with a reasonable grasp on two or three languages will know exactly what it is asking - it's not ambiguous (equality means they are pointing to the same object, equivalence means they are two different objects that happen to have the same value). This question does its purpose perfectly.

Fibonacci is the classic example used for teaching recursion. I think any formally trained programmer will know fibonacci. If not it can easily be explained to the candidate, so the question can still be used.

You will have noticed with all the proposed questions here, they are designed to:
- Quickly weed out people who have poor skills
- Find out how the candidate thinks through programming problems

You can look at any of the questions individually and say they don't tell you much - you could be a great programmer and not know the answer. But as a set they give you a good idea of the candidate. It's impossible for someone to not know most of the answers and be a good programmer.
0 Votes
+ -
Hmmmmm.....
ejrg 18th Feb 2010
"It's impossible for someone to not know most of the answers and be a good programmer"

Rather a bold statement isn't it, can you back this up with any evidence. Anyone can ask a question in their field of expertise, and I suspect like much of the rest of the computer industry, even programming as sub fields of expertise. If I asked a question about assembler would you be able to answer it?? (Please note I'm not a programmer, someone once tried to teach me Pascal, I fell asleep after reading one page of the text book).

I think it is well known that the better programmers have Aspergers syndrome. Something about structure and repetition - it suits the way they think.
Again, definitely not true. How do you describe a good programmer? To me a good programmer is someone who gets their work done quickly, efficiently and with as little bugs as possible.

I know how to read and write binary files in VBA/VB6, my co-worker doesn't even know that is possible. Does that make him a not a "good programmer". He produces the same work as me, very good quality and fairly timely.

I am sure if he ever had a task that required binary files, he would either ask me how to do it, or look it up.
0 Votes
+ -
Still sounds useless
Slayer_ Updated - 18th Feb 2010
Its not about what a programmer knows, its what they can learn. None of these questions address that.

Equality and equivalence, if the question mentioned "memory" anywhere in the question, I would know what it was asking. But it did not. Also, its fairly useless knowledge as it mostly goes hand in hand with by reference and by value. If a programmer understands THAT difference, they are set.


"Fibonacci is the classic example used for teaching recursion. I think any formally trained programmer will know fibonacci. If not it can easily be explained to the candidate, so the question can still be used."
I took applied math in high school, this was never covered. I took a 2 year C/AP course for college, this again, was never covered. Most math problems were not covered aside from basic business math. Fibonacci is not business math, from a brief Wikipedia read, it looks to be geometry, which is often used in 3D programing. Such as video games. There are specific colleges and schools for teaching gaming programming. Game engine programmers need to know geometry and physics VERY well. I program for an insurance company, I need to know basic addition, subtraction, percents. Basically grade 5 math.
If an interviewer said do you know Fibonacci to me, I'd say, No, but I like pizza, cause it's a stupid question.

Actually, for my interview, I showed several mini programs I made at home, showed examples of my coding style and documentation, and told my interviewer my basic steps to solving problems.

Once hired, the fella I shared an office with showed me around. My boss actually taught me how to use Crystal in their unique way (not with database connections like they teach in school).


I just don't see the point in these questions. You want to see how they answer? What if they answer "I don't know, let's Google it"?
I agree with your first sentence. I consider what a person is able to learn is far more important than what they know now. Given a choice between someone who has the skills needed now but doesn't seem devoted to continual learning, and someone who knows programming in general fairly well and spends a lot of spare time programming for fun, I would always hire the latter. They will learn the skills the first candidate has and keep on learning.

But there has to be a sound knowledge of programming principles. The group of questions this article proposes will test that, and in a language-agnostic way. That's why I don't consider my earlier statement bold at all.

Any low-level, specific question can be googled easily. What can't be googled is the higher level stuff. Google won't teach you to think about how to arrange your program so that it scales well, and is hardware-independent, and uses the most appropriate data structure, or the best way to provide locking of data to ensure your program works with multiple CPUs without unnecessary slow-downs. Google is great for specifics, but it won't teach you how to think like a programmer.

The other problem with google is a lot of the time you don't know that what you are doing is a sub-optimal or even bad way of doing things. It's a case of 'you don't know what you don't know'. If you're getting a compiler error because you are calling a function with the wrong types, it is obvious there is a mistake and you know to look it up. If you are doing something that is poor practice like incorrect use of globals, or not locking access to shared data you won't know that you are doing something wrong and therefore won't know to look it up (if you knew you were doing it wrong, you wouldn't have done it that way in the first place).

The only way to address the higher-level issues like this is to read about programming concepts. If you're formally taught that's great - you are less likely to have gaps in your knowledge. But if not you can still get the knowledge by reading great books and blogs.

By the way, my point about fibonacci is not that the math is important. Quite the opposite - it is a good choice because it is a simple sequence. If a candidate hasn't come across it, the interviewer can explain it and the question can still be used (I said this last time).
Never use that when there's another option.

It looks good on paper, try to debug it and you disappear up your own arse in three calls.

If want to test for recursion, problem should include a tree or some such.
I searched on google, I see no such generic language possibility.

The question in the blog didn't specify what language, so I am assuming it must be possible in every language.

Frankly reversing with a loop is challenging unless you cheat and make a second array.
One way is by using integers to keep track of where you are in the array and using goto to jump around.

In assembler you would use branches but that's beyond a VBr.
I would say a loop would be a better choice then.
0 Votes
+ -
what is a loop
mr_bandit 19th Feb 2010
If you are using a goto, you are creating a loop. Doesn't matter if you are using assembler or a high-level language.
Loops in a HLL get translated to gotos (branches) in assembler.

I don't think the recursive code fragment would work. However, the general concept would, but I didn't think of using recursion, and I have been in the biz for 35 years.

The questions are not very useful for the embedded field.
0 Votes
+ -
Contributr
Recursion
Justin James 19th Feb 2010
Recursion is the answer here:

function reverse(input: array returns: array) {
if input.length = 1 then
return input
else
return reverse(input[1 - (input.length - 1)] + input[0]
end function

Is recursion a "real world use case"? Only in a few specialized fields. But it shows problem solving capabilities while thinking in the realm of code. And for the record, I took 2 semesters of CS in college, and a few years of "programming" in high school. I am hardly "formally" or "classically" trained in CS, so it's not like this is a personal bias coming out...

J.Ja
It looks like your just swaping the first and last entries in the array. But the question was how do you reverse an array.

Also, what is "reverse" function, where does this function exist? What does it do?
0 Votes
+ -
Reverse
gechurch 19th Feb 2010
A reverse function takes the first element of a list (eg. array) and swaps it with the last, then takes the second element and swaps it with the second last etc. Once done, iterating through the list from the end to the start will give you the same order as going from the start to the end of the original list.

The previous commenter used recursion. The giveaway is that there is a call to the function from within the function itself. So it starts the function, gets part way through and then calls itself again with different paramaters, then gets partway through and calls itself again and so on. It does this until it gets to some stop condition, then the function returns to the previous call, which completes and returns to the previous call etc until the whole thing unravels again. That is why it isn't just swapping the fisrt and last - it keeps on gettingg called for every element.
0 Votes
+ -
Sounds dangerous, what if its a 10 million element array?
0 Votes
+ -
Stack size can become a problem with recursion. I'm not sure at what point it kicks in, but you're right - 10 million is a lot of calls to keep track of.
the function reverse should take array as a parameter(as you defined) but in recursively called function the parameter is value not array of value.
return reverse(input[1-(input.length-1)]+input[0])
---reverse(input[1-some int value]+int[0])

sorry if i'm wrong.
I would use recursion to reverse values in an array using a higher level language.

As a different approach.
I would use the stack in assembly language.
0 Votes
+ -
Too basic
Jerriais 18th Feb 2010
I admit, I have to think about Fibonacci in recursive terms: the obvious is the ! operator, If x = 1 THEN 1 ELSE x*(x-1) FI; that I can't for the life of me and a bottle of Merlot name at 3am.

I find it significant that somebody can count 9 among prime numbers as separate from divisibility by 3 but it hardly matters. Most of these questions today relate to engineering and hardware design. 'Programming' consists of knowing how to mate visual control routines and little else. How they are implemented in bottom level logic matters no more than the electronic theory underlying semi-conductors.

It's like asking a bus driver how to repair a blown gasket, no longer relevant and why I lost interestr in programming.

Reverse an array without a loop? In APL that would be an operator and Algol-68 an assignment and let the interpreter/compiler sort it out - that's what it's there for. I admit that if you don't know how many cells you are dealing with or can't treat an array as a single entity (which most modern languages like C will not - in fact C won't even handle arrays at the level Fortran 2 would in 1957) it is difficult to imagine without a loop.

Equality and equivalence have more than one meaning and asking for clarification should show awareness of that. Equivalence could mean identity of computer address or of binary value, so 16r30, 10r48, 8r60 and 2r110000 are all equivalent.

Then again, if x and y are both references (C pointers) and both assigned to z then x and y are equivalent and if 'zilch' and 'zero' are defined as synonyms for 0 (INT zilch = 0; INT zero = 0; or I think in C #define zilch = 0; #define zero = 0;) or INT nix := 0; REF INT zilch = nix, zero = nix; (No idea in C or if it is even possible in overblown assembler!) then zilch and zero are equivalents both containing (pointing to) nix.
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.