ebook img

Cracking the coding interview PDF

510 Pages·2013·50.05 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Cracking the coding interview

CRACKING THE CODING INTERVIEW 150 Programming Questions and Solutions Gayle Laakmann McDowell Founder / CEO, CareerCup.com CRACKING THE CODING INTERVIEW 5th Edition ALSO BY GAYLE LAAKMANN MCDOWELL THE GOOGLE RESUME How TO PREPARE FOR A CAREER AND LAND A JOB AT APPLE, MICROSOFT, GOOGLE, OR ANY TOP TECH COMPANY CRACKING THE C O D I NG I N T E R V I EW 5th Edition 150 Programming Questions and Solutions GAYLE LAAKMANN MCDOWELL Founder and CEO, CareerCup.com CareerCup, LLC Palo Alto, CA CRACKING THE CODING INTERVIEW, FIFTH EDITION Copyright © 2008 - 2013 by Gayle Laakmann McDowell. All rights reserved. No part of this book may be reproduced in any form by any electronic or mechanical means, including information storage and retrieval systems, without permission in writing from the author or publisher, except by a reviewer who may quote brief passages in a review. Published by CareerCup, LLC, Palo Alto, CA. Version 5.01390210100131. No part of this book may be used or reproduced in any manner without written per- mission except in the case of brief quotations in critical articles or reviews. For more information, contact [email protected]. 978-0984782802 (ISBN 13) To Pauline "Oma" Venti for her eternal support Table of Contents Foreword 1 Introduction 2 I. The Interview Process 5 Overview 6 How Questions are Selected 7 Timeline and Preparation Map 8 The Evaluation Process 10 Incorrect Answers 11 Dress Code 12 Top 10 Mistakes 13 Frequently Asked Questions 15 II. Behind the Scenes 17 The Microsoft Interview 19 The Amazon Interview 20 The Google Interview 21 The Apple Interview 22 The Facebook Interview 23 The Yahoo! Interview 24 III. Special Situations 25 Experienced Candidates 26 Testers and SDETs 27 Program and Product Managers 28 Dev Leads and Managers 30 Start-Ups 31 IV. Before the Interview 33 Getting the Right Experience 34 Building a Network 35 Writing a Great Resume 37 V. Behavioral Questions 39 Behavioral Preparation 40 Handling Behavioral Questions 43 VI. Technical Questions 45 VI Cracking the Coding Interview Table of Contents Technical Preparation 46 Handling Technical Questions 49 Five Algorithm Approaches 52 What Good Coding Looks Like 56 VII. The Offer and Beyond 61 Handling Offers and Rejection 62 Evaluating the Offer 63 Negotiation 65 On the Job 66 VIII. Interview Questions 67 Data Structures 69 Chapter 1 | Arrays and Strings 71 Chapter 2 | Linked Lists 75 Chapter 3 | Stacks and Queues 79 Chapter 41 Trees and Graphs 83 Concepts and Algorithms 87 Chapter 5 | Bit Manipulation 89 Chapter 6 | Brain Teasers 93 Chapter 7 | Mathematics and Probability 97 Chapters | Object-Oriented Design 103 Chapter 91 Recursion and Dynamic Programming 107 Chapter 10 | Scalability and Memory Limits Ill Chapter 11 | Sorting and Searching 117 Chapter 12 | Testing 123 Knowledge Based 131 Chapter 13 | C and C++ 133 Chapter 14 | Java 141 Chapter 15 | Databases 147 Chapter 16 Threads and Locks 153 Additional Review Problems 161 Chapter 17 | Moderate 163 Chapter 18 Hard .167 CrackingTheCodinglnterview.com VII Table of Contents IX. Solutions 169 Data Structures 171 Chapter 1 | Arrays and Strings 171 Chapter 2 | Linked Lists 183 Chapter 3 Stacks and Queues 201 Chapter 41 Trees and Graphs 219 Concepts and Algorithms 241 Chapter 5 | Bit Manipulation 241 Chapter 6 | Brain Teasers 257 Chapter? | Mathematics and Probability 263 Chapter 81 Object-Oriented Design 279 Chapter 9 | Recursion and Dynamic Programming 315 Chapter 10 | Scalability and Memory Limits 341 Chapter 11 Sorting and Searching 359 Chapter 12 | Testing 377 Knowledge Based 385 Chapter 13 | C and C++ 385 Chapter 14 | Java 399 Chapter 15 | Databases 407 Chapter 16 | Threads and Locks 415 Additional Review Problems 429 Chapter 17 | Moderate 429 Chapter 18 | Hard 461 X. Acknowledgements 491 XI. Index 492 XII. About the Author . 500 Join us at www.CrackingTheCodinglnterview.com to download full, compilable Java / Eclipse solutions, discuss problems from this book with other readers, report issues, view this book's errata, post your resume, and seek additional advice. VIII Cracking the Coding Interview Foreword Dear Reader, Let's get the introductions out of the way. 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. I am here to help you take your understanding of Computer Science fundamentals to the next level, to learn how to apply those fundamentals to crack the coding interview. The 5th edition of Cracking the Coding Interview updates the 4th edition with over 200 pages of additional questions, revised solutions, new chapter introductions, and other content. Be sure to check out our website, www.careercup.com, to connect with other candidates and discover new resources. I'm excited for you and for the skills you are going to develop.Thorough preparation will give you a wide range of technical and communication skills. It will be well-worth it no matter where the effort takes you! I encourage you to read these introductory chapters carefully. They contain important insight that just might make the difference between a "hire"and a "no hire." And remember—interviews are hard! In my years of interviewing at Google, I saw some interviewers ask"easy"questions while others ask harder questions. But you know what? Getting the easy questions doesn't make it any easier to get the offer. Receiving an offer is not about solving questions flawlessly (very few candidates do!), but rather, it is about answering questions better than other candidates. So don't stress out when you get a tricky question—everyone else probably thought it was hard too. Study hard, practice, and good luck! Gayle L. McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview CrackingTheCodinglnterview.com

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.