I am not a recruiter. I am a software engineer. And as such, I know what it's like to be asked to whip up brilliant algorithms on the spot and then write flawless code on a whiteboard. I've been through this as a candidate and as an interviewer.
Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hundreds of software engineers. The result is this book.
Learn how to uncover the hints and hidden details in a question, discover how to break down a problem into manageable chunks, develop techniques to unstick yourself when stuck, learn (or re-learn) core computer science concepts, and practice on 189 interview questions and solutions.
These interview questions are real; they are not pulled out of computer science textbooks. They reflect what's truly being asked at the top companies, so that you can be as prepared as possible. WHAT'S INSIDE? • 189 programming interview questions, ranging from the basics to the trickiest algorithm problems. • A walk-through of how to derive each solution, so that you can learn how to get there yourself. • Hints on how to solve each of the 189 questions, just like what you would get in a real interview. • Five proven strategies to tackle algorithm questions, so that you can solve questions you haven't seen. • Extensive coverage of essential topics, such as big O time, data structures, and core algorithms. • A behind the scenes look at how top companies like Google and Facebook hire developers. • Techniques to prepare for and ace the soft side of the interview: behavioral questions. • For interviewers and companies: details on what makes a good interview question and hiring process.
Gayle Laakmann McDowell is the founder / CEO of CareerCup, and the author of Cracking the PM Interview, Cracking the Coding Interview, and Cracking the Tech Career.
Gayle has worked for Microsoft, Apple and Google as a software engineer. She holds a bachelor's and master's degree from the University of Pennsylvania in Computer Science, and an MBA from the Wharton School. She currently resides in Palo Alto, CA.
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.
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.
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.
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.
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 :-)
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.
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.
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.
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
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
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.
I can not say it is a bad book. But I think, long analysis of solutions makes solution harder (when it is not), which is in this case. Sometimes I was writing solution by myself and understanding how it works, but looking solution in the book and needed time to figure out what it was saying. It is my position. Someone may find it really helpful this solutions. But also in many cases my written code was better (readable) than in the book. My suggestion is do not read this book in one go. It is too much
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!)
Even though "Cracking the Coding Interview" looks voluminous, it is read fast due to more than 50% of pages are devoted to solutions. Author tries to generalize the interview process of a developer, although there are several companies and so various processes to hire a programmer. Her advice is realistic and logical; discussed technical topics are indeed relevant (and hard to implement in interview). She summarized almost all subjects that computer scientist studies as an undergraduate such as Algorithms, Data Structures and Database. Moreover, the book could be used as a guideline to prepare yourself to an interview or to test yourself in solving some questions and check their solutions. As a software engineer student, I highly recommend to read this book at least one year before graduation and solve exercises and understand main logic.
This book has some decent information about how to walk through problems, think about Big O time complexity, and prepare for interviews from months out, weeks out, and days out. However, I think that LeetCode has better problems and a better environment to practice in. My recommendation would be to read the beginning chapters first, and then switch to LeetCode when you're ready to start doing problems.
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.
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.
Great book for preparing for the coding interview. Explains how a typical interview goes in big corporations like Google, Amazon, etc. Gives you concrete steps to prepare yourself for all interview stages. And the most important part, which takes ~70% of the book, problems with detailed solutions. Prepare to spend most of your time not reading the book, but solving problems.
- Realistic, easy to read for people majoring in Computer Science and preparing for job interviews - Good sample questions for whiteboarding interview (currently doing some exercises in the books, but other sources such as leetcode, hackerrank are also great) - Lack some example of non-whiteboarding inrterview (small + middle companies)
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.
This is a pretty good book for the time. But today, the interview preparation process is simpler and more streamlined. Just go practice problems on LeetCode. Also, Java was the language then, but I think it has now been superseded by Python.