logo资料库

Cracking the Coding Interview (6th): 189 Programming Questions and Solutions.pdf

第1页 / 共708页
第2页 / 共708页
第3页 / 共708页
第4页 / 共708页
第5页 / 共708页
第6页 / 共708页
第7页 / 共708页
第8页 / 共708页
资料共708页,剩余部分请下载后查看
Cover
Introduction
Table of Contents
Foreword
I. The Interview Process
II. Behind the Scenes
III. Special Situations
IV. Before the Interview
V. Behavioral Questions
VI. Big O
VII. Technical Questions
VIII. The Offer and Beyond
IX. Interview Questions
1. Arrays and Strings
2. Linked Lists
3. Stacks and Queues
4. Trees and Graphs
5. Bit Manipulation
6. Math and Logic Puzzles
7. Object-Oriented Design
8. Recursion and Dynamic Programming
9. System Design and Scalability
10. Sorting and Searching
11. Testing
12. C and C++
13. Java
14. Databases
15. Threads and Locks
16. Moderate
17. Hard
X. Solutions
1. Solutions to Arrays and Strings
2. Solutions to Linked Lists
3. Solutions to Stacks and Queues
4. Solutions to Trees and Graphs
5. Solutions to Bit Manipulation
6. Solutions to Math and Logic Puzzles
7. Solutions to Object-Oriented Design
8. Solutions to Recursion and Dynamic Programming
9. Solutions to System Design and Scalability
10. Solutions to Sorting and Searching
11. Solutions to Testing
12. Solutions to C and C++
13. Solutions to Java
14. Solution to Databases
15. Solutions to Threads and Locks
16. Solutions to Moderate
17. Solutions to Hard
XI. Advanced Topics
XII. Code Library
XIII. Hints
I. Hints for Data Structures
II. Hints for Concepts and Algorithms
III. Hints for Knowledge-Based Questions
IV. Hints for Additional Review Problems
XIV. About the Author
CRACKING ��the� �· CODING INTERVIEW 189 PROGRAMMING Q!JESTIONS & SOLUTIONS
CRACKING the CODING INTERVIEW 6TH EDITION
ALso BY GAYLE LAAKMANN McDowELL (RACKING THE PM INTERVIEW How TO LAND A PRODUCT MANAGER JoB IN TECHNOLOGY CRACKING THE TECH CAREER INSIDER ADVICE ON LANDING A JOB AT GOOGLE, MICROSOFT, APPLE, OR ANY TOP TECH COMPANY
CRACKING the CODING INTERVIEW 6th Edition 189 Programming Questions and Solutions GAYLE LAAKMANN MCDOWELL Founder and CEO, CareerCup.com CareerCup, LLC Palo Alto, CA
CRACKING THE CODING INTERVIEW, SIXTH EDITION Copyright © 2015 by CareerCup. reserved. All rights chanical from the author or publisher, except means, including No part of this book may be reproduced in any form by any electronic or me­ information storage and retrieval systems, without permission in writing by a reviewer who may quote brief passages in a review. Published by CareerCup, LLC, Palo Alto, CA. Compiled Feb 10, 2016. For more information, contact support@careercup.com. 978-0-9847828-5-7 (ISBN 13)
For Davis and Tobin, and all the things that bring us joy in life.
Introduction Introduction .. . . . . . . . . . . . . . . . . . . . . . . . . . . • · • . • · · • • · · • · · · · · · · · · · · · · · · · · 2 I. The Interview Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . · . . · · . · · · · · · · · · 4 Why? .... · .................................................... ····· 4 How Questions are Selected .............................................. 6 It's All Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Frequently Asked Questions .............................................. 7 II. Behind the Scenes .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • . . . . . 8 The Microsof t Interview ................ ................................. 9 The Amazon Interview ............... , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 The Google Interview ................................................. 10 The Apple Interview .................................................. 11 The Face book Interview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 The Palantir Interview .................................................. 13 Ill. Special Situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Experienced Candidates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Testers and SDETs .................................................... 15 Product (and Program) Management ....................................... 16 Dev Lead and Managers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Startups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Acquisitions and Acquihires ............................................. 19 For Interviewers ..................................................... 21 IV. Before the Interview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Getting the Right Experience ............................................. 26 Writing a Great Resume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Preparation Map ..................................................... 30 V. Behavioral Questions . . . . .. . . . . . . . . . . • . . . . . . . . . . . . . . . • . . . • . . . • . . . . . 32 Interview Preparation Grid .............................................. 32 KnowYourTechnical Projects ............................................. 33 Responding to Behavioral Questions ........................................ 34 So, tell me about yourself... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 VI. BigO ......................................................... 38 An Analogy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Time Complexity ..................................................... 38 Space Complexity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Drop the Constants ................................................... 41 Drop the Non-Dominant Terms ........................................... 42 VI Cracking the Coding Interview, 6th Edition
Introduction ..................................... ............ .......... · . . . . . . . . . Add vs. Multiply Algorithms: Time ...................... Multi-Part Amortized Log N Runtimes Recursive Runtimes Examples and Exercises .................... ............... ........................... .................. ........................ ......................... ....................... . 42 43 44 44 45 VII. Technical Questions. . . . . . . . . . . . . . . . . . . . . . . 60 . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .............. .............. (Do It Yourself) .............................. & Solve Technique & Solve Technique & Solve Technique & Solve Technique & Solve Technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #1: Look for BUD #2: DIY #3: Simplify #4: Base #5: Data (BCR) ................................ How to Prepare What You Need To Know. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Walking Through a Problem Optimize Optimize Optimize Optimize Optimize Best Conceivable Handling Incorrect When You've The "Perfect" What Good Coding Looks Like . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Don't Give Up! .................... 60 60 62 ...... 67 69 71 71 72 ........... 72 76 76 76 77 81 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Heard a Question Language .................................. Case and Build Structure ................... and Generalize ........... ................ ........... for Interview Brainstorm Answers Runtime Before. VIII. The Offer and Beyond . . . . . . . . . . . . . . . . . . . . . . . 82 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 and Rejection Handling Offers the Offer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Evaluating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Negotiation On the Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 84 85 IX.Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hash Tables ............................. ................. ............. ArrayList & Resizable Arrays ........................ ........................ StringBuilder .......................................................... Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a Linked List ...................................... .............. 92 Deleting a Node from a Singly Linked List ....................................... The "Runner"Technique ................... ................ ............... Recursive Problems ...................................................... 93 CrackingTheCodinglnterview.com \ 6th Edition VII Data Structures 1 I Arrays Chapter Chapter 2 I Linked Creating 87 88 88 88 89 89 92 93 93
分享到:
收藏