Refurbished favorites for less
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
Buy new:
-63% $14.68
FREE delivery Monday, December 8 on orders shipped by Amazon over $35
Ships from: Amazon
Sold by: SophoclesCorner
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Something went wrong. Please try your request again later.

Cracking the Coding Interview: 150 Programming Questions and Solutions 5th Revised & enlarged Edition


{"desktop_buybox_group_1":[{"displayPrice":"$14.68","priceAmount":14.68,"currencySymbol":"$","integerValue":"14","decimalSeparator":".","fractionalValue":"68","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"JEL%2BLw8NB%2F2%2FRnRN%2B%2BxMPchEBzuR5nlCWdAEZbOfYSzKLGnfpozaxTUI8agDn37oV%2BWw0okpEJbKmUlLcW7oYO2ANl0s%2Ba6njfwXioPxgrfW%2FvHDbuNP20FkRpgYAS6RuNxvmpeaXI69lzHuQl%2FfJ%2F48lzMGLaAG1Qorz0Izp4RVVvigJ%2BJK5RxLgacUh%2BNl","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"$1.92","priceAmount":1.92,"currencySymbol":"$","integerValue":"1","decimalSeparator":".","fractionalValue":"92","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"JEL%2BLw8NB%2F2%2FRnRN%2B%2BxMPchEBzuR5nlCHu9uNZuyiHjWFpWu66i839d9mkRTItxEauYfF4x5mm1jRuTCjxnkhsHATdoJgycACzFP6LvnIexSfpY0yUo7Iw20U6LznoVme4Iuiit61QoSSGN2C5%2F3j3kNTwnP5hshkTMYxEmBfmq6a9yCQbkrVyIU%2FH1zSlA9","locale":"en-US","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}

Purchase options and add-ons

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 ProcessThis 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 ScenesLearn 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 SituationsThis 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 InterviewIn 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 PreparationAlthough 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 AnswersThis 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.

    There is a newer edition of this item:

    Books with Buzz
    Discover the latest buzz-worthy books, from mysteries and romance to humor and nonfiction. Explore more

    Frequently bought together

    This item: Cracking the Coding Interview: 150 Programming Questions and Solutions
    $14.68
    Get it as soon as Monday, Dec 8
    Only 1 left in stock - order soon.
    Sold by SophoclesCorner and ships from Amazon Fulfillment.
    +
    $15.83
    Get it as soon as Sunday, Dec 7
    In Stock
    Ships from and sold by Amazon.com.
    +
    $39.99
    Get it as soon as Sunday, Dec 7
    In Stock
    Ships from and sold by Amazon.com.
    Total price: $00
    To see our price, add these items to your cart.
    Details
    Added to Cart
    Some of these items ship sooner than the others.
    Choose items to buy together.

    Customers also bought or read

    Loading...

    Editorial Reviews

    From the Author

    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 know because I've been asked to do the same thing--in interviews at Google, Microsoft, Apple, and Amazon, among other companies.

    I also know because I've been on the other side of the table, asking candidates to do this. I've combed through stacks of resumes to find the engineers who I thought might be able to actually pass these interviews. And I've debated in Google's Hiring Committee whether or not a candidate did well enough to merit an offer. I understand and have experienced the full hiring circle.

    And you, reader, are probably preparing for an interview, perhaps tomorrow, next week, or next year. You likely have or are working towards a Computer Science or related degree. I am not here to re-teach you the basics of what a binary search tree is, or how to traverse a linked list. You already know such things, and if not, there are plenty of other resources to learn them.

    This book is here to help you take your understanding of Computer Science fundamentals to the next level, to help you apply those fundamentals to crack the coding interview. Because while the fundamentals are necessary to land one of the top jobs, they aren't always enough. For countless readers, this book has been just what they needed. 

    About the Author

    Gayle Laakmann McDowell is the founder / CEO of CareerCup.com and the author of The Google Resume: How to Prepare for a Career and Land a Job at Apple, Microsoft, Google, or any Top Tech Company.
    Work ExperienceHer interviewing expertise comes from vast experience on both sides of the desk. She has completed Software Engineering interviews with - and received offers from - Microsoft, Google, Amazon, Apple, IBM, Goldman Sachs, Capital IQ, and a number of other firms.

    Of these top companies, she has worked for Microsoft, Apple and Google, where she gained deep insight into each company's hiring practices. 

    Most recently, Gayle spent three years at Google as a Software Engineer and was one of the company's lead interviewers. She interviewed over 120 candidates in the U.S. and abroad, and, as a software engineer, led much of the recruiting for her alma mater, the University of Pennsylvania.

    Additionally, she served on Google's Hiring Committee, where she reviewed each candidate's feedback and made hire / no-hire decisions. She assessed over 700 candidates in that role, and evaluated hundreds more resumes.

    Education
    Gayle holds a bachelor's and master's degree in Computer Science from the University of Pennsylvania and MBA from The Wharton School.

    Product details

    About the author

    Follow authors to get new release updates, plus improved recommendations.
    Gayle Laakmann McDowell
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Gayle Laakmann McDowell is an author, consultant, and founder focusing on improving tech hiring for both the interviewer and the candidate.

    Gayle has worked as an engineer for Google, Microsoft, and Apple. Most recently, at Google, she served on the hiring committee where she interviewed hundreds of candidates and evaluated thousands more. It was here that she discovered the disconnect between candidates, their skill set, and their interview performance.

    Though her company, CareerCup, Gayle has worked with many of the top tech companies to reform their hiring practices and implement interviewer training programs.

    She is the author and creator the best-selling Cracking the Interview & Career series: Cracking the Coding Interview, Cracking the PM Interview (co-authored with Jackie Bavaro), Cracking the PM Career (co-authored with Jackie Bavaro), and Cracking the Tech Career

    Gayle holds a bachelor's and master's in Computer Science from the University of Pennsylvania and an MBA from the Wharton School of Business.

    She currently consults, writes, and codes from her home in Palo Alto, California. She can be found online at gayle.com, twitter (@gayle), and facebook (@gayle).

    Customer reviews

    4.5 out of 5 stars
    741 global ratings

    Customers say

    Customers find the book excellent for technical interview preparation, providing comprehensive coverage of data structures and offering tricky and relevant practice problems. Moreover, the book is easy to understand, serves as a great study guide, and helps build programming concepts. Additionally, customers appreciate its value for money and consider it a worthwhile investment for the long run.

    127 customers mention "Use"121 positive6 negative

    Customers find the book very useful for brushing up their programming skills and preparing for technical interviews, providing excellent practice problems.

    "Very useful and effective way for finding out the interview questions which many developers have not focused on, the book is written by a very..." Read more

    "The book is very good and very helpful - recommend absolutely to everyone, who wants to apply for another technical-programming job, and the..." Read more

    "This book is very nice and useful. I strongly recommend that all the students in computer science should read it before getting a job." Read more

    "Super helpful. I wish she'd write about how to deal with the issues of being a woman in Computer Science, though." Read more

    124 customers mention "Interview preparation"122 positive2 negative

    Customers find the book excellent for interview preparation, describing it as a must-have for technical interviews and a crucial tool for interview preparation.

    "Cracking the Coding Interview is an excellent book if you are looking to brush up on your CS knowledge...." Read more

    "Fantastic book that helped me prepare for interviews. After just reading this book, I was pretty much good to go." Read more

    "...visualize trees, linked lists and all that and be in a great shape for technical interviews & interview with all major tech firms, landing a job at..." Read more

    "Good preparation for interview. Pretty comprehensive. You don't expect to see the same problem popping up of course but still worth reading...." Read more

    102 customers mention "Practice questions"90 positive12 negative

    Customers appreciate the practice questions in the book, which help build programming concepts, with one customer noting that the comprehensive solutions in the back are particularly helpful.

    "Good collection of ideas. But, some of the solutions ... well - the author's lack of hands one experience is evident...." Read more

    "...this book ("Cracking the Coding Interview") because its great topic coverage is coupled with great exercises and detailed, in-depth solutions." Read more

    "To the point. good practice before the real technical interviews. more questions can be included. overall it is a real good book." Read more

    "...Excellent examples focusing on algorithms, design patterns, SQL queries, and performance patterns - C++ and Java." Read more

    81 customers mention "Interview prep"81 positive0 negative

    Customers find this book to be an excellent resource for technical interviews, serving as a great study guide that helps candidates practice their software interview skills.

    "Simply well written and to the point. A great resource that will increase your chances of not only landing a job with Google, Microsoft, Amazon, but..." Read more

    "...The sample questions and code have been a great refresher and the intro into the different company politics and interview processes has really taken..." Read more

    "Excellent resource, and easy to understand" Read more

    "This is a very comprehensive book targeting specifically on succeeding in coding interviews...." Read more

    54 customers mention "Information quality"51 positive3 negative

    Customers find the book informative, explaining concepts in depth and covering the basics of data structures, making it a great reference.

    "...because its great topic coverage is coupled with great exercises and detailed, in-depth solutions." Read more

    "printed on really thin paper and feels cheap, but the information is invaluable for those wanting to learn something useful.there is nothing special..." Read more

    "Good reference." Read more

    "I haven't read it all, but what I have read is full of great information. Definitely a useful tool for anyone wanting z programming job!" Read more

    33 customers mention "Problem solving"30 positive3 negative

    Customers appreciate the book's problem-solving approach, noting that the questions are tricky and relevant, with one customer mentioning it helped them secure a job.

    "insigthful . Very good tips . Good problems and solutions ." Read more

    "Fun read. Interesting problems to solve. Worth a read for all computer science majors, not just for interviews." Read more

    "...Good book, covers many problems which fall into typical Silicon Valley culture companies interviews." Read more

    "Pretty good book. Well written and good choice of problems. If you are planning on attending a interview, this wont be a bad buy at all." Read more

    31 customers mention "Readability"28 positive3 negative

    Customers find the book easy to read and follow, with language that is clear and easy to understand.

    "It is an interesting book who is looking for a guide to get tips in interview...." Read more

    "Easy to read and has all the material needed for the test!" Read more

    "...A must read book!!!" Read more

    "Fantastic read!! As someone just starting out in the field, I feel like the knowledge is endless!! This is a must for every developer to carry around." Read more

    23 customers mention "Value for money"20 positive3 negative

    Customers find the book worth the money and consider it a great investment for the long run.

    "...I would definitely recommend this book. It is completely worth the money I paid for it. I just wish there was a Kindle version I could have bought." Read more

    "...Overall, it's reasonable price." Read more

    "This will be your best investment..." Read more

    "...I recommend it whole-heartedly; a keeper for sure. Easily worth the price of admission!" Read more

    Top reviews from the United States

    • Reviewed in the United States on December 11, 2014
      Format: PaperbackVerified Purchase
      If you are thinking about starting prep for interviews and dont know where to start, buy this book. I was working for some years at a company and out of touch with algorithms. Then when I wanted to give interviews I bought this book first thing. This books certainly covers the questions you need to know but assumes you know the concepts. This is where I was stuck so I stopped halfway and started on Skiena's youtube lectures his "The Algorithm Design Manual" book. Once I was done with the book I came back and completed this. The problems and solutions made more sense that way. I did not have time to complete the medium and hard problems in the end and some problems/chapters might not be relevant for all interviews so you could skip them. Also some solutions are not the best/easy to follow. So compare the solution with that given in other great resources mentioned below.

      Here is my suggestion for prep:
      1. Start with Skiena's lectures on youtube or "The Algorithm Design Manual" book. Even if you dont have time for war stories or the questions in the second half of the book, that's fine. You should know the contents in the first half of the book.
      2. Continue with this book. Feel free to skip some questions and come back later.
      3. Further you may read "Elements of Programming Interviews". It is not the easiest to start with but once you are familiar with the concepts from 1 and 2 this is great reference. Some problems might be repetitive but they have a concise way of implementing the solutions.

      Work out problems from geeksforgeeks.com and leetcode.com There are a whole variety of problems not even discussed in the above resources which are solved there. Dont refer to careercup website for solutions, they are just some random thoughts and people showing off their coding skills.

      Apart from that you should be strong in your language of choice and know its concepts. All this takes time so dont rush. Give yourself 2-3 months to familiarize and read the concepts and algorithms. Then read the above books again and again. All successful people did lot of hard work behind the scenes. They got into top companies since they put the hard work not because they got some free pass because they studied in top tier school. And that is the reason Gayle wrote this book, so with hard work and luck anyone can aim high. I thank her for that.

      Side note. I was never asked a question directly from this book in most interviews. What they usually ask is some flavor of questions in this book. That's why you need to know the concepts rather than memorizing the solution. This book gave me the confidence to tackle similar questions and covered a wide breadth of questions so I didn't have to wonder what to study. All the best.
      10 people found this helpful
      Report
    • Reviewed in the United States on March 20, 2016
      Format: PaperbackVerified Purchase
      Does it have everything I need to know before my interview?
      No

      Should I still buy it?
      Yes! Most definitely yes!

      This book has excellent tips and tricks to solve a specific set of problems that are pretty common during an interview especially when you are looking for a technical job right out of school. If this book teaches you absolutely nothing, it still gives you a sense of confidence in knowing and identifying patterns in questions and teaches you ways to think about them under a time constraint.
      Every software engineer knows that it's one thing to excel at school and at work and a whole other challenge to think of a solution and code it under a 30 minute time constraint. Even if you are the best programmer in the world, interviews can be difficult due to their (sometimes irrational) methods of judging a candidate in a short amount of time.

      What is it good at?
      This book is excellent at giving you a little bit of everything without overwhelming you with too much information. It contains ~10 questions for every major topic (Binary trees, Graphs, Recursion, Dynamic Programming, OOP) and walks you through the solutions briefly. It's not a very difficult read and doesn't have a very textbooky feel to it which makes it easy to skim through before an interview.

      What is it not?
      Like I said earlier, it is NOT an all encompassing book which is by any means ENOUGH before say a Google interview. Yes some companies have slightly easier(to be read as different) interviewing processes which may deem this book as sufficient material, but a lot of the major companies require more preparation than just this one book. This book does NOT teach you the fundamentals. It is not a textbook and does not go through different types of algorithms and data structures from a theoretical point of view. It is more of a tips and tricks kind of book rather than a formal way to learn the basics of programming.

      What language does it use?
      Java. It is all Java. Although due to the nature of Java, it is pretty readable by anyone proficient in any programming language. Although I must say that C users might have to make considerable changes to the solution(add loads more code) to make it work since the solution relies on some functionality that C lacks.

      In conclusion, this book is not comprehensive but definitely essential for students. If you are a student looking for your first job, buy this book to get yourself started on the job search. Good luck! :)
      One person found this helpful
      Report

    Top reviews from other countries

    • PAG
      5.0 out of 5 stars Useful to prepare interviews for google and twitter [Grad student]
      Reviewed in France on February 14, 2015
      Format: PaperbackVerified Purchase
      I used this book to prepare my interviews for twitter and google, I helped a lot to guide me through the interview process in those companies. Also I recommend [...] as a reference to any IT interview.

      No matter if you fail or win, the interview process will give you hints to be a better thinker. Basically recruiters want to know how you think, deduce, interact with others, and for sure if you have knowledge about computer science.
    • Placeholder
      5.0 out of 5 stars Awesome book, my recommendation
      Reviewed in India on January 11, 2015
      Format: PaperbackVerified Purchase
      Was it ever your dream to be in one of the top-notch companies India (the likes of Microsoft, Amazon, Adobe etc) & you thought the interview rounds were too hard. Well, the rounds are hard (believe me) only because facing those questions on the spot makes your brain go drifting somewhere else (happened to me..).

      But if you already had a taste of whats going to come, you are prepared, you are confident & you will give it your best shot.

      With a systematic approach even tough goals can be achieved, this book will help you in that systematic approach(from A to Z). Before this book I used to collect all the questions & categorize them in different sections from easy to hard - phew!! it was a painful job - If that work has already been done by someone(very decently), why not use it & build it on top of that!

      My highest recommendations!!
    • Andrea M
      5.0 out of 5 stars Buon libro sui processi di intervista nelle aziende ICT
      Reviewed in Italy on August 10, 2015
      Format: PaperbackVerified Purchase
      Ottimo libro sui processi di assunzione nelle aziende ICT:
      - processo di assunzione, come vestirsi, cosa sapere e come prepararsi
      - differenze tra le maggiori aziende IT, cosa cercano e quali passi seguono
      - principali algoritmi e strutture dati di base da riguardare prima del colloquio
      - domande specifiche su programmazione concorrente, linguaggi di programmazione
      - soluzioni a tutti i quesiti proposti in coda al libro
      Niente di nuovo per un informatico, ma decisamente utile a rivedere concetti basilari di algoritmi e strutture dati in poco tempo, nonché informarsi sui processi di assunzione nelle maggiori firme del software.
    • Ramón
      5.0 out of 5 stars Problemas muy entretenidos
      Reviewed in Spain on March 20, 2016
      Format: PaperbackVerified Purchase
      Soy un desarrollador al que le encanta resolver problemas, y está siendo muy ameno y entretenido.
      Es mejor que cualquier juego casual que puedas tener en el móvil.
      Fantástico!
    • Art
      5.0 out of 5 stars Helped me to get an offer :)
      Reviewed in Germany on June 13, 2015
      Format: PaperbackVerified Purchase
      My experience with this book is following:

      - Used that book to prepare for a tech interview at a very big company known for their tough interview process.
      - Prepared using the internet and of course this book for about two months.
      - Received an offer from that company afterwards :)

      Hence, can only recommend it :)