Live data from Hacker News

How to win the coding interview

blog.devmastery.com

61–70 of 305 posts

Re: How to win the coding interview

#61
post #52
post #36

I'm tired of companies asking me to code at their interviews. I have 10 years experience with references. I have code that I've built, deployed to production still running today. I have cultivated my own clients, gathered requirements and built something that delivers business value. Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Wor…

What I've seen suggested elsewhere is having publicly viewable code on github or the like - that would effectively be your coding resume and evidence of your ability.

True but it is not that hard for someone to fake that if they really want to. That said, faking history in github likely takes enough technical ability that the person could probably do a decent job programming if they use their powers for good.

Re: How to win the coding interview

#62
"there will come a time when we are banging our heads against a problem and there is a deadline looming and we’re tired and people are pissed at us and money and jobs and reputations are all on the line."

Real response to this should be to ask how it got to the point where we are all stuck in a room with a deadline looming and our jobs are on the line if we don't come up with a whiteboard solution RIGHT NOW.

Sounds like this place has a management/expectations problem and I wouldn't want to work there in the first place.

Re: How to win the coding interview

#63
post #9

Is there even room on a whiteboard to write comments and tests ? Often there's barely even room to write readable code ... If you're writing in a shared text editor then sure. And isn't all the talking you do already commemts enough? Edit: I'm bad at reading comprehension on a mobile screen. The tests and comments bit is in a different section.

That's why you need to bring some of those thin Japanese whiteboard markers.

http://www.jetpens.com/Zebra-Mackee-Wet-Erase-Double-Sided-M...

Re: How to win the coding interview

#64
post #36

I'm tired of companies asking me to code at their interviews. I have 10 years experience with references. I have code that I've built, deployed to production still running today. I have cultivated my own clients, gathered requirements and built something that delivers business value. Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Wor…

Out of curiosity, am I supposed to take an entire week of PTO in order to undergo such an interview process while currently employed? Because I can't really think of a single company I'd be willing to do that for.

Re: How to win the coding interview

#65
post #36

I'm tired of companies asking me to code at their interviews. I have 10 years experience with references. I have code that I've built, deployed to production still running today. I have cultivated my own clients, gathered requirements and built something that delivers business value. Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Wor…

That's great of you to offer as a candidate. However, from the interviewer's side, I can't ask candidates to do this. The people I want to hire are already busy. They don't have a whole week to devote to my interview process. Not even if I pay them for it.

Re: How to win the coding interview

#66
post #36

I'm tired of companies asking me to code at their interviews. I have 10 years experience with references. I have code that I've built, deployed to production still running today. I have cultivated my own clients, gathered requirements and built something that delivers business value. Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Wor…

>Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Work that is small enough to be done in 1 week and big enough to deliver some value.

Except now I have to jump through hoops with HR (let's just assume they'd be OK with this, which they almost certainly won't), get the contract in place, work with IT to get your environment set up, and bring you up to speed (so really I may get one full day of actual work)... just to realize that I don't want to hire you. Oh, and did I find you through a recruiter? Now I have to pay them a cut. Do I now get to run this little bureaucratic maze for all N candidates I'm looking at? You have become a very expensive interview across at least three departments and you're probably not worth it.

Sorry, but no. I do ask for some whiteboard coding, but it can be done in any language (or pseudo code) and I'm really only trying to tease out your thought process. For a junior or mid level position, yes; I am also trying to figure out if you can write a line of code. I'm also not sure how you're going to be able to get away from your current job for an entire week (I have literally never interviewed a candidate who wasn't fresh out of college who was unemployed at the time).

I agree that it can be a pain, but there aren't always better ways to measure your ability to take a problem and turn the solution into an algorithm.

Re: How to win the coding interview

#67
Most programmers already know how to win the coding interview. You simply have to solve problems, at the same time trying to evaluate your next boss (or at least the kind of people who work there) by the level of insanity they generate during the interview. If the coding style in the company disagrees from yours too much, it's a good thing they won't hire you, so no problem there.

The tough thing is to pass the HR interview, with dozens of idiotic questions and no way to answer them correctly except having googled the answer to each particular question beforehand.

Re: How to win the coding interview

#68
post #54

Why regexes combined with the pre-processing? First, it's not so clear in what sense "efficient" is actually a real requirement if this is a model answer. If the average input is very small then the cost of compiling/interpreting the regex is going to dominate any modest run-time improvement over even an extremely naive implementation. And if the inputs are very large then the probability of contradiction in the firs…

Regexes would not be a good way. Starting a pointer at the beginning and end and moving them toward each other is what I would suggest in an interview. If I was interviewing someone else, I'd also be impressed if they came up with the idea of sorting the string and counting characters (only at most one character could have at odd number of occurrences). Even though sorting and counting is nlogn and requires either st…

If you use a bucket sort, your time complexity could be O(max(n,k)) and space O(k) where k is the size of the character set and n is the length of the string. Depending on the relationship between n and k, this could be faster than n log n. (But the pointers solution or even comparing against a reversed string seems better for both time and space.)

Also, your solution is poor since it only tells you that a string is _not_ a palindrome in certain cases but cannot tell with certainty that a string is a palindrome. For example, 'aabb' will pass your test but is not a palindrome.

Re: How to win the coding interview

#69
I've been at a really bad interview where the interviewer wanted me to sit at a computer, for a limited time, and answer a bunch of mathematical questions with the help of writing a program.

I was pretty nervous before my interview since it was one of my first ever. I had studied a lot before hand since the company used languages I didn't really know. I could not sleep the night before (mostly for other reasons as well) so I was pretty exhausted when I got there. There was no internet connections on the machine and each question built on the one before so if you failed one you pretty much failed the entire thing.

The whole test was a big hit for my imposter plexus and I'm never going to repeat that mistake. I feel like I have the experience and references that I do not need to prove it on a whiteboard. I don't want to and if you require me to, I'm probably not going to work for you.

The funny thing is, years later the same interviewer tried to add me on LinkedIn and it felt awesome to ignore that.

Re: How to win the coding interview

#70
post #36

I'm tired of companies asking me to code at their interviews. I have 10 years experience with references. I have code that I've built, deployed to production still running today. I have cultivated my own clients, gathered requirements and built something that delivers business value. Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Wor…

Yes. Unless you're not the only person we're looking at hiring. We're not going to pay 10 people for a week and hire just one. We'd rather we get a sample by seeing you do some work on a whiteboard, and make some cuts right then and there. In other words: yes, that's a better way for you to prove yourself. No, we don't have the resources for this approach.

You don't want to pay 10 people for a week. You want to pay one person at a time over a 10 week stretch. That way, you can evaluate each candidate independently and hire the best one. This is undoubtedly a better approach than doing a bunch of coding interviews, so you should have a strong incentive to make sure you have the resources for it. After all, you want to minimize the risk of hiring mediocre people and maximize the chances of hiring really good people, right? The latter will pay for themselves tenfold.
Post reply on HN