Index M matrixes 101, 102, 163, 169, 184, 293, 295 maximize <strong>and</strong> minimize 125, 148, 273, 293, 295, 298 O object oriented design 113, 115, 118, 120, 124, 151, 152, 154, 156, 157, 159, 161, 163, 166, 167, 175, 189, 192, 199, 200, 217, 218, 221, 225, 259, 261, 266, 270, 288, 298 P probability <strong>and</strong> r<strong>and</strong>omness 187, 188, 277, 281, 282 Q queues 113, 120, 152, 155, 195, 196, 291 R recursion 106, 108, 113, 116, 118, 123, 125, 128, 130, 131, 141, 142, 146, 169, 170, 173, 174, 175, 176, 177, 223, 275, 279, 283, 295, 298 S searching 148, 181, 183, 184, 285 sortings 99, 121, 159, 179, 180, 181, 182, 185, 278, 286, 287 stacks 111, 113, 115, 118, 120, 121, 124 strings 95, 96, 97, 99, 100, 103, 134, 173, 174, 180, 183, 271, 275, 287, 288 T testing 97, 98, 209, 210, 211, 214 threading 219, 226, 242, 257, 258, 259, 262, 264 trees 123, 125, 126, 127, 128, 130, 131, 166, 208, 216, 286, 288, 290, 298 CareerCup.com 3 0 2
Mock <strong>Interview</strong>s Mock <strong>Interview</strong>s Studying helps, but nothing can prepare you like <strong>the</strong> real thing. Each CareerCup interviewer has given over a hundred interviews at Google, Microsoft, or Amazon. To nail your interview, sit down with a trained interviewer <strong>and</strong> get <strong>the</strong>ir experienced feedback. See www.careercup.com/interview for more details. One Hour <strong>Interview</strong> with Real <strong>Interview</strong>ers Our interviewers will give you a real interview, just like you'd get at Google, Microsoft or Amazon. We'll test you on <strong>the</strong> same types of questions that <strong>the</strong>y do. We'll grade you <strong>the</strong> same way <strong>the</strong>y do. How can we do this? We’ve done over 100 interviews each for <strong>the</strong>se companies. We’ve screened resumes. We’ve been part of <strong>the</strong>ir hiring committees. We know what <strong>the</strong>y want. We'll Also Give You... »» An .mp3 recording of your interview. »» Feedback on where you shined <strong>and</strong> where you struggled. »» Specific suggestions on how to improve. »» Instructions on how to approach tough problems »» Lessons on what interviewers look for in your code. Schedule Your <strong>Interview</strong> Today! See www.careercup.com/interview for pricing <strong>and</strong> details. Check out our special student rates! 3 0 3 <strong>Cracking</strong> <strong>the</strong> <strong>Coding</strong> <strong>Interview</strong>
- Page 1 and 2:
CRACKING THE FOURTH EDITION C O D I
- Page 3 and 4:
Table of Contents Chapter 7 | Objec
- Page 5 and 6:
Introduction Something’s Wrong We
- Page 7 and 8:
Behind the Scenes For many candidat
- Page 9 and 10:
Behind the Scenes | The Amazon Inte
- Page 11 and 12:
Behind the Scenes | The Apple Inter
- Page 13 and 14:
Interview War Stories The View from
- Page 15 and 16:
Interview War Stories | Pop Divas P
- Page 17 and 18:
Interview War Stories | You Can (Ma
- Page 19 and 20:
Interview War Stories | Spider Sens
- Page 21 and 22:
Before the Interview | Resume Advic
- Page 23 and 24:
Before the Interview | Behavioral P
- Page 25 and 26:
Before the Interview | Technical Pr
- Page 27 and 28:
The Interview and Beyond
- Page 29 and 30:
At the Interview | Handling Behavio
- Page 31 and 32:
At the Interview | Handling Technic
- Page 33 and 34:
At the Interview | Five Algorithm A
- Page 35 and 36:
At the Interview | Five Algorithm A
- Page 37 and 38:
At the Interview | The Offer and Be
- Page 39 and 40:
At the Interview | Top Ten Mistakes
- Page 41 and 42:
At the Interview | Frequently Asked
- Page 43 and 44:
Interview Questions
- Page 45 and 46:
Chapter 1 | Arrays and Strings Hash
- Page 47 and 48:
Chapter 2 | Linked Lists How to App
- Page 49 and 50:
Chapter 3 | Stacks and Queues How t
- Page 51 and 52:
Chapter 4 | Trees and Graphs How to
- Page 53 and 54:
Part 2 Concepts and Algorithms
- Page 55 and 56:
Chapter 5 | Bit Manipulation 5.1 Yo
- Page 57 and 58:
Chapter 6 | Brain Teasers 6.1 Add a
- Page 59 and 60:
Chapter 7 | Object Oriented Design
- Page 61 and 62:
Chapter 8 | Recursion 8.1 Write a m
- Page 63 and 64:
Chapter 9 | Sorting and Searching 9
- Page 65 and 66:
Chapter 10 | Mathematical 10.1 You
- Page 67 and 68:
Chapter 11 | Testing 11.1 Find the
- Page 69 and 70:
Chapter 12 | System Design and Memo
- Page 71 and 72:
Chapter 13 | C++ How To Approach: A
- Page 73 and 74:
Chapter 14 | Java How to Approach:
- Page 75 and 76:
Chapter 15 | Databases How to Appro
- Page 77 and 78:
Chapter 16 | Low Level How to Appro
- Page 79 and 80:
Chapter 17 | Networking How to Appr
- Page 81 and 82:
Chapter 18 | Threads and Locks How
- Page 83 and 84:
Part 4 Additional Review Problems
- Page 85 and 86:
Chapter 19 | Moderate _____________
- Page 87 and 88:
Chapter 20 | Hard Input: DAMP, LIKE
- Page 89 and 90:
Solutions
- Page 91 and 92:
Solutions to Chapter 1 | Arrays and
- Page 93 and 94:
Solutions to Chapter 1 | Arrays and
- Page 95 and 96:
Solutions to Chapter 1 | Arrays and
- Page 97 and 98:
Solutions to Chapter 1 | Arrays and
- Page 99 and 100:
Solutions to Chapter 2 | Linked Lis
- Page 101 and 102:
Solutions to Chapter 2 | Linked Lis
- Page 103 and 104:
Solutions to Chapter 2 | Linked Lis
- Page 105 and 106:
Solutions to Chapter 3 | Stacks and
- Page 107 and 108:
Solutions to Chapter 3 | Stacks and
- Page 109 and 110:
Solutions to Chapter 3 | Stacks and
- Page 111 and 112:
Solutions to Chapter 3 | Stacks and
- Page 113 and 114:
Solutions to Chapter 3 | Stacks and
- Page 115 and 116:
Solutions to Chapter 3 | Stacks and
- Page 117 and 118:
Solutions to Chapter 4 | Trees and
- Page 119 and 120:
Solutions to Chapter 4 | Trees and
- Page 121 and 122:
Solutions to Chapter 4 | Trees and
- Page 123 and 124:
Solutions to Chapter 4 | Trees and
- Page 125 and 126:
Solutions to Chapter 4 | Trees and
- Page 127 and 128:
Solutions to Chapter 5 | Bit Manipu
- Page 129 and 130:
Solutions to Chapter 5 | Bit Manipu
- Page 131 and 132:
Solutions to Chapter 5 | Bit Manipu
- Page 133 and 134:
Solutions to Chapter 5 | Bit Manipu
- Page 135 and 136:
Solutions to Chapter 5 | Bit Manipu
- Page 137 and 138:
Solutions to Chapter 6 | Brain Teas
- Page 139 and 140:
Solutions to Chapter 6 | Brain Teas
- Page 141 and 142:
Solutions to Chapter 6 | Brain Teas
- Page 143 and 144:
Solutions to Chapter 7 | Object Ori
- Page 145 and 146:
Solutions to Chapter 7 | Object Ori
- Page 147 and 148:
Solutions to Chapter 7 | Object Ori
- Page 149 and 150:
Solutions to Chapter 7 | Object Ori
- Page 151 and 152:
Solutions to Chapter 7 | Object Ori
- Page 153 and 154:
Solutions to Chapter 7 | Object Ori
- Page 155 and 156:
Solutions to Chapter 7 | Object Ori
- Page 157 and 158:
Solutions to Chapter 7 | Object Ori
- Page 159 and 160:
Solutions to Chapter 7 | Object Ori
- Page 161 and 162:
Solutions to Chapter 8 | Recursion
- Page 163 and 164:
Solutions to Chapter 8 | Recursion
- Page 165 and 166:
Solutions to Chapter 8 | Recursion
- Page 167 and 168:
Solutions to Chapter 8 | Recursion
- Page 169 and 170:
Solutions to Chapter 8 | Recursion
- Page 171 and 172:
Solutions to Chapter 9 | Sorting an
- Page 173 and 174:
Solutions to Chapter 9 | Sorting an
- Page 175 and 176:
Solutions to Chapter 9 | Sorting an
- Page 177 and 178:
Solutions to Chapter 9 | Sorting an
- Page 179 and 180:
Solutions to Chapter 10 | Mathemati
- Page 181 and 182:
Solutions to Chapter 10 | Mathemati
- Page 183 and 184:
Solutions to Chapter 10 | Mathemati
- Page 185 and 186:
Solutions to Chapter 10 | Mathemati
- Page 187 and 188:
Solutions to Chapter 10 | Mathemati
- Page 189 and 190:
Solutions to Chapter 11 | System De
- Page 191 and 192:
Solutions to Chapter 11 | System De
- Page 193 and 194:
Solutions to Chapter 11 | System De
- Page 195 and 196:
Solutions to Chapter 11 | System De
- Page 197 and 198:
Solutions to Chapter 11 | System De
- Page 199 and 200:
Solutions to Chapter 11 | System De
- Page 201 and 202:
Solutions to Chapter 12 | Testing 1
- Page 203 and 204:
Solutions to Chapter 12 | Testing 1
- Page 205 and 206:
Solutions to Chapter 12 | Testing 1
- Page 207 and 208:
Solutions to Chapter 13 | C++ 13.2
- Page 209 and 210:
Solutions to Chapter 13 | C++ 13.4
- Page 211 and 212:
Solutions to Chapter 13 | C++ 13.6
- Page 213 and 214:
Solutions to Chapter 13 | C++ Then
- Page 215 and 216:
Solutions to Chapter 13 | C++ 13.9
- Page 217 and 218:
Solutions to Chapter 14 | Java 14.2
- Page 219 and 220:
Solutions to Chapter 14 | Java 14.4
- Page 221 and 222:
Solutions to Chapter 14 | Java 14.6
- Page 223 and 224:
Solutions to Chapter 15 | Databases
- Page 225 and 226:
Solutions to Chapter 15 | Databases
- Page 227 and 228:
Solutions to Chapter 15 | Databases
- Page 229 and 230:
Solutions to Chapter 16 | Low Level
- Page 231 and 232:
Solutions to Chapter 16 | Low Level
- Page 233 and 234:
Solutions to Chapter 16 | Low Level
- Page 235 and 236:
Solutions to Chapter 16 | Low Level
- Page 237 and 238:
Solutions to Chapter 16 | Low Level
- Page 239 and 240:
Solutions to Chapter 16 | Low Level
- Page 241 and 242: Solutions to Chapter 17 | Networkin
- Page 243 and 244: Solutions to Chapter 17 | Networkin
- Page 245 and 246: Solutions to Chapter 17 | Networkin
- Page 247 and 248: Solutions to Chapter 17 | Networkin
- Page 249 and 250: Solutions to Chapter 18 | Threads a
- Page 251 and 252: Solutions to Chapter 18 | Threads a
- Page 253 and 254: Solutions to Chapter 18 | Threads a
- Page 255 and 256: Solutions to Chapter 18 | Threads a
- Page 257 and 258: Solutions to Chapter 19 | Moderate
- Page 259 and 260: Solutions to Chapter 19 | Moderate
- Page 261 and 262: Solutions to Chapter 19 | Moderate
- Page 263 and 264: Solutions to Chapter 19 | Moderate
- Page 265 and 266: Solutions to Chapter 19 | Moderate
- Page 267 and 268: Solutions to Chapter 19 | Moderate
- Page 269 and 270: Solutions to Chapter 19 | Moderate
- Page 271 and 272: Solutions to Chapter 20 | Hard 2. O
- Page 273 and 274: Solutions to Chapter 20 | Hard 20.3
- Page 275 and 276: Solutions to Chapter 20 | Hard 10 1
- Page 277 and 278: Solutions to Chapter 20 | Hard 20.6
- Page 279 and 280: Solutions to Chapter 20 | Hard 20.8
- Page 281 and 282: Solutions to Chapter 20 | Hard 20.9
- Page 283 and 284: Solutions to Chapter 20 | Hard 28 i
- Page 285 and 286: Solutions to Chapter 20 | Hard 23 }
- Page 287 and 288: Solutions to Chapter 20 | Hard Val_
- Page 289 and 290: Solutions to Chapter 20 | Hard 20.1
- Page 291: Index A arithmetic 108, 131, 143, 1