Cracking the Coding Interview: 150 Programming Questions and Solutions Info

Find the best books In Reference - best sellers and hot new Releases. Check out our top gifted and best rated books this year. Take a look at hundreds of reviews before you download Cracking the Coding Interview: 150 Programming Questions and Solutions by Gayle Laakmann McDowell. Read&Download Cracking the Coding Interview: 150 Programming Questions and Solutions by Gayle Laakmann McDowell Online


Now in the 5th edition, Cracking the Coding Interview gives you
the interview preparation you need to get the top software developer
jobs. This is a deeply technical book and focuses on the software
engineering skills to ace your interview. The book is over 500 pages and
includes 150 programming interview questions and answers, as
well as other advice. 
The full list of topics are as
follows:

The Interview
Process
This section offers an overview on questions are
selected and how you will be evaluated. What happens when you get a
question wrong? When should you start preparing, and how? What language
should you use? All these questions and more are
answered.

Behind the
Scenes
Learn what happens behind the scenes during your
interview, how decisions really get made, who you interview with, and
what they ask you. Companies covered include Google, Amazon, Yahoo,
Microsoft, Apple and
Facebook.

Special
Situations
This section explains the process for
experience candidates, Program Managers, Dev Managers, Testers / SDETs,
and more. Learn what your interviewers are looking for and how much code
you need to know.

Before the
Interview
In order to ace the interview, you first need to
get an interview. This section describes what a software engineer's
resume should look like and what you should be doing well before your
interview.

Behavioral
Preparation
Although most of a software engineering
interview will be technical, behavioral questions matter too. This
section covers how to prepare for behavioral questions and how to give
strong, structured responses.

Technical Questions (+ 5
Algorithm Approaches)
This section covers how to prepare
for technical questions (without wasting your time) and teaches
actionable ways to solve the trickiest algorithm problems. It also
teaches you what exactly "good coding" is when it comes to an
interview.

150 Programming Questions and
Answers
This section forms the bulk of the book. Each
section opens with a discussion of the core knowledge and strategies to
tackle this type of question, diving into exactly how you break down and
solve it. Topics covered include 
  • Arrays and
    Strings
  • Linked Lists
  • Stacks and Queues
  • Trees and
    Graphs
  • Bit Manipulation
  • Brain
    Teasers
  • Mathematics and Probability
  • Object-Oriented
    Design
  • Recursion and Dynamic Programming
  • Sorting and
    Searching
  • Scalability and Memory
    Limits
  • Testing
  • C and
    C++
  • Java
  • Databases
  • Threads and
    Locks
For the widest degree of readability, the solutions
are almost entirely written with Java (with the exception of C / C++
questions). A link is provided with the book so that you can download,
compile, and play with the solutions
yourself.

Changes
from the Fourth Edition: 
The fifth edition includes over 200 pages
of new content, bringing the book from 300 pages to over 500 pages.
Major revisions were done to almost every solution, including a number
of alternate solutions added. The introductory chapters were massively
expanded, as were the opening of each of the chapters under Technical
Questions. In addition, 24 new questions were
added.

Cracking the Coding Interview,
Fifth Edition
is the most expansive, detailed guide on how to
ace your software development / programming interviews.


Average Ratings and Reviews
review-bg

4.48

5431 Ratings

5

4

3

2

1


Ratings and Reviews From Market


client-img 4.6
482
96
32
19
13
client-img 4.35
2126
2043
671
6
1

Reviews for Cracking the Coding Interview: 150 Programming Questions and Solutions:

4

Jul 23, 2017

Indispensable.

I absolutely hate the way technical interviews are done for programmers. Can you imagine if a heart surgeon went to interview at a hospital, and they handed him a game of "Operation" to play? That's how we interview programmers. It's so stupid, I could go on and on about it for paragraphs.

But, if you want to work at the top tech companies in the world, you have to play the game, incredibly stupid and poorly aligned it is to the task at hand. And if you're about to head out on some Indispensable.

I absolutely hate the way technical interviews are done for programmers. Can you imagine if a heart surgeon went to interview at a hospital, and they handed him a game of "Operation" to play? That's how we interview programmers. It's so stupid, I could go on and on about it for paragraphs.

But, if you want to work at the top tech companies in the world, you have to play the game, incredibly stupid and poorly aligned it is to the task at hand. And if you're about to head out on some coding interviews, reading Cracking the Coding Interview is the single most important thing you can do for yourself. It's simply phenomenal.

There are definitely some sections that Gayle doesn't seem particularly interested in. For example, the coverage of Bit Manipulation seemed a bit cursory, like it's an area that she's not super familiar with or comfortable with herself. But for the most part, all of the major stuff is covered, in the right level of detail. It's good to review but if you weren't already somewhat familiar with a lot of these data structures and concepts, I'm not sure that the book works as an introduction.

One major omission is the coverage of Tries. They get a shout-out as a data structure that basically doesn't show up in interviews, but I interviewed at 5 major tech companies after reading this book and Tries were the right solution in three of them.

Overall though, the reason to get this book is for the set of questions. Questions that are exactly the kind of things you get asked in coding interviews. Each question has some hints, as well as the answers in the back. Take the book, and practice solving the problems on an actual whiteboard. Don't skip to the answers, but feel free to read the hints (most interviewers will provide similar hints).

There's simply nothing else you can do that better emulates the coding interview than practicing the problems in this book. It's a must-have. ...more
3

Aug 04, 2014

I suppose it's fair to say I'll never quite be "finished" reading this, but regardless, I have an opinion of it.

Laakmann (McDowell? Which last name do I choose?) does a thorough job of breaking down different kinds of interview questions, from brain teasers to OO questions, and there's a good breadth of difficulty as well. My only gripe is that it seems like this book is more for the Java-enthusiast programmer who is dying to interview at Microsoft, rather than... anyone else. It doesn't help I suppose it's fair to say I'll never quite be "finished" reading this, but regardless, I have an opinion of it.

Laakmann (McDowell? Which last name do I choose?) does a thorough job of breaking down different kinds of interview questions, from brain teasers to OO questions, and there's a good breadth of difficulty as well. My only gripe is that it seems like this book is more for the Java-enthusiast programmer who is dying to interview at Microsoft, rather than... anyone else. It doesn't help that the solutions are all in Java. What is this, the '90s?

So, take this book with a grain of salt. I've noticed more companies moving towards a pair-programming style of interview, which focus on your skills as a *programmer*, not a *computer scientist*. Of course, it just depends where you interview.

Java is so gross to look at. ...more
2

Nov 29, 2015

I am very negative about hiring practices in the US software industry, where often for a pizza delivery kind of job they interview as if they need a space ship pilot. And this book and many similar ones are culmination of this flawed approach, that forces people to memorize tricky tasks and their solutions instead of developing strong CS and Math backgrounds.

Overall the book was OK to get a taste of what insanity to expect on coding interviews. But almost every topic in the book is covered much I am very negative about hiring practices in the US software industry, where often for a pizza delivery kind of job they interview as if they need a space ship pilot. And this book and many similar ones are culmination of this flawed approach, that forces people to memorize tricky tasks and their solutions instead of developing strong CS and Math backgrounds.

Overall the book was OK to get a taste of what insanity to expect on coding interviews. But almost every topic in the book is covered much better elsewhere. ...more
5

Dec 12, 2017

For better or for worse, this book is a must read for any developer, at least from pragmatic point of view, I personally don't see the current interview practices any good, but reality is reality.
4

Jan 10, 2013

This is a great interview prep book, and I would recommend catering your focus to the types of companies you're interviewing with.

In general, most companies probably aren't going to give you questions from math/probability and brain teasers (the exception is the big-name companies the author mentions, Microsoft, Google, Amazon, etc.).

I actually brushed up on the java section last night before an interview today, and believe it or not, I was asked about a topic from the java overview (I was This is a great interview prep book, and I would recommend catering your focus to the types of companies you're interviewing with.

In general, most companies probably aren't going to give you questions from math/probability and brain teasers (the exception is the big-name companies the author mentions, Microsoft, Google, Amazon, etc.).

I actually brushed up on the java section last night before an interview today, and believe it or not, I was asked about a topic from the java overview (I was thankful I had the refresher!). For that reason alone, I'm giving this a 4 star rating :-) ...more
5

Feb 20, 2016

This book is a must have for any software engineer. It doesn't matter whether you already have the perfect job or you are a college graduate, who needs to find your first job - it provides a good base for how programming interviews are done in the majority of the software companies.

The book is structured in two parts: overview of how interviews for software engineers proceed and actual coding exercises with hints and complete answers.

The overview of the interview process focuses on how most of This book is a must have for any software engineer. It doesn't matter whether you already have the perfect job or you are a college graduate, who needs to find your first job - it provides a good base for how programming interviews are done in the majority of the software companies.

The book is structured in two parts: overview of how interviews for software engineers proceed and actual coding exercises with hints and complete answers.

The overview of the interview process focuses on how most of the interviews in the software companies are done and confirming the fact that majority of the time in these interviews is spent actually coding on whiteboard, which for bad or good is quite different than coding on a computer. Probably the main take aways are:

The goal of the coding in the interview process is not to find out what you know, but how you approach and think through a problem, which you've never encountered before. Observing what you know is a side-effect of facing unfamiliar problem, which often requires application of knowledge you already know.
No one expects you to solve a problem immediately or in one try. The goal is to see how you react to unfamiliar situation - ability to find information, analyze the problem looking for a starting point, etc.
On similar note, no one expects to be able to answer all the questions. You are graded not based on whether you answered all questions or not, but on how well you perform against other interview candidates. ...more
4

Nov 08, 2013

The list of questions and solutions is not comprehensive, but I guess that is the point. Coding interviews are about judging your approach to problems rather than specific solutions. I found that some of the problems were quite simple compared to the difficulty level currently in force at various companies. In particular would like to see more dynamic programming problems.

But the way the solutions are laid out is amazing. Although you should try to solve it yourself before reading the solutions, The list of questions and solutions is not comprehensive, but I guess that is the point. Coding interviews are about judging your approach to problems rather than specific solutions. I found that some of the problems were quite simple compared to the difficulty level currently in force at various companies. In particular would like to see more dynamic programming problems.

But the way the solutions are laid out is amazing. Although you should try to solve it yourself before reading the solutions, once you have solved it, you should read the solutions anyway, because he explains the approach he has taken to solve the problems and that turns out to be very valuable.

Overall, very useful - not just for people looking for change, but for every one looking to keep their mind sharp and fresh. ...more
1

Nov 25, 2017

This book attempts to define *the* format for programming interviews, equating interviewing with competitive programming, which is the type of programming used at events like IEEE Xtreme or ACM ICPC (among others).

Competitive programming has a lot of merit, and provides a tangible demonstration of some of the programmer's abilities, but in many cases, high performance in these tasks will not be a predictor of on-the-job performance. In this regard, "Cracking the Coding Interview" is a bit of a This book attempts to define *the* format for programming interviews, equating interviewing with competitive programming, which is the type of programming used at events like IEEE Xtreme or ACM ICPC (among others).

Competitive programming has a lot of merit, and provides a tangible demonstration of some of the programmer's abilities, but in many cases, high performance in these tasks will not be a predictor of on-the-job performance. In this regard, "Cracking the Coding Interview" is a bit of a disservice to the software engineering interviewing process.

If you wish however, to get better at this interviewing format, I would rather recommend the following resources:
- Learning: Sedgewick's algorithms book and video course.
- Exercises: InterviewBit, Topcoder.

In addition to that, a competitive programming book. I recommend "Competitive Programmer's Handbook" by Antti Laaksonen (https://cses.fi/book.html), which provides programmer to programmer advice, in a linear, easy to follow format, with code examples. ...more
5

Mar 02, 2020

One of the best books to prepare to the technical interview. It covers everything starting from questions on your previous experience and finishing hardcore algorithms.

If you have 3+ month before your first tech interview - this book is probably your best bet.

And it works, thanks to it (and bunch of others) I managed to get offers from Facebook and Google.
5

May 26, 2018

I've been through this book, front to back, many times, and, this time, I've shelved it with great optimism. So here's to you, Gayle. You've helped mediocre students like me to chase their wildest dreams without concession.

Reviewing CtCI has traditionally been considered the best way to test Software Engineering fundamentals among those entering the industry. With the popularization of interactive platforms like HackerRank and Leetcode, it has become a rite of passage among undergraduates to I've been through this book, front to back, many times, and, this time, I've shelved it with great optimism. So here's to you, Gayle. You've helped mediocre students like me to chase their wildest dreams without concession.

Reviewing CtCI has traditionally been considered the best way to test Software Engineering fundamentals among those entering the industry. With the popularization of interactive platforms like HackerRank and Leetcode, it has become a rite of passage among undergraduates to grind practice problems for hundreds of hours. The result of this leading to highly-desireable career outcomes is that 1. You have a lot of people studying Computer Science for the wrong reason (E.G. CS is the new pre-med) and 2. Most other skills that are important for those working in the industry are deemphasized. 3. There is increased homogeneity in an almost exclusively negative sense.

I don't place the blame on Gayle for what has happened nor do I blame companies that use permutations of these classic problems to screen tens of thousands of candidates. Many people who studied Computer Science did so because they saw it as the best way to satisfy their desire to solve interesting problems and hate it if you must, but this is just a book filled with fun little problems to solve. You signed up for it! Getting toasted in a Facebook interview doesn't mean that the candidate evaluation process is broken!

Anyway, it's a classic book. People probably recommend "better" things now but, as you can probably imagine, most of the problems you'll find elsewhere will be similar if not identical. I'm getting a bit old for this now, though, and I'm hoping I never have to open the book again.

Visit my blog for this and other book reviews ...more
5

Mar 20, 2017

I was searching for software engineering internships for this summer. Before reading this book, I failed all four tech interviews with various companies, 2 bigger companies and 2 startups. And then I got more interviews, and I decided to spend an weekend reading this book. I passed the subsequent interviews with three companies, including Google and a hot SF startup. I learned some key crucial techniques from this book which I applied to my latter interviews, they are:

1. Talk out loud so that I was searching for software engineering internships for this summer. Before reading this book, I failed all four tech interviews with various companies, 2 bigger companies and 2 startups. And then I got more interviews, and I decided to spend an weekend reading this book. I passed the subsequent interviews with three companies, including Google and a hot SF startup. I learned some key crucial techniques from this book which I applied to my latter interviews, they are:

1. Talk out loud so that your interviewer can be on the same page of where you are in your thinking process and can correct you if you go awry.
2. Use simple examples to help thinking. It's a lot easier to think about a concrete example than an abstract problem.
3. Various techniques to decrease time and space complexity of your algorithm.
4. A different way to look at technical interview: it's not about solving the problem, it's about showing your thinking process and logic reasoning capabilities.

Really recommend to anyone prepping for coding interviews. ...more
5

Apr 25, 2014

A useful guide to the interview process, followed by 150 exercises in a number of subfields relevant to programmers. The book straight-forwardly is what it says it is, and accomplishes what it sets out to accomplish; I do believe if you study the material therein, you will be better prepared for programming interviews. If you are already prepared to this level, you will quickly confirm that during your read of the book, which then makes you more confident in your abilities and what to expect at A useful guide to the interview process, followed by 150 exercises in a number of subfields relevant to programmers. The book straight-forwardly is what it says it is, and accomplishes what it sets out to accomplish; I do believe if you study the material therein, you will be better prepared for programming interviews. If you are already prepared to this level, you will quickly confirm that during your read of the book, which then makes you more confident in your abilities and what to expect at your upcoming interviews.

If you're paranoid/thorough, go ahead and work through more problems, such as those found in Elements of Programming Interviews, Programming Interviews Exposed, Project Euler, TopCoder, HackerRank, and so on. ...more
4

Dec 29, 2014

Cracking the Coding Interview is one of the best books to remember old topics. If you are still coding or like coding this book is a great resource to practice old topics. Most of the topics are not too detailed but it is good to check the abstracts.

After reading this book, you probably need more detailed books for each subject.

- Arrays and Strings
- Linked Lists
- Stacks and Queues
- Trees and Graphs
- Bit Manipulation
- Brain Teasers
- Mathematics and Probability
- Object-Oriented Design
- Recursion Cracking the Coding Interview is one of the best books to remember old topics. If you are still coding or like coding this book is a great resource to practice old topics. Most of the topics are not too detailed but it is good to check the abstracts.

After reading this book, you probably need more detailed books for each subject.

- Arrays and Strings
- Linked Lists
- Stacks and Queues
- Trees and Graphs
- Bit Manipulation
- Brain Teasers
- Mathematics and Probability
- Object-Oriented Design
- Recursion and Dynamic Programming
- Sorting and Searching
- Scalability and Memory Limits
- Testing
- C and C++
- Java
- Databases
- Threads and Locks
Reviewed on December 29, 2014
Overall: 4.0/5.0
...more
5

Apr 30, 2012

This is a must read book for all engineers looking for work. It goes over how to act as well as coding/behavioral questions. A related site for more examples can be found here: http://www.mycareerstack.com/questions/

Again, this is a must read book (and fast read). It will let you know what areas to improve on and which ones are normally asked (and they really do get asked!)
4

Apr 15, 2015

I have not finished all the exercises in here, but the book did give me a good idea what to expect in a tech interview. Not related to the book, but I found this complete, comprehensive solution set in other languages on github: https://github.com/gaylemcd/ctci
4

Sep 27, 2015

3.5/5

There are some problems with the book. When the code is large, the comments go missing. Literally, you might begin to bang your head against a wall, when you have 2 pages of code and the functions are missing the info what they do.

A program should be extremely readable if it is given in a book, and hence heavily commented.

Coming to OOP section, some solutions are horrible. One example would be the car park one.

Otherwise the book is great. Maybe the Test chapter should be skipped, people 3.5/5

There are some problems with the book. When the code is large, the comments go missing. Literally, you might begin to bang your head against a wall, when you have 2 pages of code and the functions are missing the info what they do.

A program should be extremely readable if it is given in a book, and hence heavily commented.

Coming to OOP section, some solutions are horrible. One example would be the car park one.

Otherwise the book is great. Maybe the Test chapter should be skipped, people from testing profile won't buy the book, and those who WILL buy are not looking for testing profile.

The DP programming questions don't have very good solutions. And don't even think about learning DP approach from here. You won't be able to.

...more
5

Jul 18, 2018

This book is a must read for coding interview preparation. Not only the questions are great but Gayle explains the approach to breakdown different problems into steps so that you can easily tackle problems you have never solved before.

This book helped me in my placement interviews and I was able to crack interviews of companies like Oracle, Amazon easily.

4

Feb 26, 2019

Targeted to the software engineer, the data scientist will also find some valuable information in this book. The first chapters are general enough that the description of the interview process, difference between different tech companies, behavioural questions, etc, shall apply to both engineers and scientists. Then I really enjoyed the sections on math and logic puzzles and the advanced topics on math. Of course, the bulk of the book, on coding, will mainly interest the software engineer.
4

Dec 26, 2017

While CtCi is a great coding interview prep book, I still believe that it is slightly over-rated. It should be read with other books, not as a standalone due to lack of explanation in some parts.

Overall, I'd recommend this book to someone who had never read other coding interview prep book.
5

May 03, 2018

The best book for coding interviews, period. Gayle Laakmann McDowell cuts through the crap and clearly establishes what is important and what is not. Also, this book serves as a guide for a lot of recruiters out there.
0

Dec 17, 2018

I have so, so much to learn. Its as if people get college degrees in this stuff! I have so, so much to learn. It’s as if people get college degrees in this stuff! ...more
3

Apr 16, 2020

I'd recommend Elements of Programming Interviews over this book, but this covers the basics.
5

Mar 17, 2019

i got the job!!!

didn't end up doing any of the questions, just read the content chapters and focused heavily on Big O section. also did leetcode and practice interviews on Pramp
5

May 26, 2019

Really good book (in addition to practice on LeetCode and HackerRank) for those who haven't been on algorithmic technical interview for many years.
4

Dec 31, 2017

Great book and really worth to go through even if you are not preparing for interviews ;)

Best Books from your Favorite Authors & Publishers

compare-icon compare-icon
Thousands of books

Take your time and choose the perfect book.

review-icon review-icon
Read Reviews

Read ratings and reviews to make sure you are on the right path.

vendor-icon vendor-icon
Multiple Stores

Check price from multiple stores for a better shopping experience.

gift-icon

Enjoy Result