Introduction

"My interview at a company well known for its hard and puzzling questions was a joke after this class."

—Boris, a graduate of my puzzle class at NYU

Some people, like me, love puzzles. Others feel they must study puzzles to succeed at job interviews. I've written this book for both. You'll find here some kick-ass puzzles, but I also take you on a kind of tutorial tour of problem solving techniques to help you face new puzzle challenges. Oh, and then there's the possibility of a prize if you solve the superhard puzzles at the end.

Puzzles as an interviewing tool have many detractors. Criticism often comes down to the implausibility of a puzzle scenario in which, say, a perfectly logical person is mute and refuses to write. Now, I admit to having written such puzzles, but most of my puzzles come from real problems (e.g., occasionally failing hardware being modeled by occasional liars). In my own research, I try to abstract the problem at hand to a puzzle, in the hopes that I can understand the fundamental issues and take care of the window dressing later. It works pretty well. So, to me, puzzles, especially the right kinds of puzzles, provide a tunnel into scientific and engineering insight.

So why do I write puzzles for other people? First, because they're fun. Second, because they exercise the brain in a useful way. In the puzzle course that Boris talks about in the epigraph, students write programs every week. The programs compete (each having two minutes to run) ...

Get Puzzles for Programmers and Pros 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.