-
Notifications
You must be signed in to change notification settings - Fork 238
/
search.xml
614 lines (422 loc) · 51 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title><![CDATA[EPI Judge Beta]]></title>
<url>http://elementsofprogramminginterviews.com/2018/01/30/2018-01-30-judge-beta/</url>
<content type="html"><![CDATA[<p>The EPI Judge is now available at <a href="https://github.com/adnanaziz/EPIJudge" target="_blank" rel="external">GitHub</a>!</p>
<p>The installation is super-simple - there’s no install! You just <strong>download the project, point your IDE/editor to it</strong>, and start the code-debug cycle, with instant feedback!</p>
<p>EPI Judge consists of the following:</p>
<ul>
<li><strong>Stub programs</strong> for each problem in our book in Python, Java, and C++</li>
<li><strong>Test-cases</strong> that cover common corner-case and performance bugs </li>
<li>A <strong>framework</strong> for running these tests on your implementation on your machine</li>
</ul>
<p>The best interview preparation is a combination of hands-on practice over a representative set of problems with quality explanations. </p>
<p>The best way to get this hands-on practice is by developing, running, and debugging programs in the <strong>environment you’re most comfortable with</strong>, i.e., your own computer and IDE/editor:</p>
<ol>
<li>It’s a very fast compile-debug cycle, </li>
<li>you have complete control and visibility, both into the internal state and the test data, </li>
<li>you can use the features such as autocomplete, autoformat, linting, definiton lookups, etc., and</li>
<li>you can choose to use version control, to track your own progress, as well as to pull updates.</li>
</ol>
<p>This screenshot should give you a good idea of what it’s about. </p>
<p><img src="/img/judge-ide-example.png" width="650px"></p>
<p>A big shout-out to <a href="https://github.com/metopa" target="_blank" rel="external">Viacheslav Kroilov</a>, for applying his exceptional software engineering skills to make EPI Judge a reality.</p>
]]></content>
</entry>
<entry>
<title><![CDATA[Buying EPI]]></title>
<url>http://elementsofprogramminginterviews.com/2017/11/27/2017-11-27-buying-epi/</url>
<content type="html"><![CDATA[<p>Please follow these instructions to make sure you get the most recent copy of EPI.</p>
<p>This is <strong>very important</strong> because you want the latest version of EPI, which is the one for which the <strong>seller</strong> is Amazon, which <strong>may not</strong> be the default seller on Amazon’s website.</p>
<p>First, <strong>do not</strong> click on add-to-cart from the landing page (since the default seller is not always Amazon). Instead click on the text highlighed in the figure below.<br><img src="/img/first_landing_page.png" width="600px"></p>
<p></p><p><br>Next, find Amazon in the list of sellers, as in the example below. (Note how Amazon is not at the top of the list!)<br><img src="/img/second_landing_page.png" width="600px"></p>
<p></p><p><br>Now add EPI to your cart, and you are good to checkout!</p>
]]></content>
</entry>
<entry>
<title><![CDATA[The Onsite]]></title>
<url>http://elementsofprogramminginterviews.com/2017/05/26/2017-05-25-the-onsite/</url>
<content type="html"><![CDATA[<p>Many people find interviews intimidating. One reason is the intrinsically challenging problems. However, the challenge goes beyond that - the offices and the work environment are often quite different from anything you’ve seen. </p>
<p>As part of our goal to help readers succeed at interviews, we’ve compiled some pictures of what a typical campus looks like. The intention is to set you more at ease so that you can focus on the technical content.</p>
<p>These pictures are from Facebook (right by Adnan’s office), but are fairly representative.</p>
<p><strong>Come early</strong>, so you don’t have to struggle with finding the building, parking, etc. It’s fine to wait in the lobby for an hour, decompress with a copy of EPI!<br><img src="/img/IMG_4500.JPG"></p>
<p>The <strong>lobby</strong> - this is where the recruiter will come to pick you up.<br><img src="/img/IMG_4501.JPG"></p>
<p>The <strong>interview room</strong>. It’s a fixed room for the duration of the interview, though you may step out for lunch with a host. The interviewers/host/recruiter are supposed to ensure you stay on schedule, but there’s no harm in being proactive, e.g., not letting lunch run late.<br><img src="/img/IMG_4502.JPG"></p>
<p>Here the entire wall is writable, but it’s more common to have a <strong>whiteboard</strong>. Pro tip: consider taking your own markers, so that you can be sure they write well.<br><img src="/img/IMG_4503.JPG"></p>
<p>Dining hall - <strong>free yummy food</strong>, but don’t overeat and get into a food coma, or lose focus.<br><img src="/img/IMG_4509.JPG"></p>
<p>Nice <strong>campus</strong>, but it’s more important to focus on the interview. Do well and there will be plenty of time to appreciate these later.<br><img src="/img/IMG_4510.JPG"></p>
<p>Microkitchens are common.<br><img src="/img/IMG_4504.JPG"></p>
<p>Random office equipment.<br><img src="/img/IMG_4505.JPG"></p>
<p>Bike storage.<br><img src="/img/IMG_4506.JPG"></p>
]]></content>
</entry>
<entry>
<title><![CDATA[EPI in Python]]></title>
<url>http://elementsofprogramminginterviews.com/2017/04/03/2017-04-03-python/</url>
<content type="html"><![CDATA[<p><img src="/img/python-cover-blog.png" width="200"></p>
<p>EPI in Python was the single biggest ask from our readers, and we’re very happy to tell you that EPI in now available in Python! You can buy it directly from Amazon <a href="http://bit.ly/epipython" target="_blank" rel="external">here</a>.</p>
<p>We’ve been using Python as our daily language at Facebook and Uber for quite some time now, and have grown to appreciate its power, versatility, and aesthetics. We wrote Python code for EPI Python from the ground up, and invested a great deal of effort to find the most efficient ways to solve interview problems in Python.</p>
<p>We hope you enjoy reading this book as much we we enjoyed writing it. As always, we look forward to hearing our readers thoughts and criticisms of our work. Feel free to drop us a line, come by in person if you are in the Bay Area. (Ice Cream at the Facebook Sweet Shop is always fun.)</p>
]]></content>
</entry>
<entry>
<title><![CDATA[EPI variants and versions]]></title>
<url>http://elementsofprogramminginterviews.com/2016/06/22/2016-06-22-variants/</url>
<content type="html"><![CDATA[<p>This post clarifies questions we are often asked about EPI versions and variants.</p>
<p></p><h4>Variants</h4> There are <b>two basic printed variants</b>: Elements of Programming Interviews (which is in C++), and Elements of Programming Interviews in Java. <p></p>
<p>Each comes in <b>two sizes: 6” x 9” and 7” x 10”</b> - the latter uses a larger font and greater line spacing. The smaller and larger formats contain exactly the same content.</p>
<p>Amazon does a poor job of showing the variants. Here’s <b>direct links</b> to them:</p>
<ul>
<li>Elements of Programming Interviews (C++): <a href="https://www.amazon.com/Elements-Programming-Interviews-Insiders-Guide/dp/1479274836?ie=UTF8&ref_=zg_bsnr_2576_5" target="_blank" rel="external">6 x 9 format</a>, <a href="https://www.amazon.com/Elements-Programming-Interviews-Insiders-Guide/dp/1530462983/ref=tmm_pap_title_0?_encoding=UTF8&qid=&sr=" target="_blank" rel="external">7 x 10 format</a></li>
<li>Elements of Programming Interviews in Java: <a href="https://www.amazon.com/Elements-Programming-Interviews-Java-Insiders/dp/1517435803?ie=UTF8&ref_=asap_bc" target="_blank" rel="external">6 x 9 format</a>, <a href="https://www.amazon.com/Elements-Programming-Interviews-Java-Adnan/dp/1517671272/ref=sr_1_2?s=books&ie=UTF8&qid=1466659893&sr=1-2&keywords=elements+of+programming+interview+in+java" target="_blank" rel="external">7 x 10 format</a></li>
</ul>
<p></p><h4>Versions</h4> People are often confused the publication dates, e.g., October 2012 date listed for the original 6 in x 9 in EPI (C++).<p></p>
<p>EPI has changed enormously since the initial release - the first release came at commit 1200, we are now at commit 3900. On the way we’ve added and removed problems, features, and content, based on trends we’ve seen at interviews. We regularly upload updated PDF to Amazon’s on-demand publishing arm, and it goes live immediately.</p>
<p>For this reason <b>we very strongly recommend that you buy only from Amazon itself</b>, not from resellers on Amazon. Regardless of the advertised release date, the version sold by Amazon itself is <b>always current</b> - resellers may be selling old stock, or even worse, pirated copies which have very poor print quality.</p>
]]></content>
</entry>
<entry>
<title><![CDATA[Dear readers - we need your help to select a new cover!]]></title>
<url>http://elementsofprogramminginterviews.com/2016/05/19/2016-05-19-epi-cover-2/</url>
<content type="html"><![CDATA[<p>To celebrate all the changes we have made to EPI since its first release, we are creating a new cover.</p>
<p>We held a design competition, and we would like you to help us pick from the finalists. Click <a href="https://99designs.com/book-cover-design/contests/best-selling-book-computer-science-needs-cover-615393/poll/8twqx7?utm_source=voting_app&utm_medium=web&utm_campaign=voting" target="_blank" rel="external">here</a> to vote on covers. (Direct link to poll: <a href="http://bit.ly/epicover2" target="_blank" rel="external">http://bit.ly/epicover2</a>)</p>
<p>Here is a screenshot of the poll.</p>
<p><img src="/img/epi-cover-poll.png" width="750px"></p>
]]></content>
</entry>
<entry>
<title><![CDATA[Please help us review some exciting new features!]]></title>
<url>http://elementsofprogramminginterviews.com/2016/02/25/2016-02-25-reviewers-for-2.0/</url>
<content type="html"><![CDATA[<h3>New features</h3>
<p>EPI is a community book - its content, quality, and very existence, are a testament to the engagement and enthusiasm of its readers.</p>
<p>In this spirit, we are asking readers to help us by providing <strong>feedback on some new material</strong> we’ve been working on. Specifically, based on your feedback, we are adding the following features to EPI:</p>
<ul>
<li><strong>Expanded introductions for each chapter</strong>. These introductions include<ul>
<li>An example that illustrates the key data structures and algorithms for that chapter, e.g., how to use binary search with a custom comparator.</li>
<li>A table of top-tips for the chapter, e.g., consider reversing arrays of digits to operate on the least-significant digit first.</li>
<li>A review of the most important library methods, e.g., Arrays.asList(1,3,5).</li>
</ul>
</li>
<li><strong>More domain specific questions</strong>. Specifically, in addition to the existing chapter on system design problems, we are adding the following chapters.<ul>
<li>Programming language questions, e.g., the difference between final and finally.<br>a Object-oriented principles, e.g., explain the difference between a class adapter and an object adapter.</li>
<li>Tool questions, e.g., describe the role of merging in a version control system.</li>
</ul>
</li>
</ul>
<p>By acting as a reviewer, you will get </p>
<ul>
<li>a chance to perfect your interviewing skills,</li>
<li>an early look at the book, </li>
<li>our undying gratitude, and, </li>
<li>a free hardcopy of the book, <em>if</em> you are one of the first 25 reviewers or make great contributions to this review.</li>
</ul>
<p>If you are interested, please <em>sign up</em> via this <a href="http://goo.gl/forms/J1cSiSx3JD" target="_blank" rel="external">Google form</a>.</p>
<p>We expect reviewers to spend one to two afternoons going through the assigned material, and identify an issue every 1 to 2 pages. </p>
<p>The perfect is the enemy of the good - please send us your inputs as soon as you can. (We are hoping to have a substantial amount of feedback by <em>mid April</em>.</p>
<p>Issues can be typos, language that is misleading, suboptimum solutions, bad programming practices - in short anything that can improve the quality of the book. Every individual issue you identify should be reported through a Google form, which you can view <a href="http://goo.gl/forms/abWVyxxWgV" target="_blank" rel="external">here</a>.</p>
<p>Here are some examples of issues reported by readers. Note how specific these suggestions are - they have details on where the issue was, what the problem was, what the right wording should be, etc.</p>
<ul>
<li>Suggestion: Solution 12.14: I feel that the limitations of the template method particularly in C++ should be addressed.</li>
<li>Typo: The account of HTTPS consistently spells certificate as sertificate.</li>
<li>Suggestion: Drop Variant 10.16.1, as it is effectively the same as Problem 10.18.</li>
<li>Clarification: I don’t see how it’s possible to sort in O(n) time, as suggested by the writeup at the start of Chapter 13.</li>
</ul>
]]></content>
</entry>
<entry>
<title><![CDATA[Introducing the EPI online judge]]></title>
<url>http://elementsofprogramminginterviews.com/2015/12/04/2015-12-04-epi-judge/</url>
<content type="html"><![CDATA[<p><b>July 7, 2016</b></p><p> </p>
<p><b>We’re closing the judge service for the near future as we take the lessons learned and build out a more robust and full-featured service.</b></p>
<p><b>Jan 14, 2016</b></p><p> </p>
<p>We’ve put together a prototype <a href="http://judge.elementsofprogramminginterviews.com:8080" target="_blank" rel="external">online judge</a> service that you can use to practice for interviews. </p>
<p>Take a look at the screenshot at the end to see the UI, or just click on the link.<br>No login is needed, just read the problem description and start hacking!</p>
<p>The judge problems correspond to the problems in the <a href="/sample">PDF sample</a>. These problems are an ideal starting point for anyone who wants to get up to speed with interviewing. (Right now, all programs are in Java.)</p>
<h3 id="Usage"><a href="#Usage" class="headerlink" title="Usage"></a>Usage</h3><p>We use <strong>directed tests</strong> for the judge problems, and try to give <strong>meaningful feedback</strong>. For example, if your program for testing if a binary tree is balanced fails, you will see a report like the following.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">Incorrect result on balanced tree {0,1,2,3,#,4,5}</div></pre></td></tr></table></figure>
<p>
</p><p>If your program fails to compile, we return the <strong>compiler error</strong>, and the <strong>line numbers will correspond</strong> to the lines in your program.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">Line 7: error: incompatible types</div><div class="line"> int y = "asd";</div><div class="line"> ^</div><div class="line"> required: int</div><div class="line"> found: String</div><div class="line">1 error</div></pre></td></tr></table></figure>
<p>
</p><p>If your program throws an exception, we return the <strong>stacktrace</strong> - the <strong>line numbers will not correspond</strong> to the lines in your program.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">Exception in thread "main" java.lang.RuntimeException</div><div class="line"> at BalancedBinaryTree.isBalanced(file.java:49)</div><div class="line"> at BalancedBinaryTree.main(file.java:86)</div></pre></td></tr></table></figure>
<p>
</p><p>Your program runs in Docker container, so <strong>don’t worry about crashing or damaging</strong> our server. We run the program with a <strong>timeout of 20 seconds</strong>, so if your program has an infinite loop, or is very slow, you’ll get a timeout response. If the server is under load, it may block requests that are too frequent.</p>
<p>
</p><p>A few programs require you to have an <strong>efficient solution to pass</strong>, e.g., if you brute-force compute the parity, you will see the judge informs you that your solution is too slow:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">Execution Timed Out</div></pre></td></tr></table></figure>
<p>
</p><h3 id="Plans"><a href="#Plans" class="headerlink" title="Plans"></a>Plans</h3><p>We’re very excited about offering this service, and look forward to developing it - adding more problems, adding a login and persisting your code, classification of problens, drag-and-drop into the editor, executing from Github, etc.</p>
<h3 id="Reader-Input"><a href="#Reader-Input" class="headerlink" title="Reader Input"></a>Reader Input</h3><p>As always, we treasure user input. Please <a href="contact">share</a> your thoughts with us about the judge. Some things we’re especially keen on learning about are:</p>
<ol><br><li> Bugs, e.g., program never returns, hint button doesn’t work, etc.<br></li><li> Source of confusion, e.g., misleading stack traces, wording of error<br></li><li> General UI issues: is editor font ok? do you prefer a light background?<br></li><li> How important are features like login, timing, etc.?<br></li></ol>
<p><img src="/img/epi-judge-ui.png" width="800px"></p>
]]></content>
<categories>
<category> Online Judge </category>
</categories>
</entry>
<entry>
<title><![CDATA[Elements of Programming Interviews in Java]]></title>
<url>http://elementsofprogramminginterviews.com/2015/09/23/2015-09-23-epi-java/</url>
<content type="html"><![CDATA[<p><b>The Java version of EPI is <strike>in press</strike> ready!</b></p>
<p><img src="/img/epi-java-thumbnail.png"></p>
<strike>It should be available from Amazon in a few days.<br>We will post a direct link to the Amazon page when it is ready.</strike>
<p><b>It’s here!</b></p><p></p>
<p><a href="http://www.amazon.com/Elements-Programming-Interviews-Java-Insiders/dp/1517435803/" target="_blank" rel="external">Link</a> to Amazon page<br>for EPI in Java.</p>
<p></p><p><br><img src="/img/epi-java-amzn.png" width="600"></p>
<p>
</p><p>The only difference between the original EPI and EPI in Java is that<br>the programs are now in Java instead of C++. (We also have a short chapter<br>on Java, which includes best coding practices for an interview and a small<br>number of language review questions; this replaces the similar chapter on C++<br>in the original EPI.)</p>
<p>All programs, Java and C++, are always available from the website.</p>
<p>We will continue to sell the original EPI for readers who prefer C++.</p>
]]></content>
</entry>
<entry>
<title><![CDATA[EPI back at Amazon]]></title>
<url>http://elementsofprogramminginterviews.com/2015/09/09/2015-09-09-amzn-status/</url>
<content type="html"><![CDATA[<strike><h3>EPI is not currently available from Amazon, we are working on this issue</h3></strike>
<font color="red"><b>As of 12:43 CDT 9/15/2015, EPI is available again!</b></font>
<!-- For unknown reasons, EPI was not available from Amazon directly for over a week.
We made numerous calls to Amazon and Createspace (the publisher), but were never able to get a clear idea of what happened. -->
]]></content>
</entry>
<entry>
<title><![CDATA[EPI in Java]]></title>
<url>http://elementsofprogramminginterviews.com/2015/08/20/2015-08-20-java-review/</url>
<content type="html"><![CDATA[<h3>The draft version of EPI in Java is ready!</h3>
<p>EPI is a community book - its content, quality, and very existence,<br>are a testament to the engagement and enthusiasm of its readers.</p>
<p>In this spirit, we are asking readers to help us by providing<br>feedback on 1-2 chapters on the Java draft.</p>
<p>By acting as a reviewer, you will get </p>
<ol><br><li>a chance to perfect your interviewing skills,<br></li><li> an early look at the book,<br></li><li> our undying gratitude, and,<br></li><li> a free hardcopy of the book, <em>if</em> you are one of the first 25 reviewers or make great contributions to this review.<br></li></ol>
<p><del>If you are interested, please sign up via this <a href="http://goo.gl/forms/a9CsMJFXbn" target="_blank" rel="external">–>Google form<!--</a>-->.</a></del></p>
<font color="red"><b>Due to enormous interest, we are no longer signing up reviewers. If you are very keen on participating,<br>please write directly to us - you can use [email protected].</b></font>
<p>We expect reviewers to spend one to two afternoons going through<br>the chapter, and identify an issue every 1 to 2 pages. The text is very similar to that of<br>the current version - the big difference is in the programs which are now in Java. </p>
<p>The perfect is the enemy of the good - please send us your inputs as soon as you can. (We are hoping<br>to have a substantial amount of feedback by the end of August.)</p>
<p>Issues can be typos, language that is misleading, suboptimum solutions, bad programming practices - in short<br>anything that can improve the quality of the book.<br>Every individual issue you identify should be reported through a Google form, which you<br>can view <a href="http://goo.gl/forms/x0DJqUcP6e" target="_blank" rel="external">here</a>.</p>
<p>Here are some examples of issues reported by readers.<br>Note how specific these suggestions are - they have details on where the issue was, what the problem was, what the right wording should be, etc.</p>
<ol><br><li> Typo: 3rd paragraph, 3rd line: “<0, 7="" 0,="" 2,="" 3,="" 5,="">“. According to the input array, it should be “<0, 7="" 0,="" 2,="" 3,="" 6,="">“, because when we reach day 6, the max profit is 14 - 8 = 6, not 14 - 9 = 5.<br>This means on the last line of this paragraph, the last two elements in M should be 8 and 6 (instead of 7 and 5).<br><li> Comment: Why in problem 6.19 and the variant, we need to assume that n = 2^k? This condition is not really used in current solutions (unless you meant to discuss an alternate solution that uses divide and conquer to rotate the matrix by quarters).<br></li><li> Clarification: Solution 12.14: I feel the parameters in recursive function are confusing. Would it not be better to use two integers to keep track of the number of left parens we need and the number of right parens we need? If the first one is larger than 0, then we can add either left or right paren; otherwise we just add right parens. When both are 0, we save the valid prefix.<br></li><li> Error: Program in Solution 8.4 goes into an infinite loop<br>if there are duplicates entries in the input list. The problem statement should either explicitly<br>rule that out, or you should use a container which supports duplicate entries.<br></li><li> Suggestion: Drop Variant 10.16.1, as it is effectively the same as Problem 10.18.<br></li></0,></0,></li></ol>
]]></content>
</entry>
<entry>
<title><![CDATA[EPI Problem Solution Integration]]></title>
<url>http://elementsofprogramminginterviews.com/2015/04/03/2015-04-03-integrated-problems-and-solutions/</url>
<content type="html"><![CDATA[<p>A number of readers have suggested integrating solutions with problems, that is presenting<br>the solution immediately after the problem. Their goal is to avoid having to go back<br>and forth.</p>
<p>This has been particularly challenging for readers using the Ebook - Google Play strips<br>the links we provide in the PDF between problems and solutions (and also to page and figure references).</p>
<p>We have updated EPI to have this integration. The new version is now available from Amazon.</p>
<p>If you have an Ebook, you can always get the latest version for free from <a href="https://play.google.com/store/books/details/Adnan_Aziz_Elements_of_Programming_Interviews?id=y6FLBQAAQBAJ" target="_blank" rel="external">Google Play</a>. </p>
<p>Happy Reading,<br>The EPI Team</p>
]]></content>
<categories>
<category> Book Ideas </category>
</categories>
</entry>
<entry>
<title><![CDATA[Warming Up]]></title>
<url>http://elementsofprogramminginterviews.com/2015/04/01/2015-04-01-warming-up/</url>
<content type="html"><![CDATA[<p>The programming exercises in EPI are representative of what you will be asked<br>in an interview. We do not provide textbook-style review questions.</p>
<p>In this document, we present a small set of programming exercises suitable for<br>someone who needs to review basics. (You are unlikely to be<br>asked these questions - their purpose is to bootstrap reading EPI.) </p>
<p>When you write your solutions to these exercises, please code to the following constraints:</p>
<ol><br><li>Do not use library calls.<br></li><li>Do not try to design clever solutions. (This means it is fine to use brute-force approaches.)<br></li><li>Assume valid inputs, and ignore internal errors like overflow, IO exceptions, etc.<br></li><li>Write unit tests for your programs.<br></li><li>Analyze your programs for time and space complexity.<br></li></ol>
<p></p><h3>Exercises, one for each EPI chapter</h3><p></p>
<ol><br><li> Primitive types: write a program that takes as input an integer, N, and prints<br>all the integers from 1 to N, replacing numbers divisible by 3 with “fizz”, numbers divisible by<br>5 with “buzz”, and numbers divisible by both with “fizz buzz”.<br></li><li> Arrays: Write a program that tests if a 2D square array is symmetric about the diagonal<br>from (0,0) to (n-1,n-1).<br></li><li> Strings: Write a program to find the longest substring that consists of a single<br>character in an input string.<br></li><li> Linked Lists: Implement a doubly linked list of integers class. Write a reverse method for your list class<br>that reverses a list without changing the node contents.<br></li><li> Stacks and Queues: Write a programt to evaluate arithmetical expressions that use + and <em> applied<br>to nonnegative integer arguments. Expressions are in reverse-Polish notation, e.g., 3 4 + 5 </em>, 1 3 + 5 7 + *.<br></li><li> Binary Trees: Write inorder, preorder and postorder traversal methods for a binary tree. (You will need<br>to implement a class suitable for representing binary trees, but do not need to implement<br>add, lookup, delete, etc. methods.)<br></li><li> Heaps: Write a program that builds a max-heap from an integer array. (You will need to implement<br>a class suitable for representing heaps, but do not need to implement extract-max, insert key, etc.)<br></li><li> Searching: Write a nonrecursive program to perform binary search over a sorted array.<br></li><li> Hash tables: Write a program that finds the most common object in an array of objects. The<br>objects consists of pairs of strings. Treat strings as being the same if they are equal when converted to lower case.<br></li><li> BSTs: Write a program that searches a BST on integer keys for a given value. (You will need to<br>implement a class suitable for representing BSTs, but do not need to implement<br>add, lookup, delete, etc. methods.)<br></li><li> Write a recursive program that takes as input positive integers x and N, and returns x to the power N.<br>You should use O(log N) multiplications.<br></li><li> Dynamic Programming: Write a program that takes a positive integer N, and returns the number<br>of binary strings of length N such that there are no consecutive 1s. For example, if N = 3, the result<br>is 5, corresponding to the strings 000, 001, 010, 100, 101.<br></li><li> Greedy Algorithms and Invariants: Write a program that takes an input a positive integer<br>N, and returns the minimum number of coins in the US coinage system to create N cents. For example, if<br>N = 37, the answer is 4, corresponding to a quarter, a dime, and two pennies.<br></li><li> Graphs: Implement Depth First Search and Breadth First Search. (You will need to implement<br>classes suitable to representing graphs.)<br></li><li> Parallel Computing: Write a program which uses two threads to print the numbers from<br>1 to 100 in order. One thread can only print odd numbers, the other can only print even numbers.<br></li></ol>
]]></content>
<categories>
<category> Warming Up </category>
<category> Introduction </category>
</categories>
<tags>
<tag> Exercises </tag>
</tags>
</entry>
<entry>
<title><![CDATA[General Programming Questions]]></title>
<url>http://elementsofprogramminginterviews.com/2015/03/31/2015-03-31-general-programming/</url>
<content type="html"><![CDATA[<p>Our book is focused on questions that entail writing programs. You may be asked<br>questions related to general programming practices, which are conceptual and/or<br>knowledge-based, and do not require writing a program. (The extent to which<br>you are asked such questions depends on the company, your experience, the job, etc.)</p>
<p>Such questions tend to be narrow, and as such are not appropriate for our book.<br>We have begun the process of collecting representative questions, which you can see below. </p>
<p><a href="!--0--">Languages</a>,<br><a href="!--1--">Debugging and Testing</a>,<br><a href="!--2--">Operating Systems</a>,<br><a href="!--3--">Tools</a>, </p>
<p>We have also put together a small list of <a href="!--4--">warm up</a> exercises that are appropriate<br>for someone who is a little rusty.</p>
]]></content>
</entry>
<entry>
<title><![CDATA[Tools]]></title>
<url>http://elementsofprogramminginterviews.com/2015/03/31/2015-03-31-tools/</url>
<content type="html"><![CDATA[<h3>Building and maintaining programs</h3>
<ol><br><li> What version control system do you use?<br></li><li> What coverage tool do you use?<br></li><li> What build system do you use?<br></li><li> What documentation system do you use?<br></li><li> What bug tracking system do you use?<br></li><li> How is branching implemented in a version control system?<br></li><li> Are deltas in the branching for a revision tree stored out forwards<br>or backwards? What are the benefits of each approach?<br></li><li> What are the advantages and disadvantages of a version control system that locks files?<br></li></ol>
<h3>The Shell</h3>
<p>There are scores, if not hundreds of books on the UNIX shell and related tools.<br>We have enjoyed LINUX 101 Hacks by Natarajan. It introduces<br>these tools through useful hacks, such as the use of find<br>to find all files that have not been modified in the past 100 days<br>and are larger than 100~megabytes in size, sorting the password file on the third field, etc.</p>
<ol><br><li> Write a regular expression for identifying social security numbers in a file.<br></li><li> Write a command that prints out lines in a text file which contain the<br>strings foo and bar in any order.<br></li><li> Write a command which replaces every occurrence of a foo followed by a bar (with<br>possibly some other characters in between) by widget.<br></li><li> Given a text file with two columns of integers, i.e., two integers encoded in ASCII per line, write a filter which sorts lines in the file by the second integer.<br></li><li> How would you take two documents in PDF and create a new document which consists of the pages of the two original documents interleaved in order?<br></li><li> How would you write a program which checks every hour if a network connection is up?<br></li><li> How would you write a program which checks the price of a Nikon D5300 DLSR each day on amazon.com?<br></li></ol>
]]></content>
<categories>
<category> General Programming </category>
<category> Tools </category>
</categories>
<tags>
<tag> Tools </tag>
<tag> VCS </tag>
<tag> Build </tag>
<tag> Unit testing </tag>
<tag> Regular expressions </tag>
<tag> Unix </tag>
</tags>
</entry>
<entry>
<title><![CDATA[General facts about C, C++, Java, Python]]></title>
<url>http://elementsofprogramminginterviews.com/2015/03/31/2015-03-31-programming-languages/</url>
<content type="html"><![CDATA[<h3>Core language</h3>
<ol><br><li> What are the types in C, Java, C++, and Perl? How many bits does it take<br>to represent the basic types?<br></li><li> What do floating point numbers look like in<br>memory? Specifically, how many bits are there in a double and<br>what sequence to the bits appear in?<br></li><li> What is twos-complement notation?<br></li><li> How would you implement a bit array class?<br></li><li> Does the check x == x + 1 always return false for integer x?<br></li><li> What does a C struct look like in memory? What does a C++<br>object look like in memory? What does a Java object look like in<br>memory?<br></li><li> What is the difference between an interpreted and a compiled language?<br></li><li> What is garbage collection?<br></li><li> How would you determine if call stack grows up or down relative<br>to memory addresses?<br></li><li> Give an example of a memory leak in Java.<br></li><li> What is tail recursion? How can it be removed automatically?<br></li><li> Is the natural recursive program for computing <i>n!</i> tail recursive?<br></li><li> Your manager reads an online article that says it is 10X faster to code in Python than in C++. He wants you to code exclusively in Python from now on. What would you say to him?<br></li><li> What does an executable look like as a sequence of bytes?<br></li></ol>
<h3>Libraries</h3>
<p>A programmer who regularly implements complex algorithms such as KMP<br>string matching or the Dijkstra shortest path computation quickly<br>will not advance very far. Solutions to such problems are well-known and have<br>high quality, thoroughly tested, and debugged implementations, often<br>available as open source. Programmers should know and use these libraries.</p>
<ol><br><li>Give an example of a function which is in the C standard library.<br></li><li>Give an example of a commonly used function which is not in the C standard library.<br></li><li>What library would you use to determine the current date in Java?<br></li><li>What library would you use in Java if you had to implement a tinyurl service?<br></li><li>How does STL implement sets?<br></li><li>How does the library code compute trigonometric functions?<br></li><li>The strtok(char <em>s1, char </em>s2) function in the C standard library successively returns occurrences of the characters in s2 in string s1; it returns null if there are no more occurrences.<br></li><li>What makes this a dangerous function to use in a multithreaded program?<br></li></ol>
<h3>Programming language implementation</h3>
<ol><br><li> Give an example of a language which cannot be parsed by any computer.<br></li><li> What problems does dynamic linkage solve? What problems does it introduce?<br></li><li> What is a functional language?<br></li><li> What is a virtual function?<br></li><li> How is method dispatch implemented in Java?<br></li><li> What is automatic garbage collection and how is it implemented?<br></li><li> What is a type-safe language?<br></li><li> What is the difference between a lexer and a parser?<br></li><li> Give an example of a language which cannot be recognized by a lexer.<br></li><li> Give an example of a language which cannot be parsed by a parser.<br></li></ol>
]]></content>
<categories>
<category> General Programming </category>
</categories>
<tags>
<tag> Python </tag>
<tag> C++ </tag>
<tag> Java </tag>
</tags>
</entry>
<entry>
<title><![CDATA[General facts about Operating Systems]]></title>
<url>http://elementsofprogramminginterviews.com/2015/03/31/2015-03-31-os/</url>
<content type="html"><![CDATA[<p><i>Modern Operating Systems</i> by Tanenbaum is widely used;<br>one of its claims to fame is that Linux was developed from the Minix<br>OS developed in an earlier version of this book.</p>
<ol><br><li> What is a system call?<br></li><li> How is a system call different from a library call?<br></li><li> What is a device driver?<br></li><li> What is livelock? What is deadlock? Give examples of each.<br></li><li> What is a race? What can you do to prevent races?<br></li><li> What is a mutex? What are semaphores? How are they implemented?<br></li><li> Give examples of system calls that are not related to input-output.<br></li><li> Give examples of library functions that call a system function all the time, none of the time, and some of the time.<br></li><li> What is the time lag between the system call on the client side and the receipt of the packet on the server on a LAN?<br></li><li> How fast can you write a gigabyte of data from RAM to disk?<br></li><li> How does TCP/IP work?<br></li><li> What is DNS?<br></li></ol>
]]></content>
<categories>
<category> OS </category>
<category> General Programming </category>
</categories>
<tags>
<tag> OS </tag>
<tag> General Programming </tag>
<tag> System Call </tag>
<tag> TCP/IP </tag>
<tag> DNS </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Debugging and Testing]]></title>
<url>http://elementsofprogramminginterviews.com/2015/03/31/2015-03-31-debugging-and-testing/</url>
<content type="html"><![CDATA[<p>Debugging and testing are topics which are not usually the focus of university teaching.<br>We highly recommend The Practice of Programming by Kernighan and<br>Pike, which teaches much more than just writing code. Specifically, it covers testing,<br>debugging, portability, performance, and design alternatives.</p>
<ol><br><li> What was your last bug? What was your hardest bug?<br></li><li> How would you debug a distributed program?<br></li><li> A program works sometimes and fails other times - why?<br></li><li> A program works sometimes and fails other times on the exact same input - why?<br></li><li> How would you determine where a program spends most of its time?<br></li><li> How does JUnit make the process of testing easier?<br></li><li> List five ways in which C code can be non-portable. What can you do to make the code portable?<br></li><li> Write tests for implementation of an isupper() function.<br></li><li> Should you test private methods? Should you test one line methods?<br></li><li> If you find and fix an error by adding debug code, should you remove the debug code afterwards? Should you leave them in with a conditional compilation flag or with a run time flag?<br></li><li> What is a buffer overflow and how can hackers exploit it?<br></li><li> How can you use Valgrind to solve segfault problems?<br></li><li> How does Valgrind catch access uninitialized memory?<br></li></ol>
]]></content>
<categories>
<category> Programming Practice </category>
</categories>
<tags>
<tag> Debugging </tag>
<tag> Testing </tag>
</tags>
</entry>
<entry>
<title><![CDATA[EPI in Python]]></title>
<url>http://elementsofprogramminginterviews.com/2015/02/27/2015-02-27-python/</url>
<content type="html"><![CDATA[<p><b>We’ve begun the process of writing Python solutions!</b></p>
<p>Python versions of the program in the EPI sampler are listed below and<br>we would really appreciate your thoughts on them with respect to idiomaticity and clarity.</p>
<p>Python has exceptionally powerful libraries. Our programs by design use a simple subset of the<br>library but in many cases we also provide alternative Pythonistic solutions.</p>
<p>Solutions are written for Python 3.4.</p>
]]></content>
<categories>
<category> Programming Language </category>
</categories>
<tags>
<tag> Python </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Register]]></title>
<url>http://elementsofprogramminginterviews.com/2015/01/01/2015-01-01-register/</url>
<content type="html"><![CDATA[<h2 id="about">Register <i class="icon-double-angle-right"></i></h2>
<p>Fill out this registration <a href="https://bit.ly/epireg" target="_blank" rel="external">form</a> to get updates on interviewing trends, good practice problems, links to our blog posts, and updates to the book/website.</p>
<p></p><p></p>
<p></p><p><br>For example, we are implementing an online solution checking system, and would like to be able to let you know when it’s ready.</p>
<p></p><p><br>We will <b>not</b> be spamming you, and you will always have the option of opting out of receiving emails at any time. We reach out to you individually for feedback. </p>
]]></content>
<tags>
<tag> Register </tag>
</tags>
</entry>
<entry>
<title><![CDATA[EPI Ebook on Google Play]]></title>
<url>http://elementsofprogramminginterviews.com/2014/11/16/2014-11-16-ebook/</url>
<content type="html"><![CDATA[<p><b>We’re happy to announce EPI is now available as an Ebook through Google Play!</b></p>
<p>Here’s the <a href="https://play.google.com/store/books/details/Adnan_Aziz_Elements_of_Programming_Interviews?id=y6FLBQAAQBAJ" target="_blank" rel="external">link</a>, to the C++ version, which includes a sample. Here’s a <a href="https://play.google.com/store/books/details/Adnan_Aziz_Elements_of_Programming_Interviews_in_J?id=ux3PCwAAQBAJ" target="_blank" rel="external">link</a> to the Java version.</p>
<p>You can read Google Play books on Android, IOS, and your computer:<br><a href="https://support.google.com/googleplay/answer/2851658?hl=en" target="_blank" rel="external">Android instructions</a>,<br><a href="https://support.google.com/googleplay/answer/188504?hl=en" target="_blank" rel="external">IOS instructions</a>,<br><a href="https://support.google.com/googleplay/answer/185545" target="_blank" rel="external">reading on your computer</a>.</p>
<p>The Ebook is identical to the printed copy.</p>
<p>Read our post <a href="2014/04/08/epi-features/">EPI in a nutshell</a> to get a broader overview of our book.</p>
<h4>Navigating the Ebook</h4>
<p>The typographic quality of iBooks and Kindle is unacceptable for a book like EPI that has sophisticated tables, drawings, equations, code, etc. (The input to these formats is HTML and the result is hideous - trust us, we’ve tried.)</p>
<p>Google Play is the only ebook format that will render EPI perfectly. The PDF we provide Google includes hyperlinks that allow you to click on problems in the table of contents, and referenced page numbers. However, despite multiple attempts on our part, Google Play strips these links out, making the ebook slower to navigate and search.</p>
<p>With Google Play you buy the book, try it out, and ask for a refund within a certain time period, and we encourage you to take advantage of this facility.</p>
<p></p><h4>Offline viewing<br>Some readers have had problems viewing the book offline. Here’s one reader’s experience, and his solution.<p></p>
<p>Last night when I disabled wifi, I noticed the book disappeared. Upon connecting to the wifi again I noticed the book eventually came back. I thought I had synced all pages manually, but I noticed I was missing a few pages in the middle. Apparently the app won’t let you view the book offline until all pages are synced. I noted that during all these times the blue circle with checkmark was to the bottom right of the book as if the book is synced, but that wasn’t the case.</p>
<p>I decided to sync those missing pages manually, but I noticed a weird thing after they were synced like a repetition of the same pages, like 65-68 couple of times in a row. I decided at that time to remove the book from downloads, and close the app altogether (double tap on home key and scroll up the app in the background). I thought about reinstalling the book app, but didn’t.</p>
<p>Then I started the download of the book again overnight…</p>
<p>This morning I noticed the blue checkmark, as if the book is synced. Upon opening it, I saw that the pages weren’t synced either. This time I went to the beginning of the book, and scroll to the end (faster if you put the device in horizontal/landscape/2pages mode). Making sure that all pages are synced. Then did a couple of tests relaunching the app after: </p>
<ul>
<li>wifi disabled (app still in background)</li>
<li>wifi disabled, close app.</li>
<li>wifi disabled, rebooted ipad</li>
</ul>
<p>and they all worked and I was able to read the book offline this time. Maybe the book was corrupted before ?</p>
<p>But I can tell that blue checkmark on the bottom right of the book doesn’t mean sync (at least not here)</p>
</h4>]]></content>
<categories>
<category> Ebook </category>
</categories>
<tags>
<tag> Ebook </tag>
<tag> Google Play </tag>
<tag> Kindle </tag>
<tag> iBooks </tag>
<tag> PDF </tag>
</tags>
</entry>
<entry>
<title><![CDATA[Why we wrote EPI]]></title>
<url>http://elementsofprogramminginterviews.com/2014/08/29/2014-08-29-why/</url>
<content type="html"><![CDATA[<p><b>We wrote EPI for you!</b></p>
<p>EPI began as a Google Doc which we prepared for our friends who wanted to join companies<br>like Google, Facebook, Amazon, Microsoft, as well as hot startups.</p>
<p>Like you, they had talent, but were not familiar with the interviewing style<br>at these companies, and often failed to land their dream job.</p>
<p>For example, many of our friends had engineering and science degrees, or had been out of college for a while,<br>and were not prepared for data structures and algorithms interview questions.</p>
<p>EPI evens the playing field. Combined with your hard work, it will enable you<br>to interview successfully at the best companies.</p>
<p>Read our post <a href="2014/04/08/epi-features/">EPI in a nutshell</a> to get a broader overview of our book.</p>
]]></content>
<categories>
<category> Introduction </category>
</categories>
<tags>
<tag> Why we wrote EPI </tag>
</tags>
</entry>
<entry>
<title><![CDATA[EPI in a nutshell]]></title>
<url>http://elementsofprogramminginterviews.com/2014/04/08/2014-04-08-epi-features/</url>
<content type="html"><![CDATA[<h2>Problem-driven approach</h2><br>EPI includes over 300 solved problems<br>representative of those asked at leading software companies.<br><p><br>With the exception of approximately 20 design problems, the<br>problems are designed to be codable in a 60 minute interview.<br></p><p><br>For many problems, at the end of its solution,<br>we describe a large number of variants.<br></p><p><br>We include a hints section, which consists of 1-2 sentence<br>suggestions, similar to what your interviewer will give you when you are stuck.<br></p><p><br><br><br></p><h2>The inside story</h2>
<p>All three of us successfully made it through the Google interview process, and went on to<br>work at Google, where, among other things, we interviewed candidates for our teams.</p>
<p></p><p><br>We have complementary backgrounds (large company, startup, academia)<br>and have held multiple roles (individual contributor, tech lead, CTO, consultant, professor),<br>that gives us unparalleled insight into the job market.</p>
<p></p><p><br>In addition to Google, some of the other places we have worked at include<br>Facebook, Microsoft, IBM, Qualcomm, and Synopsys, as well as a number of start-ups.<br>We have studied and taught at leading universities in the US (Berkeley, Texas) and<br>internationally (IIT Kanpur, National Tsing Hua University).</p>
<p>
</p><h2>Study guide</h2>
<p>We specify subsets of problems to solve and to review on based on the amount of time you<br>can commit, ranging from a weekend hackathon (intense!), to an hour a day for a semester.</p>
<p>
</p><h2>Commitment to excellence</h2><br>We have used best-in-class practices in the development of EPI: LaTeX for document<br>preparation, GitHub for revision control, agile development, continuous integration, unit testing.<br><p><br></p><p><br>As a concrete example, we have close to 200 figures in our book. These<br>were prepared using the TikZ extensions to LaTeX, which allow us to programmatically<br>specify figures, leading to much clearer illustrations.<br></p><p><br><br></p><h2>Tested programs</h2><br>EPI solutions are mostly written in C++. (The programs illustrating concurrency<br>are in Java.)<br><p><br><br>We have developed Java equivalents to the C++ programs. Both<br>C++ and Java versions for all problems, including test cases,<br>available from Google Code and GitHub. See code link in the sidebar for details.<br><br></p><h2>Nontechnical aspects of interviewing</h2>
<p>In a seperate chapter, we present a set of 14 data structure, algorithm, and design patterns -<br>useful general problem solving techniques that you can apply when you are stumped. We<br>have suggestions on when and where to apply them, as well as examples illustrating their use.</p>
<p>
</p><p>We describe how to prepare for an interview, how to conduct yourself<br>during the interview, and what to do afterwards. This review covers the<br>technical (selecting variable names, memory management)<br>as well as nontechnical (what to wear, what not to say).<br>We present insights into<br>the different company cultures, and how it impacts how you need to present yourself.</p>
<p>
</p><p>We give a brief account of interviewing from the interviewer’s perspective.<br>In addition to being useful to anyone interviewing, this is useful for any<br>engineer conducting an interview.</p>
<p>
</p>]]></content>
<categories>
<category> Overview </category>
</categories>
<tags>
<tag> Overview </tag>
<tag> Introduction </tag>
</tags>
</entry>
</search>