views:

1704

answers:

17

Different companies use different technical questions to try and figure out who the good programmers are.

What is the hardest technical question or problem you have ever had to solve in an interview?

A: 

I dislike any questions that involve writing code on the fly. I have come to depend too much on the IDE and Google! The hardest interview I had consisted of an 8 page test. Answers were written and timed. I hadn't written code since being at the university! It forces you to think of every little thing the IDE does for you automatically.

Never memorize what you can look up in books - Albert Einstein

pdavis
That's just bad ;-)
Jasper Bekkers
+8  A: 

I was asked to solve the traveling salesman problem, that's NP-Hard!

Don Neufeld
Hmm. How did you solve that on the spot ? Or did you just suggest how would you solve it ?
Tomas Pajonk
There are plenty of solutions to the problem. I was not required to solve it in polynomial time :)
Don Neufeld
A: 

I know this will say a lot about my programming "skills" but i got stumped at what a singleton pattern was.

Mostlyharmless
It also tells a lot about the person interviewing you ;-)
Jasper Bekkers
Same. But I'm still an mid-way undergrad, not clue if they thought I had design pattern experience locked away, or what.
Rev316
I was a programmer for 13 years before I ever saw or heard of Singleton or any other "design patterns". It's useful, but utterly unimportant knowledge.
Charles
@Charles: Indeed. 2-3 years down the line, i still have not had to use it. Ever. Well, no singletons at least. Design patterns are kind of "things you already knew" knowledge. They are useful when you just want to go with a known solution and save a lot of time and effort.
Mostlyharmless
A: 

I was in an interview for a programming job this year where I asked more technical questions than the interviewers (mostly Joel test questions).

The other interview was not necessarily IQ-heavy, but did involve doing a little Delphi GUI code verbally. Not even a whiteboard.

John Ferguson
A: 

I was asked to design a movie (titles and other tags) database and the access GUI for a cell phone.

alfinoba
A: 

What is a join (talking about SQL) and what's the difference if it's an Inner or Outer?

Having at the time only experiance with MySQL I was of course unable to answer it accurately but did explain what a join was and how to use one.

All my interviewers realised that looking at the samples of code I had with me was a much better judge of my coding skills.

Teifion
What's the connection to MySQL? That has both inner and outer joins just like every other real rdbms.
ysth
A: 

The most difficult technical question I had was during an all day interview. There were 3 interviewers and a white board. I was given a brief description of problem and told to write pseudo-code to handle it. Basically, they wanted me to write a doubly-linked list and the appropriate code to access it.

Kwondri
A: 

Create a working excel-like spreadsheet using Java table.

Included making the UI, doing simple calculations and references like +a3+7

A partial answer was acceptable.

I believe we had up to 4 hours to finish it. Could have been 2.

Bill K
+1  A: 

Given the local-to-world coordinate transformation matrices for two distinct objects in 3d space, how can you tell if the objects are facing each other?

This was during an interview at a game dev. company. Sadly, I didn't get the job (although I answered this question correctly), and now I'm stuck in IT working on some stupid website.

i feel for you man
Rob Stevenson-Leggett
A: 

Given a natural number n, determine if it is prime.

This isn't really that hard unless you want to be super efficient about it.

JB King
+3  A: 

I've had quite tricky ones when interviewing with Google but unfortunately this is all covered by NDA :( I'm afraid it will be the same for others who've had hard/interesting interview questions with big companies.

Anyway, Facebook's preliminary puzzles seem quite hard in my opinion. I think that they use those to screen candidates.

Google's screening questions on the other hand were way way easier. I guess it's simply different recruiting strategies.

Gilles
The funny thing about Facebook's questions are that the founder of the company could probably not solve them (unless he stole them from someone else which he does have priors for).
Craig
@Craig: there's really nothing funny or strange about that. If I were starting a software company, I would want to recruit the best brains I can find. I would hope they are all smarter than me. Wouldn't you?
Charles
A: 

Given a binary tree, write memory-conservative code to add a link that traverses the tree in order first by distance from the root and secondly by left to right position.

While the answer is obvious in retrospect, I didn't make the mental connection in the interview and had to be told the algorithm.

ysth
A: 

Given an array of integers, I was asked to write a program to find the sub-array with the largest sum. I came up with the O(n) solution, but to write the code, I was taking some time.

AJ
I don't think I understand the question: is the sub-array of fixed size? Otherwise it's just all the positive integers, no?
Alabaster Codify
I believe that the sub-array must have been contiguous.
Thom Smith
A: 

I was asked once "Which are the three base things for the OOP?" and I confess, I could not answer at that time! (The answer is "Encapsulation, Inheritance and Polymorphism", written in every OOP book introduction). From then on, I read also the introductions of the books :)

m_pGladiator
Abstraction is arguably the fourth according to some books (Head First Design Patterns for example)
Andrew
+4  A: 

For me it was being given a simple problem but being asked for the optimal solution...

Given 2 arrays, one of N length, each location in the array stores a single character (ASCII). The second array stores a series of characters [a,b,c].

You need to find the occurrences of the second array, within the first array (that's not really too hard) but you solution must use the minimum amount of array traversal, thus being an optimal solution.

Now if you think about it how big is the first array? Do you index it? What loop could you use? Whats about sorting the array? How could you sort it? Oh and add to that the fact you have a time pressure and no computer, some good old fashioned paper and pen programming.

Pretty tough for an interview.

BTW yes i got the job, no my solution wasn't optimal. The solution here was that there was not a perfect answer, it was to find out how i think and isnt that what an interview should really be about?

bite-code
+1  A: 

I got asked to explain what virtual inheritance is in C++.

I wish I'd asked for a piece of paper and a pen, because its a tricky one to describe without a diagram. The best thing was, I got the impression that the interviewer didn't know the answer and was shocked I did. I think he was trying to ask it as one of those impossible questions where you're supposed to answer by saying "I'd have to google for that".

Scott Langham
A: 
lalitm