Live data from Hacker News

How to Pass a Programming Interview

blog.triplebyte.com

421–430 of 570 posts

Re: How to Pass a Programming Interview

#421
I think it's also important to mention that you should come in with some good questions of your own that you've prepared for them. A lot of times the interviewer uses this to see how much homework you've done on both the company and the job you're applying for.

Re: How to Pass a Programming Interview

#422

Earlier quoted context omitted.

The problem was to find the only non duplicate number in a list. I'm not sure how you would have a constant number of keys. I mean I guess if you consider a worst-case hash table with bucket for each integer you would have 2^32 keys (which is technically O(1) space since the size remains fixed regardless of list length). But using Big-O in this case is clearly disingenuous since the space allocated is far, far more t…

My bad, I meant for a variant of the question that uses chars and not numbers. With numbers the hashmap will be still constant memory just like you said, but it's a big constant (2^32) - but still O(1) memory. This is because the input is of ints, and it can only be one of ~2^32 numbers for either values or keys. And since we only count the number, we don't need a map, we can just use a set (a map with boolean value…

Ah that makes sense.

And what was the intended solution for finding if an unsorted list of numbers is an arithmetic series in constant memory? You say it's the same xor trick, but I don't see how it's applicable. Do you xor all the values with all the values shifted over by the common difference?

Re: How to Pass a Programming Interview

#423

Earlier quoted context omitted.

> I much prefer "homework" projects I helped a group within my organization with their hiring process recently, and we had pretty good success with assigning a short "take-home" exercise, vs. trying to haze them with a programming problem over a google hangout interview. A problem focusing on a small part of what that group does, but scoped to be doable with 1-2 hours of work.

I guess it works well for people unemployed with nothing else to do, no family, lots of time. Everyone else, this sucks!

So you are saying you don't spend any time preparing for your interviews :-)

Re: How to Pass a Programming Interview

#425
post #416

Earlier quoted context omitted.

> Which can be easily countered by having one of their own team members sit down and take the test first. But of course, none of these places ever do that. At my employer we send out homework exercises, and I personally did the backend developer exercise before we sent it to anyone. I did this specifically to test how long it took. (For the frontend exercise, we didn't have anyone skilled enough on staff to do it, wh…

Did you do the test blind? i.e. Did someone give you the problem without you knowing/hearing it before? If you wrote the problem, or even heard it before you had to solve it, you had a big leg up on someone who's never heard it.

Fair points. FWIW, we've asked people how long the problem took and they all said it took a few hours, so I think it's the right scope. It really is a fairly easy piece of work.

Re: How to Pass a Programming Interview

#426

Being a good programmer has a surprisingly small role in passing programming interviews. And that just says it all, doesn't it? I agree that interviews should test candidates on certain basic skills, including (time/space) complexity analysis. But do you really learn anything by asking the candidate if they can recite the time complexity of a moving window average algorithm (as I was asked to do by an interviewer yes…

Ah. I just provide all my answers in an obscure language they won't know, but has lots of "nerd-cred", so they feel uncomfortable questioning it. Like OCaml, Erlang, or Haskell.

Then in the rare case they question it, which usually goes something like, "Can you do it in Java? We don't use whatever language it is you're using there." I respond with, "Oh, will I be spending a lot of time at this job coming up on-the-fly with somebody's PhD thesis from the 60's?" To which the answer is always, "No." Which finally ends the conversation with me saying, "Well then you asked me to solve an irrelevant problem, so I'm happily providing you an irrelevant answer."

I have a fair bit of contempt for the pitiful state of technical hiring and assessment process out there. I think that comes mostly from my opinion that hiring is probably the most important thing any company or manager does, and that if any one of these companies/interviewers put even 10% the amount of effort into learning about educational/occupational assessment, psychology, and neurology that they do into obsessing over the dubious idiosyncrasies of the latest framework-rehash-of-the-month, then these terrible interview practices wouldn't endure very long, and we'd all be spared the indignity of the farce on both sides.

Re: How to Pass a Programming Interview

#427
post #196

Earlier quoted context omitted.

I've never found myself in a situation where I truly needed to choose between a vector/map/list/hashmap. Or had to find the O(x^n) and replace it with O(x^2) This entirely depends on the kind of product you are working on. When you get to a large scale with any programming project, optimizing computational resources will cut costs, and can often add value to the customer as well.

This is special pleading, though, right? It being relevant to "any" large scale project really just means that projects can get big enough for it to matter, but how many jobs involve this family of software? How many interviews for positions directly related? Very few, I would guess.

I find myself having to think about efficiency at least a couple times a week. I'm working on database implementation, and in the query processor we have to consider all the time how to evaluate various things efficiently.

Re: How to Pass a Programming Interview

#428

Earlier quoted context omitted.

> there's very little left to discourage interviewers from issuing ridiculously time-consuming projects There's also no disincentive for interviewees to spend an unreasonable amount of time on the project. So the test is biased against employed people and/or people with kids. This can be easily countered though. Send out the assignment at a predetermined, convenient time and require it be returned an hour or two late…

Send out the assignment at a predetermined, convenient time and require it be returned an hour or two later. Except that these places very frequently tend to either (1) misstate the problem in some major or minor way, or (2) wildly underestimate the time required to produce a professional quality, bug-free, bulletproof-tested solution. Which can be easily countered by having one of their own team members sit down and…

I actually do what you suggest. I pick problems I've never did before and try to solve it in less than 1/3rd the time I allot for the interviewee to account for interview time pressure. Even then there are probably biases because I pick problems that I can solve so I periodically review the candidate success rates on problems and change them out if they are too simple or too complex.

Re: How to Pass a Programming Interview

#429
post #330

Earlier quoted context omitted.

Doesn't that support the fact that it is a meritocracy? Is it not reasonable to expect that top companies and top schools are more likely to employ people who have more applicable talent and skill? At the end of the day, going to a top university or working at an impressive company is always going to be a huge and relevant signal. It's difficult to see a problem with that.

>>Is it not reasonable to expect that top companies and top schools are more likely to employ people who have more applicable talent and skill? No. Its more like a club. Join this prestigious institution X, and then you shall enjoy life long benefits of employment, higher than average salary, bonuses, stock, opportunities to travel etc. Even if the person is actually the worst possible employee, or is barely producti…

Right, I'm shocked that everyone can't see that it's a club, to fund people who went to your school over others. I bet the original guy who posted that was in the club :-)

Re: How to Pass a Programming Interview

#430

Earlier quoted context omitted.

Send out the assignment at a predetermined, convenient time and require it be returned an hour or two later. Except that these places very frequently tend to either (1) misstate the problem in some major or minor way, or (2) wildly underestimate the time required to produce a professional quality, bug-free, bulletproof-tested solution. Which can be easily countered by having one of their own team members sit down and…

> Which can be easily countered by having one of their own team members sit down and take the test first. But of course, none of these places ever do that. At my employer we send out homework exercises, and I personally did the backend developer exercise before we sent it to anyone. I did this specifically to test how long it took. (For the frontend exercise, we didn't have anyone skilled enough on staff to do it, wh…

It took a few hours and "it really was an easy piece of work?" How considerate of you. Who was it an an easy piece of work for, someone with unlimited free time. An unemployed person. What a joke. Any problem is easy when you yourself contrive it. Here's an idea, how about you pay someone for the 3 hours or work you are giving them. Say a lot about you.
Post reply on HN