Advertisement

Do interviewers allow you to use a compiler to answer questions

Started by December 16, 2011 06:08 PM
20 comments, last by coderx75 13 years, 1 month ago
When interviewers ask you questions like :

- Reverse elements of a linked list

or

- Reverse a string

Are you generally expected to be able to just write down the compete answer or maybe orally explain the complete answer? Or do they sit you down at a compiler?

Because with questions like these, I generally always get at least the first 5-10 attempts wrong, and rely on the debugger to correct the bugs.

I know this is going to be different with each company, but what's the general method they use?
Generally? They want you to think on your feet and answer them straight up how you would go about it -- these questions aren't meant to test the bleeding edge of your skillset but more to weed out unskilled or lacking programmers. Someone else can chime in on this though, but I'd'nt ask those questions expecting more than a: "well, first I'd do this then that and then this and that'd get me XYZ answer."

I doubt they expect you to sit down in an interview and write down a complete answer on paper or on the computer -- if that were the case and the wanted to do that, it'd be a programming test; not in an interview.
"I will personally burn everything I've made to the fucking ground if I think I can catch them in the flames."
~ Gabe
"I don't mean to rush you but you are keeping two civilizations waiting!"
~ Cavil, BSG.
"If it's really important to you that other people follow your True Brace Style, it just indicates you're inexperienced. Go find something productive to do."
[size=2]~ Bregma

"Well, you're not alone.


There's a club for people like that. It's called Everybody and we meet at the bar[size=2]."


[size=2]~ [size=1]Antheus

Advertisement

When interviewers ask you questions like :

- Reverse elements of a linked list

or

- Reverse a string

Are you generally expected to be able to just write down the compete answer or maybe orally explain the complete answer? Or do they sit you down at a compiler?

Because with questions like these, I generally always get at least the first 5-10 attempts wrong, and rely on the debugger to correct the bugs.

I know this is going to be different with each company, but what's the general method they use?










When I've been asked this question, it's been without the aid of a computer. Sometimes they want code on a whiteboard, usually they just want you to explain the steps.

And yes, if you can't at least explain these sort of things on the first try without a computer in a job that requires C or C++ (or any functional language), you're likely not ready for it.
What DarklyDreaming said is about right on point... I was personally asked a lot of terminology like, explain callstack, difference between server/client, whats a web application, questions like those. It can really depend on the company and what they do too. So do your research to have a general idea of what you are getting into. Do they do embedded programming, etc...
I've never been given, or heard of anyone giving, a computer/compiler to solve these problems. Especially ones as simple as you mentioned. In fact I'd be inclined to fail anyone who needed a debugger to tackle that type of problem. You need to be able to do these kinds of things smoothly and mostly-correct right from the start. You also need to learn to debug mentally and write better code ahead of time.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Because with questions like these, I generally always get at least the first 5-10 attempts wrong

In a programming interview, it's unlikely you will ever see questions anywhere near this easy - unless it's purely as a 'weed out the non-programmer' exercise.

Reversing a string is a trivial application of a for loop, reversing a linked list is a trivial application of recursion. Both of these you should be able to do in your sleep.

and rely on the debugger to correct the bugs.[/quote]
Compilers can help you identify typos, the debugger can help you diagnose crashes. But neither one really helps you avoid errors in logic. Keep programming that way, and logical errors are sure to arise - and those are far, far harder to correct.

You need to get the hang of thinking through the process before you set pen to paper: what does it *mean* to reverse a string? what sub-steps can you break the problem down to? what operations are required to implement each sub-step?

(and I do literally mean pen and paper - the compiler is a crutch, one which you need to cure yourself of. For one thing, the compiler isn't always right, especially when it comes to C++ and/or portable code)

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Advertisement
No, you will never be sat down in front of a computer in an interview.

If you're talking about using a compiler as a typo checker, the interviewer isn't going to be concerned with typos. On any serious programming interview, the interviewer isn't going to be too concerned with syntax generally. I mean unless it's an entry level weed-out the non-programmers type interview, which I guess exist but in my experience are generally done over the phone, the focus won't be on "knowing a language". Beginners always get hung-up on this idea that there is some state called "knowing a language" -- it's actually a really good sign of a beginner.

In other words, tell your interviewer you're going to write in pseudo-code if you want to and see how that goes. Lots of interviewers won't care as long as what you write is good.
When I said use the debugger I didnt mean for actually coming up with the technique Im going to use. I have an idea of how I want to do it, and can explain it, I meant use the debugger to produce a bug free result, and without any typos.

[color=#1C2837][size=2]

In a programming interview, it's unlikely you will ever see questions anywhere near this easy - unless it's purely as a 'weed out the non-programmer' exercise.

[/quote]
Well these are the questions that come up pretty much on all google searches for "programmer interview questions", even on this site.

No, you will never be sat down in front of a computer in an interview.

My guess is you haven't been through an awful lot of interviews.

Stephen M. Webb
Professional Free Software Developer


[quote name='jwezorek' timestamp='1324063291' post='4894588']
No, you will never be sat down in front of a computer in an interview.


My guess is you haven't been through an awful lot of interviews.
[/quote]
Really? I've been writing C++ professionally for the last 16 years and have never encountered this. I mean, Amazon and Google are whiteboard-only in my experience. Research-type companies have been whiteboard-only.

This topic is closed to new replies.

Advertisement