forked from kilimchoi/technical_interview_questions
/
QUESTIONS.json
1133 lines (1133 loc) · 51.6 KB
/
QUESTIONS.json
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
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"TechQuestions": {
"category": [
{
"idC": "C1",
"catname": "General",
"question": [
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q1",
"idQ": "Q1",
"ID": "Q1",
"name": "Find the most frequent integer in an array"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q2",
"idQ": "Q2",
"ID": "Q2",
"name": "Find pairs in an integer array whose sum is equal to 10 (bonus; do it in linear time)"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q3",
"idQ": "Q3",
"ID": "Q3",
"name": "Given 2 integer arrays, determine if the 2nd array is a rotated version of the 1st array.",
"notes": "Ex. Original Array A={1,2,3,5,6,7,8} Rotated Array B={5,6,7,8,1,2,3}"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q4",
"idQ": "Q4",
"ID": "Q4",
"name": "Write fibbonaci iteratively and recursively (bonus; use dynamic programming)"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q5",
"idQ": "Q5",
"ID": "Q5",
"name": "Find the only element in an array that only occurs once."
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q6",
"idQ": "Q6",
"ID": "Q6",
"name": "Find the common elements of 2 int arrays"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q7",
"idQ": "Q7",
"ID": "Q7",
"name": "Implement binary search of a sorted array of integers"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q8",
"idQ": "Q8",
"ID": "Q8",
"name": "Implement binary search in a rotated array (ex. {5,6,7,8,1,2,3})"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q9",
"idQ": "Q9",
"ID": "Q9",
"name": "Use dynamic programming to find the first X prime numbers"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q10",
"idQ": "Q10",
"ID": "Q10",
"name": "Write a function that prints out the binary form of an int"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q11",
"idQ": "Q11",
"ID": "Q11",
"name": "Implement parseInt"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q12",
"idQ": "Q12",
"ID": "Q12",
"name": "Implement squareroot function"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q13",
"idQ": "Q13",
"ID": "Q13",
"name": "Implement an exponent function (bonus; now try in log(n) time)"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q14",
"idQ": "Q14",
"ID": "Q14",
"name": "Write a multiply function that multiples 2 integers without using *"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q15",
"idQ": "Q15",
"ID": "Q15",
"name": "Given n points, return the top k points that are closest to the origin"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q16",
"idQ": "Q16",
"ID": "Q16",
"name": "We’re going to find “Word Twins”, which are pairs of English words, at least 4 letters long, where the first three letters of one are the last three letters of another. For example, “strategy” and “Egypt”."
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q17",
"idQ": "Q17",
"ID": "Q17",
"name": "Given a 3*3 matrix, and 1-8 numbers in random order, 1 place as space.",
"notes": "Write code to find the min exchange of numbers to make the matrix in order.5 4 1 1 2 33 2 ---> 8 47 8 6 7 6 5"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q18",
"idQ": "Q18",
"ID": "Q18",
"name": "There is k parenthesis, write code to calculate how many permutations could have.",
"notes": "For 2 parenthesis, there is 2 permutations: ()() and (())."
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q19",
"idQ": "Q19",
"ID": "Q19",
"name": "**HARD**; Given a function rand5() that returns a random int between 0 and 5, implement rand7()"
},
{
"categoryname": "General",
"idC": "C1",
"idCQ": "C1Q20",
"idQ": "Q20",
"ID": "Q20",
"name": "**HARD**; Given a 2D array of 1s and 0s, count the number of ``islands of 1s`` (e.g. groups of connecting 1s)"
}
]
},
{
"idC": "C2",
"catname": "Strings",
"question": [
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q1",
"idQ": "Q1",
"ID": "Q21",
"name": "Find the first non-repeated character in a String"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q2",
"idQ": "Q2",
"ID": "Q22",
"name": "Reverse a String iteratively and recursively"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q3",
"idQ": "Q3",
"ID": "Q23",
"name": "Determine if 2 Strings are anagrams"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q4",
"idQ": "Q4",
"ID": "Q24",
"name": "Check if String is a palindrome"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q5",
"idQ": "Q5",
"ID": "Q25",
"name": "Check if a String is composed of all unique characters"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q6",
"idQ": "Q6",
"ID": "Q26",
"name": "Determine if a String is an int or a double"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q7",
"idQ": "Q7",
"ID": "Q27",
"name": "**HARD**; Find the longest palindrome in a String"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q8",
"idQ": "Q8",
"ID": "Q28",
"name": "**HARD**; Print all permutations of a String"
},
{
"categoryname": "Strings",
"idC": "C2",
"idCQ": "C2Q9",
"idQ": "Q9",
"ID": "Q29",
"name": "**HARD**; Given a single-line text String and a maximum width value, write the function 'String justify(String text, int maxWidth)' that formats the input text using full-justification, i.e., extra spaces on each line are equally distributed between the words; the first word on each line is flushed left and the last word on each line is flushed right"
}
]
},
{
"idC": "C3",
"catname": "Trees",
"question": [
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q1",
"idQ": "Q1",
"ID": "Q30",
"name": "Implement a BST with insert and delete functions"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q2",
"idQ": "Q2",
"ID": "Q31",
"name": "Print a tree using BFS and DFS"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q3",
"idQ": "Q3",
"ID": "Q32",
"name": "Write a function that determines if a tree is a BST"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q4",
"idQ": "Q4",
"ID": "Q33",
"name": "Find the smallest element in a BST"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q5",
"idQ": "Q5",
"ID": "Q34",
"name": "Find the 2nd largest number in a BST"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q6",
"idQ": "Q6",
"ID": "Q35",
"name": "Given a binary tree which is a sum tree (child nodes add to parent), write an algorithm to determine whether the tree is a valid sum tree"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q7",
"idQ": "Q7",
"ID": "Q36",
"name": "Find the distance between 2 nodes in a BST and a normal binary tree"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q8",
"idQ": "Q8",
"ID": "Q37",
"name": "Print the coordinates of every node in a binary tree, where root is 0,0"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q9",
"idQ": "Q9",
"ID": "Q38",
"name": "Print a tree by levels"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q10",
"idQ": "Q10",
"ID": "Q39",
"name": "Given a binary tree which is a sum tree, write an algorithm to determine whether the tree is a valid sum tree"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q11",
"idQ": "Q11",
"ID": "Q40",
"name": "Given a tree, verify that it contains a subtree."
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q12",
"idQ": "Q12",
"ID": "Q41",
"name": "Convert binary tree to doubly linked list"
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q13",
"idQ": "Q13",
"ID": "Q42",
"name": "**HARD**; Find the max distance between 2 nodes in a BST."
},
{
"categoryname": "Trees",
"idC": "C3",
"idCQ": "C3Q14",
"idQ": "Q14",
"ID": "Q43",
"name": "**HARD**; Construct a BST given the pre-order and in-order traversal Strings"
}
]
},
{
"idC": "C4",
"catname": "Stacks, Queues, and Heaps",
"question": [
{
"categoryname": "Stacks, Queues, and Heaps",
"idC": "C4",
"idCQ": "C4Q1",
"idQ": "Q1",
"ID": "Q44",
"name": "Implement a stack with push and pop functions"
},
{
"categoryname": "Stacks, Queues, and Heaps",
"idC": "C4",
"idCQ": "C4Q2",
"idQ": "Q2",
"ID": "Q45",
"name": "Implement a queue with queue and dequeue functions"
},
{
"categoryname": "Stacks, Queues, and Heaps",
"idC": "C4",
"idCQ": "C4Q3",
"idQ": "Q3",
"ID": "Q46",
"name": "Find the minimum element in a stack in O(1) time"
},
{
"categoryname": "Stacks, Queues, and Heaps",
"idC": "C4",
"idCQ": "C4Q4",
"idQ": "Q4",
"ID": "Q47",
"name": "Write a function that sorts a stack (bonus; sort the stack in place without extra memory)"
},
{
"categoryname": "Stacks, Queues, and Heaps",
"idC": "C4",
"idCQ": "C4Q5",
"idQ": "Q5",
"ID": "Q48",
"name": "Implement a binary min heap. Turn it into a binary max heap"
},
{
"categoryname": "Stacks, Queues, and Heaps",
"idC": "C4",
"idCQ": "C4Q6",
"idQ": "Q6",
"ID": "Q49",
"name": "**HARD**; Implement a queue using two stacks"
}
]
},
{
"idC": "C5",
"catname": "Linked Lists",
"question": [
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q1",
"idQ": "Q1",
"ID": "Q50",
"name": "Implement a linked list (with insert and delete functions)"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q2",
"idQ": "Q2",
"ID": "Q51",
"name": "Find the Nth element in a linked list"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q3",
"idQ": "Q3",
"ID": "Q52",
"name": "Remove the Nth element of a linked list"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q4",
"idQ": "Q4",
"ID": "Q53",
"name": "Check if a linked list has cycles"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q5",
"idQ": "Q5",
"ID": "Q54",
"name": "Given a circular linked list, find the node at the beginning of the loop.",
"notes": "Ex. A-->B-->C --> D-->E -->C, C is the node that begins the loop"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q6",
"idQ": "Q6",
"ID": "Q55",
"name": "Check whether a link list is a palindrome"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q7",
"idQ": "Q7",
"ID": "Q56",
"name": "Reverse a linked list iteratively and recursively"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q8",
"idQ": "Q8",
"ID": "Q57",
"name": "Given a linked list, where each node has a link to a random node in the list, make a copy of the entire list"
},
{
"categoryname": "Linked Lists",
"idC": "C5",
"idCQ": "C5Q9",
"idQ": "Q9",
"ID": "Q58",
"name": "Given a singly LL A->B->C->D->E->F... convert to B->A->D->C->F->E..."
}
]
},
{
"idC": "C6",
"catname": "Sorting",
"question": [
{
"categoryname": "Sorting",
"idC": "C6",
"idCQ": "C6Q1",
"idQ": "Q1",
"ID": "Q59",
"name": "Implement bubble sort"
},
{
"categoryname": "Sorting",
"idC": "C6",
"idCQ": "C6Q2",
"idQ": "Q2",
"ID": "Q60",
"name": "Implement selection sort"
},
{
"categoryname": "Sorting",
"idC": "C6",
"idCQ": "C6Q3",
"idQ": "Q3",
"ID": "Q61",
"name": "Implement insertion sort"
},
{
"categoryname": "Sorting",
"idC": "C6",
"idCQ": "C6Q4",
"idQ": "Q4",
"ID": "Q62",
"name": "Implement merge sort"
},
{
"categoryname": "Sorting",
"idC": "C6",
"idCQ": "C6Q5",
"idQ": "Q5",
"ID": "Q63",
"name": "Implement quick sort"
}
]
},
{
"idC": "C7",
"catname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"question": [
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q1",
"idQ": "Q1",
"ID": "Q64",
"name": "Basic bitwise operations"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q2",
"idQ": "Q2",
"ID": "Q65",
"name": "How do you program a min heap using Nodes"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q3",
"idQ": "Q3",
"ID": "Q66",
"name": "Find the max value in an array. The array is ``semi-sorted``.",
"notes": "Ex. { 1 3 4 7 9 10 12 13 12 6 3 }"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q4",
"idQ": "Q4",
"ID": "Q67",
"name": "Write a code that accepts integers as arrays and outputs the multiplication result as an array."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q5",
"idQ": "Q5",
"ID": "Q68",
"name": "Write a code that takes the coordinates of multiple rectangles as input and returns as output the coordinates of the rectangle that is the intersection of all the rectangles."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q6",
"idQ": "Q6",
"ID": "Q69",
"name": "Typical low level CS questions about sorting algorithms and operational cost."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q7",
"idQ": "Q7",
"ID": "Q70",
"name": "Median finding algorithm - find the median of 'n' numbers and a little bit of binary search tree implementation"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q8",
"idQ": "Q8",
"ID": "Q71",
"name": "Find the largest rectangle with all 0s in an matrix with only 0 and 1."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q9",
"idQ": "Q9",
"ID": "Q72",
"name": "Convert char string to integer."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q10",
"idQ": "Q10",
"ID": "Q73",
"name": "Find occurrences of a number in sorted array (allow duplicates)."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q11",
"idQ": "Q11",
"ID": "Q74",
"name": "If integer array used to store big integers (one integer store one digit), implement arithmetic operations."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q12",
"idQ": "Q12",
"ID": "Q75",
"name": "How to build a heap?"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q13",
"idQ": "Q13",
"ID": "Q76",
"name": "What is the optimized version of the knn algorithm?"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q14",
"idQ": "Q14",
"ID": "Q77",
"name": "Write a recursive function to calculate pascal's pyramid numbers."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q15",
"idQ": "Q15",
"ID": "Q78",
"name": "A question related to binary search, which is a kind of weak spot and I always avoid using it."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q16",
"idQ": "Q16",
"ID": "Q79",
"name": "Explain Singleton structure, how to create"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q17",
"idQ": "Q17",
"ID": "Q80",
"name": "Given k sorted pivots, write procedure partition in quicksort"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q18",
"idQ": "Q18",
"ID": "Q81",
"name": "Find the median of three numbers."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q19",
"idQ": "Q19",
"ID": "Q82",
"name": "Generate all balanced parentheses combinations of given length."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q20",
"idQ": "Q20",
"ID": "Q83",
"name": "The second question asked, how to find two missing integers in an unsorted array"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q21",
"idQ": "Q21",
"ID": "Q84",
"name": "Given an array of characters in it, how would you reverse it?"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q22",
"idQ": "Q22",
"ID": "Q85",
"name": "Write a program to comparing two array, one being very large"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q23",
"idQ": "Q23",
"ID": "Q86",
"name": "To generate a fibonacci number sequence, and discuss its time and space complexity"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q24",
"idQ": "Q24",
"ID": "Q87",
"name": "To merge two sorted integer arrays."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q25",
"idQ": "Q25",
"ID": "Q88",
"name": "Returning the n-th element of a linked list."
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q26",
"idQ": "Q26",
"ID": "Q89",
"name": "How to randomly select a number with equal probability from an array with unknown size?",
"notes": "Write an algorithm to find the 3rd highest number from an array of random integers"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q27",
"idQ": "Q27",
"ID": "Q90",
"name": "Given a sorted array of n integers that has been rotated an unknown number of times, write code to find an element in the array. Sorted in increasing order",
"notes": "Input: find 5 in (15, 16, 19, 20, 25, 1, 3, 4, 5, 6, 10, 14) Output 8"
},
{
"categoryname": "BSTs, Heaps, Search Algorithms, Sort Algorithms, Intersection, median, hashmap, caching system, basic algorithms** ",
"idC": "C7",
"idCQ": "C7Q28",
"idQ": "Q28",
"ID": "Q91",
"name": "Implement a simple regular expression matching function"
}
]
},
{
"idC": "C8",
"catname": "Uncategorized",
"question": [
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q1",
"idQ": "Q1",
"ID": "Q92",
"name": "Given a max-heap, how do I find the top k items?"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q2",
"idQ": "Q2",
"ID": "Q93",
"name": "Find the border length created from a conglomeration of various 2D rectangles."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q3",
"idQ": "Q3",
"ID": "Q94",
"name": "Write a minPeak function for a stack (function that returns the minimum element in the stack)."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q4",
"idQ": "Q4",
"ID": "Q95",
"name": "Find the nth fib number"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q5",
"idQ": "Q5",
"ID": "Q96",
"name": "Design a function in your favorite programming language to convert a camelCase string to all lowercase."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q6",
"idQ": "Q6",
"ID": "Q97",
"name": "Implement a hashset"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q7",
"idQ": "Q7",
"ID": "Q98",
"name": "Given a corpus of valid words, design a function that takes a word as input and outputs all valid anagrams of that word."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q8",
"idQ": "Q8",
"ID": "Q99",
"name": "Given an input of a 3D matrix of ones and zeros, count the number of contiguous 1-filled regions (as separated by 0-filled regions), as well as the size of the largest one (I think; doesn't really change the problem much)."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q9",
"idQ": "Q9",
"ID": "Q100",
"name": "You have two sets. How would you know that they converge."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q10",
"idQ": "Q10",
"ID": "Q101",
"name": "Given a bag of nuts and a bag of bolts, each having a different size within a bag but exactly one match in the other bag, give a fast algorithm to find all matches"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q11",
"idQ": "Q11",
"ID": "Q102",
"name": "Preorder traversal without recursion"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q12",
"idQ": "Q12",
"ID": "Q103",
"name": "Find the largest possible difference in an array of integers, such that the smaller integer occurs earlier in the array."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q13",
"idQ": "Q13",
"ID": "Q104",
"name": "How to find if n numbers in a list sum up to an integer k?"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q14",
"idQ": "Q14",
"ID": "Q105",
"name": "Find largest palindrome in string"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q15",
"idQ": "Q15",
"ID": "Q106",
"name": "Make an anagram solver that returns all valid dictionary words given a set of characters."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q16",
"idQ": "Q16",
"ID": "Q107",
"name": "Sort a string by the order it's characters appear in another string"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q17",
"idQ": "Q17",
"ID": "Q108",
"name": "Given a value k and an array , design an efficient algorithm that should output the number of pairs that sum up to k."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q18",
"idQ": "Q18",
"ID": "Q109",
"name": "How do you find three numbers that sum to 0? (in a list). Now can you do it under O(n^3)?"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q19",
"idQ": "Q19",
"ID": "Q110",
"name": "Given a Fibonacci number, tell us which index it occurs at."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q20",
"idQ": "Q20",
"ID": "Q111",
"name": "Describe an algorithm that would find n numbers in a list that sum to 0."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q21",
"idQ": "Q21",
"ID": "Q112",
"name": "Given an array of n unsorted ints, with the condition that each number is at most k positions away from its final sorted position, give an efficient sorting algorithm"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q22",
"idQ": "Q22",
"ID": "Q113",
"name": "Give an efficient solution for subset sum."
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q23",
"idQ": "Q23",
"ID": "Q114",
"name": "Given two (i,j) coordinates of a cell in two dimensional matrix. These coordinates are the lower left and upper right corner of a rectangle contained within the matrix. Sum all the elements in the matrix. Time and space?"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q24",
"idQ": "Q24",
"ID": "Q115",
"name": "String has all unique characters"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q25",
"idQ": "Q25",
"ID": "Q116",
"name": "Two strings to see if one is a permutation"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q26",
"idQ": "Q26",
"ID": "Q117",
"name": "Remove dups from an unsorted linked list"
},
{
"categoryname": "Uncategorized",
"idC": "C8",
"idCQ": "C8Q27",
"idQ": "Q27",
"ID": "Q118",
"name": "Find kth algorithm of singly linked list"
},