Live data from Hacker News

How to Pass a Programming Interview

blog.triplebyte.com

391–400 of 570 posts

Re: How to Pass a Programming Interview

#391
post #74
post #3

Another tip which I give: Interviewers vary widely in how much they care about whether your syntax is accurate, whether you handle invalid inputs, and whether you write unit tests. It's really useful to ask the interviewer whether they want you to worry about those things. If you handle invalid inputs for an interviewer who doesn't care about that, they're going to be a little annoyed by you going more slowly than ne…

You can always preempt the whiteboard issue by bringing a laptop along. "Hey, I'm a lot more comfortable writing code on a keyboard and with an IDE. Lets program this together in a text editor instead of a whiteboard".

That's a double edged sword. Now, your code has to compile...

Re: How to Pass a Programming Interview

#392

I really wish that at some point during my CS education I would have realized how typical programming interviews worked and just how impossible they are for me. None of my internships had this sort of stuff and after a long string of failures interviewing after graduating, I can openly admit that being able to solve algorithm stuff just isn't in my blood. It doesn't matter how many books I read or questions I practic…

One thing that helped me was to actually implement things that made use of the "algorithm stuff." Not just practicing in front of a whiteboard, but real executable code! In particular, anything involving a Tree was never very intuitive until I tried implementing a script to search for files by name. Suddenly both the recursive and the iterative approaches made sense. I understood the trade-offs because they applied d…

> The other thing that helps me in interviews is to just talk through everything I am thinking. ... If you just stand there silently decoding a problem in your head, the interviewer can't help you and has no idea how you'd approach a real problem on the job.

This.

Most important thing for me as an interviewer is for you to talk out loud about what you're doing and what you're thinking.

Just let it flow - all of it.

Programming is often a solitary thing - we go through a lot in our own heads when writing code; e.g. say I ask you to write some code to iterate through some website log files and build a site-map from the URL paths in the log entries. I bet that your mind - even as just a reader of this comment - has already started working out some of the steps to do this ... "load the files, iterate through line by line, some sort of map or DB to store the files, some way to handle duplciates" etc. You might even already have some questions lined up about number of files, frequency of running, shell-scripts vs "real" code etc. Great - but I need to know that you thought about that stuff and I wont unless you talk about it out loud.

Standing silently at the board is not giving me the interviewer as much to go on. Even if you get stuck and/or make a mess of it and dont have a working solution at the end, if you've talked out loud about what you're doing, why you're doing it (and why you're NOT doing something else etc) might be enough on its own to get you pass that interview despite your solution not working (everyone has off days, but show me your thoughts!)

Re: How to Pass a Programming Interview

#393

A candidate has an impressive STEM field educational background, say, Bachelor's, Master's, or Ph.D. degrees, has peer-reviewed publications of original research in the STEM fields including in computer science, has taught computer science in world famous US research universities, has created original, fast algorithms in computer science, has written successful software for a wide variety of applications in a wide va…

Because passing a programming interview is not what the candidate has been doing for years.

Interviews are artificial, stressful situations which in many cases do not resemble what you will actually be doing at your job.

Like well-known blogger Steve Yegge once commented about Google's interview process, sometimes it gets so bizarre that two interviewers in your queue wouldn't have hired each other! Focusing on the details one interviewer likes will make you lose points with the other. He calls this phenomenon "the interview anti-loop".

I guess being well-drilled about common questions and tricks helps counterbalance some of the pitfalls of the interview process.

Re: How to Pass a Programming Interview

#394

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…

Coding interviews are very stressful, and churn through a lot of really awesome potential hires. I imagine there are tons of false negatives, but it's nearly impossible for a terrible programmer to get through a gauntlet of programming interviews. However, I agree. They don't give a full picture of a developer's abilities.

As a developer, I prefer take-home projects. As an interviewer, I prefer a few coding interviews, followed by a take-home project.

Re: How to Pass a Programming Interview

#395

Earlier quoted context omitted.

> Here are some colors, please arrange them in palette groups that are color coordinated for a given visual effect? "Please arrange these colors in complementary, analogous, and triadic color schemes". This is color theory 101 -- something every visual designer should now. > Why is red font on blue background bad, please justify? Again, a valid question. It all depends on the brightness/saturation of the colors, and…

Many (most?) times you provide samples for a software engineer job, they don't get looked at or serve to provide much help to your cause. That you have samples seems to help get an interview but after that it's at if the samples were never even provided. I link to many samples right from my resume so interviewers don't have to depend on HR or whoever passing on extra files. I've often asked the interviewers, "just cu…

When interviewing, I'm interested in seeing the process a candidate takes to get a result, not just the result. I like looking at code samples to get a feel for code quality and software engineering practices (everything from variable naming and program structure to Git commit messages)

Real-time coding during the interview shows me how good a candidate is at collaborating when solving a problem. One good indicator is asking follow-up questions to make sure requirements are clear. Other things to look for are, e.g. TDD, which can help solve a problem with predictable correctness and pace. I have interviewed quite a few candidates who throw a bunch of code into the editor and start pseudo-randomly tweaking the code to try to make it work -- this is not a recipe for successful problem solving. Some aspects of code quality can be evaluated during the interview as well, which probably explains why many interviewers don't bother looking at code samples.

It's important to ask for a solution that can be easily deduced -- trick questions are bad for both parties, because the candidate is often stumped, and the interviewer thinks they are bad because knowing the trick makes the question simple. Many classical algorithmic questions are "tricky" in this way.

The questions also have to be "real world". Like you mentioned, you can be a successful engineer and not know the specifics of inverting a tree. If you can correctly recognize the need for the algorithm and implement it from pseudocode, you have solved your problem, which is what engineers are paid to do.

Re: How to Pass a Programming Interview

#397

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…

Coding interviews are very stressful, and churn through a lot of really awesome potential hires. I imagine there are tons of false negatives, but it's nearly impossible for a terrible programmer to get through a gauntlet of programming interviews. However, I agree. They don't give a full picture of a developer's abilities. As a developer, I prefer take-home projects. As an interviewer, I prefer a few coding interview…

I have not tried it. But in my next business venture, I plan to actually do peer programming with the candidate.

This is will allow members of my team (or myself) to get to know the candidate, evaluate the 'wave lengths', and how effective he/she is at finding patterns on the internet/books -- rather than thinking things up.

It also demonstrates to the candidate commitment on our side, and it naturally forces us to find problems of a proper size/effort (as we are spending the effort too).

We would not do it for all applicants, though -- only for once that pass basic screening / competency process (there are no trick questions or exercises there

Re: How to Pass a Programming Interview

#398
post #139

Earlier quoted context omitted.

> including (time/space) complexity analysis. I think this is one of the most inane things to be asked during an interview. personally, 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) Obviously it depends on the application, but many jobs are simply maintenance coding: find bug, fix bug, test fix. Often times…

"Or had to find the O(x^n) and replace it with O(x^2)" The other thing that really seals the deal for me as an inferior interview question is that you don't need to have a clue what O(x^n) is to wrap some code in a simple time call, see that the code you think ought to run in microseconds is running in seconds, by visual inspection notice stupid nested loops, and fix it. Self-taught programmers may not be able to say…

It demonstrates that you have a passing familiarity with probably _the_ most fundamental tool of the trade.

Re: How to Pass a Programming Interview

#399
This is a very good piece of advise, matches my past job seeker's experience really well. I think I got most of my jobs largely thanks to enthusiasm I had for the stuff the companies were doing. It was genuine but I'm sure it could be pretended as well. Everything else spot on, very honest stuff.

Re: How to Pass a Programming Interview

#400
post #314

Earlier quoted context omitted.

Most likely you think about it, though. When you're coding, and you have a triple loop, do you think, "Oh, this is O(n^3). Is n going to be too big here?" It may be something that's so intuitively obvious to you, that you don't even think about it. So you naturally use the hashmap, where someone else might try a list and then start doing a lookup in a loop. Then while that particular instance might not break things,…

I've never ever thought that to myself. Then again my code never has triple loops.

So do you never call anybody else's functions, or do you always verify that they don't do any loops in those calls?
Post reply on HN