Chapter 5

Programming Fundamentals

Many interviewers (including me) like to “warm up” an interview by starting with an easy question that looks at some fundamental aspect of programming. If a candidate falls at this first hurdle, I might even terminate the interview. Knowledge of fundamentals really is that important.

A thorough knowledge of the elements takes us more than half the road to mastership.

—Aron Nimzowitsch

Many programmers are also disadvantaged by the lack of a formal education in computer science. It might have seemed like a load of stuffy irrelevance when you were learning it (though I hope not), but many situations exist in which this knowledge can mean the difference between doing a quality job and a late night wearing your fingers to nubs while you reinvent the wheel.

Programmers love solving problems, which is just as well because programmers face so many of them. What isn't quite so serendipitous is that many otherwise pragmatic and sensible programmers seem to enjoy solving problems that were comprehensively solved decades earlier. It is true that some of these problems are trivial and have obvious solutions, in which case not much harm is done (and the programmer enjoys the thrill of the learning experience), but other commonly encountered problems such as the manipulation of dates and the choosing of a random number are deceptively difficult. Reinventing solutions to these harder problems inevitably leads to buggy software. I know this from first-hand experience. ...

Get Ace the Programming Interview: 160 Questions and Answers for Success now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.