-
-
Notifications
You must be signed in to change notification settings - Fork 342
/
general-cs-quiz.ts
1914 lines (1909 loc) · 89.7 KB
/
general-cs-quiz.ts
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
const generalCSQuiz = [
{
Question: "What is the base case in a recursive function?",
Answer:
"The condition under which the recursive function stops calling itself",
Distractor1:
"The condition under which the recursive function starts calling itself",
Distractor2:
"The maximum number of times the recursive function can call itself",
Distractor3: "The initial input value to the recursive function",
Explanation:
"In recursion, the base case is the condition under which the recursive function stops calling itself to prevent an infinite loop. It is crucial for ensuring that the recursion terminates and the program does not run indefinitely.",
Link: "https://www.freecodecamp.org/news/recursion-in-javascript/"
},
{
Question:
"Which of the following is a primary application of computer vision?",
Answer: "Object recognition",
Distractor1: "Word processing",
Distractor2: "Spreadsheet calculations",
Distractor3: "Database management",
Explanation:
"Computer vision primarily deals with enabling machines to interpret and make decisions based on visual data. Object recognition is a fundamental application of computer vision where the system identifies objects within an image or video.",
Link: "https://www.freecodecamp.org/news/computer-vision-js-frameworks-you-need-to-know-b233996103ce/"
},
{
Question:
"What is the average time complexity of an element insertion in a hash table?",
Answer: "O(1)",
Distractor1: "O(logn)",
Distractor2: "O(n)",
Distractor3: "O(n^2)",
Explanation:
"The average time complexity of an element insertion in a hash table is O(1). Unlike arrays, hash tables use a hashing function to generate a unique key or index for each element, ensuring constant time for element insertion.",
Link: "https://www.freecodecamp.org/news/javascript-hash-table-associative-array-hashing-in-js/"
},
{
Question:
"Which of the following methods can be used to solve the N-Queens problem?",
Answer: "Backtracking",
Distractor1: "Greedy Paradigm",
Distractor2: "Divide and Conquer",
Distractor3: "Dynamic Programming",
Explanation:
"Backtracking is used to solve the N-Queens problem based on the condition that no two queens can be present in the same row, column or diagonal.",
Link: "https://youtu.be/A80YzvNwqXA?si=Eue2Exdk1zT2SUm5&t=511"
},
{
Question:
"Which sorting algorithm has an average time complexity of O(nlogn)?",
Answer: "Quick sort",
Distractor1: "Bubble sort",
Distractor2: "Insertion sort",
Distractor3: "Selection sort",
Explanation:
"Quick sort has an average time complexity of O(nlogn), making it efficient for sorting large datasets.",
Link: "https://www.freecodecamp.org/news/sorting-algorithms-explained-with-examples-in-python-java-and-c/#quick-sort"
},
{
Question:
"In a graph, which data structure is best suited for finding the shortest path between two vertices?",
Answer: "Priority Queue",
Distractor1: "Stack",
Distractor2: "String",
Distractor3: "Heap",
Explanation:
"Dijkstra's algorithm, which is used to find the shortest path in a graph, typically employs a priority queue to efficiently select the next vertex with the smallest distance.",
Link: "https://www.freecodecamp.org/news/dijkstras-shortest-path-algorithm-visual-introduction/"
},
{
Question:
"What is the time complexity of inserting an element into a linked list at the beginning?",
Answer: "O(1)",
Distractor1: "O(log n)",
Distractor2: "O(n)",
Distractor3: "O(n2)",
Explanation:
"The time complexity involved to insert a node at the head of the linked list as well as to append at the tail is O(1).",
Link: "https://www.freecodecamp.org/news/data-structures-101-linked-lists-254c82cf5883/"
},
{
Question: "What is the time complexity of Bellman Ford's Algorithm?",
Answer: "O(V*E)",
Distractor1: "O(V)",
Distractor2: "O(E)",
Distractor3: "O(V+E)",
Explanation:
"Bellman Ford's algorithm is a shortest path finding algorithm for graphs that can have negative weights having the optimal time complexity of O(V*E).",
Link: "https://www.freecodecamp.org/news/graph-algorithms-and-data-structures-explained-with-java-and-c-examples/"
},
{
Question: "What is the acceptable range of Balance Factor for an AVL tree?",
Answer: "[-1,1]",
Distractor1: "[0,1]",
Distractor2: "[-1,0]",
Distractor3: "None of the above",
Explanation:
" The self balancing property of an AVL tree is maintained by the balance factor. The value of balance factor should always be -1, 0 or +1",
Link: "https://forum.freecodecamp.org/t/algorithms-avl-trees/297458"
},
{
Question:
"Which approach involves duplicating the argument's value into the function's formal parameter?",
Answer: "Call by Value",
Distractor1: "Call by pointer",
Distractor2: "Call by reference",
Distractor3: "Call by address",
Explanation:
"In the call-by-value approach, a replica of the argument's value is generated, and any modifications made to the formal parameter within the function do not affect the original argument outside of the function, as the function operates on its own isolated copy of the data.",
Link: "https://www.freecodecamp.org/news/understanding-by-reference-vs-by-value-d49139beb1c4/"
},
{
Question:
"Which of the following algorithms is used to find the shortest path between two points in a connected weighted graph?",
Answer: "Kruskal Algorithm",
Distractor1: "Floyd's Tortoise-Hare Algorithm",
Distractor2: "Greedy Algorithms",
Distractor3: "Prims Algorithms",
Explanation:
"Kruskal Algorithm is used to find the shortest path between two points in a connected weighted graph.",
Link: "https://en.wikipedia.org/wiki/Kruskal%27s_algorithm"
},
{
Question: "What does NFC stands for?",
Answer: "Near-Field Communication",
Distractor1: "Narrow Field Communication",
Distractor2: "Near-Fragile Communication",
Distractor3: "Nearly Factory Communication",
Explanation:
"NFC stands for near-field communication and it is the standard for devices to communicate with each other wirelessly from a very close distance.",
Link: "https://www.freecodecamp.org/news/what-is-nfc-near-field-communication-uses-chips-tags-and-readers-explained/"
},
{
Question: "What is the best algorithm for matrix multiplication?",
Answer: "Strassen's Algorithm",
Distractor1: "Multiplication algorithm",
Distractor2: "Divide and Conquer Technique",
Distractor3: "None of the above",
Explanation:
"Strassen's algorithm reduces the number of multiplication and addition in a given matrix and results in a time complexity of O(2.81)",
Link: "https://en.wikipedia.org/wiki/Strassen_algorithm#"
},
{
Question: "Which of the following sorting algorithms is stable in nature?",
Answer: "Merge Sort",
Distractor1: "Heap Sort",
Distractor2: "Quick Sort",
Distractor3: "Selection sort",
Explanation:
"Stable sorting algorithms maintain the relative order of elements with equal values, or keys. Merge sort is stable in nature.",
Link: "https://www.freecodecamp.org/news/sorting-algorithms-explained-with-examples-in-python-java-and-c/#classification-of-a-sorting-algorithm"
},
{
Question:
"Which of the following sorting algorithms has the same best-case and worst-case time complexities?",
Answer: "Merge Sort",
Distractor1: "Bubble Sort",
Distractor2: "Quick Sort",
Distractor3: "Selection sort",
Explanation:
"Merge sort has a time complexity of O(nlogn) in all cases - best, average and worst.",
Link: "https://www.freecodecamp.org/news/merge-sort-algorithm-python-and-java-examples-with-time-complexity/"
},
{
Question: "What is Object-Oriented Programming?",
Answer:
"OOP is a programming pattern that is built around objects or entities.",
Distractor1: "OOP is a topological paradigm to program things",
Distractor2: "OOP is a set of sorting algorithms",
Distractor3: "OOP is a list of Bitwise operators",
Explanation:
"OOP is a programming pattern that is built around objects or entities",
Link: "https://www.freecodecamp.org/news/what-is-object-oriented-programming/"
},
{
Question:
"Which of the following is true regarding division and the bitwise operator?",
Answer:
"Dividing a number by 8 using the bitwise operator is faster than using the / operator",
Distractor1:
"Dividing a number by 8 cannot be implemented using bitwise operator",
Distractor2:
"Dividing a number by 8 using the bitwise operator is slower than using the / operator",
Distractor3: "none of the following options are true",
Explanation:
"When a binary number is shifted to the right 3 times, it will be divided by 8.",
Link: "https://forum.freecodecamp.org/t/javascript-bitwise-operators-explained-with-examples/16153"
},
{
Question: "Which of the following is NOT an in-place sorting algorithm?",
Answer: "Merge Sort",
Distractor1: "Bubble sort",
Distractor2: "Insertion sort",
Distractor3: "Quick sort",
Explanation:
"Merge sort uses the Divide and Conquer paradigm and is not considered an in-place sorting algorithm.",
Link: "https://en.wikipedia.org/wiki/In-place_algorithm"
},
{
Question:
"Which term is used for removing elements from the front of the queue?",
Answer: "Dequeue.",
Distractor1: "Enqueue.",
Distractor2: "Peek.",
Distractor3: "isFull.",
Explanation:
"Dequeue is the term for removing elements from the front of the queue.",
Link: "https://www.freecodecamp.org/news/data-structures-101-queues-a6960a3c98/"
},
{
Question: "Which problems are solved using Bellman Ford's Algorithm?",
Answer: "Single Source Shortest Path",
Distractor1: "All Pair Shortest Path",
Distractor2: "Negative Cycle Detection",
Distractor3: "Minimum Spanning Tree",
Explanation:
"Bellman Ford's algorithm is a shortest path finding algorithm for graphs that can have negative weights.",
Link: "https://www.freecodecamp.org/news/graph-algorithms-and-data-structures-explained-with-java-and-c-examples/"
},
{
Question:
"Which of the following algorithms can be used to determine a minimum spanning tree in a graph?",
Answer: "Boruvka's algorithm",
Distractor1: "Breadth first search",
Distractor2: "Depth first search",
Distractor3: "Binary search",
Explanation:
"Boruvka's algorithm can be used to determine a minimum spanning tree in a graph.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=1229s"
},
{
Question:
"Which of the following is synonymous with an articulation point in a graph?",
Answer: "Cut vertex",
Distractor1: "Cut set",
Distractor2: "Cut edge",
Distractor3: "Leaf node",
Explanation:
"In a graph, an articulation point is the same as a cut vertex.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=1213s"
},
{
Question: "Which of the following is synonymous with a bridge in a graph?",
Answer: "Cut edge",
Distractor1: "Cut set",
Distractor2: "Articulation point",
Distractor3: "Directed edge",
Explanation: "In a graph, a bridge is the same as a cut edge.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=1178s"
},
{
Question:
"Which of the following statements is true for the Traveling salesman problem?",
Answer: "It is an NP-Hard problem.",
Distractor1: "It is an NP-Complete problem.",
Distractor2: "It is an NP problem.",
Distractor3: "It is a P problem.",
Explanation: "Traveling salesman problem is an NP-Hard problem.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=1147s"
},
{
Question:
"Which of the following algorithms can be used for the shortest path problem for an unweighted graph?",
Answer: "Breadth First Search",
Distractor1: "Binary Search",
Distractor2: "Ternary Search",
Distractor3: "Linear Search",
Explanation:
"Breadth First Search can be used for the shortest path problem for an unweighted graph.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=934s"
},
{
Question: "What is SOLID?",
Answer:
"SOLID is an acronym which represents five principles of Object-Oriented design.",
Distractor1: "It's a new type of Hardware",
Distractor2: "New kind of software",
Distractor3: "It's a new group of technologies",
Explanation:
"SOLID is a set of rules and best practices to follow while creating OOP designs.",
Link: "https://www.freecodecamp.org/news/solid-principles-explained-in-plain-english/"
},
{
Question: "Which of the following is true for an adjacency list?",
Answer: "Edge weight lookup is O(E).",
Distractor1: "Edge weight lookup is O(1).",
Distractor2: "Edge weight cannot be specified in adjacency list.",
Distractor3: "It cannot be used to represent a cyclic graph.",
Explanation:
"In an adjacency list, for each node only adjacent nodes are stored in a list",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=682s"
},
{
Question: "Which of the following is true for an adjacency matrix?",
Answer: "It is space efficient for representing dense graphs.",
Distractor1: "It is space efficient for representing sparse graphs.",
Distractor2: "Edge weight lookup is lower bounded by log(n).",
Distractor3: "Space complexity is O(n).",
Explanation: "If a graph is sparse then most spaces are wasted.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=620s"
},
{
Question: "Which of the following is true for a graph?",
Answer: "A graph is bipartite if and only if it is two colorable.",
Distractor1:
"A graph is bipartite if and only if it does not contain an even length cycle.",
Distractor2: "A graph is bipartite if and only if it is three colorable.",
Distractor3:
"A graph is bipartite if and only if it is a directed acyclic graph",
Explanation:
"If a graph is two colorable then the nodes with same color can be grouped together to form two different groups.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=440s"
},
{
Question:
"Which of the following is true for an arborescence in graph theory?",
Answer:
"All arborescence are Directed Acyclic Graphs (DAGs) but not all DAGs are arborescence",
Distractor1: "All DAGs are arborescence but not all arborescence are DAGs.",
Distractor2: "A strongly connected and directed graph is an arborescence.",
Distractor3:
"A graph where the number of edges is twice the number of nodes is arborescence.",
Explanation:
"An arborescence is a directed tree. Hence, it is a directed graph with no cycle. A graph with 4 nodes where three nodes are pointing towards a single node is not an arborescence but a DAG.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=346s"
},
{
Question: "What is an arborescence in graph theory?",
Answer: "A rooted tree in which all edges point away from the root",
Distractor1: "A graph having cycles",
Distractor2: "A strongly connected and directed graph",
Distractor3:
"A graph where the number of edges is twice the number of nodes",
Explanation:
"A tree is rooted if the tree has a designated node called root node such that all edges either points towards the root or points away from the root. And if all edges point away from the root then it is called arborescence.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=346s"
},
{
Question:
"What is the term for when data is being pushed onto a full stack?",
Answer: "Stack Overflow",
Distractor1: "Underflow",
Distractor2: "Garbage Collection",
Distractor3: "Empty collection",
Explanation:
"Stack Overflow happens when there is an attempt to push data on an already full stack.",
Link: "https://www.freecodecamp.org/news/data-structures-101-stacks-696b3282980/"
},
{
Question:
"What is the name for an error where the programmer writes invalid syntax resulting in the program failing to run?",
Answer: "Syntax Error",
Distractor1: "Runtime Error",
Distractor2: "Logical Error",
Distractor3: "Semantic Error",
Explanation:
"A syntax error is when the programmer writes invalid code that violates the rules of that programming language.",
Link: "https://www.youtube.com/watch?v=zOjov-2OZ0E"
},
{
Question:
"Which operation is used to add an item to the back of the queue?",
Answer: "Enqueue",
Distractor1: "Dequeue",
Distractor2: "Peek",
Distractor3: "isFull",
Explanation:
"Enqueue is the operation used to add an item to the back of the queue.",
Link: "https://www.freecodecamp.org/news/queue-data-structure-definition-and-java-example-code/"
},
{
Question: "Which of the following is correct about a tree?",
Answer: "trees are minimally connected.",
Distractor1: "trees can be cyclic.",
Distractor2: "a tree must be an undirected graph",
Distractor3: "trees must have at least two nodes",
Explanation:
"If we remove any edge from a tree, it creates a two disconnected graph",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=306s"
},
{
Question:
"Which of the following is a constraint for Dijkstra's Single Source Shortest Path Algorithm?",
Answer: "The graph must only contain non-negative edge weights.",
Distractor1: "The graph must be acyclic",
Distractor2: "The graph must be a balanced binary tree",
Distractor3: "The graph must have unique edge weights",
Explanation:
"Dijkstra's SSSP algorithm may not work for a graph with negative edge weights. This constraint is to ensure that once a vertex is visited, the optimal distance from source cannot be updated further.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=4832s"
},
{
Question: "Which of the following is the most correct statement?",
Answer: "Topological sort is possible only for a Directed Acyclic Graph",
Distractor1: "Topological sort is just an another name for BFS",
Distractor2: "All undirected graphs have topological ordering",
Distractor3: "A cyclic graph also has topological ordering.",
Explanation:
"The only graph that has valid topological ordering is a Directed Acyclic Graph.",
Link: "https://www.youtube.com/watch?v=09_LlHjoEiY&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=3632s"
},
{
Question: "What is ASCII?",
Answer:
"It is a character encoding standard to represent text in a computer.",
Distractor1: "Algorithm to convert decimal to number in base 65.",
Distractor2: "A protocol in Layer 3 of TCP/IP Suite",
Distractor3: "A unit of throughput for a processor.",
Explanation:
"American Standard Code for Information Interchange (ASCII) is a character encoding standard to represent text in computers.",
Link: "https://www.youtube.com/watch?v=LtoBGQPuu1c&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=406s"
},
{
Question: "Which of the following is true for Big O?",
Answer: "2*logn = O(n)",
Distractor1: "n^2 = O(n)",
Distractor2: "n! = O(n)",
Distractor3: "2^n = O(n)",
Explanation:
"Big O notation describes the upper bound. The function n upper bounds the function 2*logn. However, it is not the tightest upper bound, and in general we always specify the tightest upper bound to quantify an algorithm.",
Link: "https://www.youtube.com/watch?v=RBSGKlAvoiM&list=PLWKjhJtqVAbn5emQ3RRG8gEBqkhf_5vxD&t=5m43s"
},
{
Question:
"Between Merge sort and Quicksort, which sorting algorithm works faster in the case of larger datasets?",
Answer: "Merge sort",
Distractor1:
"testing on speed between the two algorithms has been inconclusive on which one is faster",
Distractor2: "Quicksort",
Distractor3: "Both",
Explanation:
"Merge sort runs quicker than Quick sort in the case of larger datasets.",
Link: "https://forum.freecodecamp.org/t/the-merge-sort-algorithm-explained/16104"
},
{
Question:
"What data structure does a binary search tree degenerate to if it isn't balanced properly?",
Answer: "Linked List",
Distractor1: "Set",
Distractor2: "Queue",
Distractor3: "Dictionary",
Explanation:
"A binary search tree degenerates to a linked list if it is not balanced properly. It is balanced if the height of the left and right subtrees of any node differ by at most one.",
Link: "https://www.freecodecamp.org/news/data-structures-101-binary-search-tree-398267b6bff0/"
},
{
Question: "Which algorithm utilizes a pivot value to sort?",
Answer: "Quick Sort",
Distractor1: "Merge Sort",
Distractor2: "Bubble Sort",
Distractor3: "Insertion Sort",
Explanation:
"Quick sort works by selecting one element (called “the pivot”) and finding the index where the pivot should end up in the sorted array.",
Link: "https://www.freecodecamp.org/news/introduction-to-algorithms-with-javascript-examples/#quick-sort"
},
{
Question:
"Which of these sorting algorithms follows an average case time complexity of order O(nlogn)?",
Answer: "Merge Sort",
Distractor1: "Selection Sort",
Distractor2: "Bubble Sort",
Distractor3: "Insertion Sort",
Explanation:
"The average case time complexity for the merge sort algorithm is O(n log n).",
Link: "https://youtu.be/l7-f9gS8VOs"
},
{
Question:
"Which one of the following terms mean adding an element to the top of the stack?",
Answer: "Push",
Distractor1: "Peek",
Distractor2: "Pop",
Distractor3: "Display",
Explanation:
"The push method is used to add an element to the top of the stack.",
Link: "https://www.youtube.com/watch?v=RBSGKlAvoiM&t=3506s"
},
{
Question:
"Which one of these data structures follows the FIFO(First In First Out) method?",
Answer: "Queues",
Distractor1: "Arrays",
Distractor2: "Trees",
Distractor3: "Stacks",
Explanation:
"A queue is defined as a linear data structure that is open at both ends and the operations are performed in First In First Out (FIFO) order.",
Link: "https://www.youtube.com/watch?v=RBSGKlAvoiM&t=4558s"
},
{
Question: "What is the basic language of a computer?",
Answer: "Binary",
Distractor1: "HyperText Markup Language",
Distractor2: "Cascading Style Sheets",
Distractor3: "JavaScript",
Explanation:
"Computers are simplistic and understand binary. Programming languages such as Python and Java were created to help humans write instructions for computers and interpret it.",
Link: "https://youtu.be/F0WoVEr0-44?t=336"
},
{
Question:
"Which one of these is NOT a common time complexity equation for Big O notation?",
Answer: "O(n14)",
Distractor1: "O(1)",
Distractor2: "O(log n)",
Distractor3: "O(n)",
Explanation:
"O(1), O(log n), O(n) are just some of the common time complexity equations for Big O notation.",
Link: "https://www.youtube.com/watch?v=zg9ih6SVACc&t=867s"
},
{
Question: "What is Big O Notation?",
Answer: "A way to measure the performance and efficiency of an algorithm.",
Distractor1: "A way to notate changes from the server.",
Distractor2: "A way to notate the different types in a file system.",
Distractor3: "A way to notate the different elements in an array.",
Explanation:
"Big O notation is a way to measure the performance of an algorithm.",
Link: "https://www.freecodecamp.org/news/learn-big-o-notation/"
},
{
Question:
"What is the worst case time complexity for accessing an element in a BST(Binary Search Tree)?",
Answer: "O(n)",
Distractor1: "O(n*logn)",
Distractor2: "O(n*n)",
Distractor3: "O(logn)",
Explanation:
"The worst case time complexity would be O(n) because we might need to visit all of the nodes.",
Link: "https://www.freecodecamp.org/news/binary-search-tree-what-is-it/"
},
{
Question: "What is the Design Thinking Process?",
Answer:
"A process to come up with creative, user centric solutions to complex problems.",
Distractor1: "A process to fix computers.",
Distractor2: "A process to design mockups.",
Distractor3: "A process to troubleshoot Windows applications.",
Explanation:
"The Design Thinking Process is a way to come up with creative, user centric solutions to complex problems.",
Link: "https://www.freecodecamp.org/news/the-design-thinking-process-explained/"
},
{
Question:
"Which of the following data structures is used to convert an infix expression to a postfix expression?",
Answer: "Stacks",
Distractor1: "Queues",
Distractor2: "Priority Queues",
Distractor3: "LinkedList",
Explanation:
"A stack is the most suitable data structure for converting an infix expression to a postfix expression",
Link: "https://youtu.be/B31LgI4Y4DQ?t=13587"
},
{
Question:
"Which of the following techniques is implemented to improve CPU performance?",
Answer: "Pipelining",
Distractor1: "Encoding",
Distractor2: "Ratelimiting",
Distractor3: "None of these",
Explanation:
"A substantial improvement in performance can be achieved by overlapping the execution of successive instructions,using a technique called pipelining ",
Link: "https://cs.stanford.edu/people/eroberts/courses/soco/projects/risc/pipelining/index.html"
},
{
Question:
"Which one of these data structures follows the LIFO(Last In First Out) method?",
Answer: "Stacks",
Distractor1: "Priority Queues",
Distractor2: "Trees",
Distractor3: "Queues",
Explanation:
"A stack is a linear data structure that uses the LIFO(Last In First Out) method.",
Link: "https://youtu.be/RBSGKlAvoiM?t=3567"
},
{
Question: "Which of the following is a Divide and Conquer algorithm?",
Answer: "Merge Sort",
Distractor1: "Selection Sort",
Distractor2: "Heap Sort",
Distractor3: "Bubble Sort",
Explanation:
"Merge Sort recursively splits the array into smaller arrays, sorts those arrays and merges them into one sorted array.",
Link: "https://www.freecodecamp.org/news/an-intro-to-advanced-sorting-algorithms-merge-quick-radix-sort-in-javascript-b65842194597/"
},
{
Question: "Which of the following is correct for arrays?",
Answer: "Size of an array can not be changed once initialized",
Distractor1:
"Insertion and deletion of elements has a time complexity of O(1)",
Distractor2: "A single array can contain data of different data types",
Distractor3: "It can only be one-dimensional",
Explanation:
"When you create an array, you are allocated a block of contiguous memory and in order to change it's size, you will have to create a new array.",
Link: "https://youtu.be/zg9ih6SVACc?t=1470"
},
{
Question: "What is a first class function?",
Answer: "The ability to send and receive functions like values.",
Distractor1: "Functions with higher priority than others.",
Distractor2: "Functions declared in classes",
Distractor3: "Functions that only return numbers",
Explanation:
"If functions can be sent and received just like values, than that language is said to have first class functions. They are also called first class citizens.",
Link: "https://www.freecodecamp.org/news/discover-the-power-of-first-class-functions-fd0d7b599b69/"
},
{
Question: "What are parallel arrays?",
Answer:
"two or more arrays that contain the same number of elements and have corresponding values in the same position",
Distractor1: "arrays that only hold strings",
Distractor2: "arrays that only hold numbers",
Distractor3: "a special type of nested arrays",
Explanation:
"Parallel arrays contain the same number of elements and have corresponding values in the same position.",
Link: "https://www.youtube.com/watch?v=zg9ih6SVACc&t=1379s"
},
{
Question: "What is a bug?",
Answer:
"An error in a computer program that causes it to generate an incorrect or unexpected result or output.",
Distractor1: "A programming paradigm. ",
Distractor2:
"A programming structure that repeats a block of code a given number of times",
Distractor3: "This concept is not related to programming at all.",
Explanation:
"A bug is an error in a computer program that causes it to generate an incorrect or unexpected result or output. The process of finding and fixing bugs is known as debugging.",
Link: "https://en.wikipedia.org/wiki/Software_bug"
},
{
Question: "What is a Floating point number?",
Answer: "A number with a decimal point",
Distractor1: "A number greater than 100",
Distractor2: "A number less than 0",
Distractor3: "A number that is divisible by 3",
Explanation: "A floating point number is a number with a decimal point.",
Link: "https://www.freecodecamp.org/news/floating-point-definition/"
},
{
Question: "How many bytes make up a Zettabyte?",
Answer: "1 sextillion bytes",
Distractor1: "1 hundred bytes",
Distractor2: "1 thousand bytes",
Distractor3: "1 million bytes",
Explanation: "A Zettabyte is composed of 1 sextillion bytes",
Link: "https://www.freecodecamp.org/news/zettabyte-definition/"
},
{
Question:
"The process of finding and fixing bugs in a computer program is known as...",
Answer: "Debugging",
Distractor1: "Encapsulation",
Distractor2: "Abstraction",
Distractor3: "Looping",
Explanation:
"Debugging is the process of finding and fixing bugs in a computer program. ",
Link: "https://en.wikipedia.org/wiki/Debugging"
},
{
Question: "How many bytes make up a Terabyte?",
Answer: "1 trillion bytes",
Distractor1: "1 billion bytes",
Distractor2: "1 thousand bytes",
Distractor3: "1 million bytes",
Explanation: "A Terabyte is composed of 1 trillion bytes",
Link: "https://www.freecodecamp.org/news/terabyte-definition/"
},
{
Question: "What is a server?",
Answer: "A software or hardware device that sends data over a network",
Distractor1: "A Python library",
Distractor2: "A type of compiler",
Distractor3: "An IDE",
Explanation:
"A server is a software or hardware device that sends data over a network",
Link: "https://www.freecodecamp.org/news/server-definition/"
},
{
Question: "The values that an operator operates on are known as...",
Answer: "Operands",
Distractor1: "Operators",
Distractor2: "Operative",
Distractor3: "Operation",
Explanation:
"The values that an operator operates on are known as operands.",
Link: "https://en.wikipedia.org/wiki/Operand"
},
{
Question: "What is an algorithm?",
Answer:
"A sequence of detailed step-by-step instructions to complete a task.",
Distractor1: "A programming paradigm.",
Distractor2: "A Python module.",
Distractor3: "A web development framework.",
Explanation:
"An algorithm is a sequence of detailed step-by-step instructions to complete a task.",
Link: "https://www.freecodecamp.org/news/algorithms-explained-what-they-are-and-common-sorting-algorithms/"
},
{
Question: "How many bits make up a byte?",
Answer: "8 bits",
Distractor1: "16 bits",
Distractor2: "32 bits",
Distractor3: "12 bits",
Explanation: "There are 8 bits in a byte",
Link: "https://www.freecodecamp.org/news/byte-definition/"
},
{
Question: "What is an operating system?",
Answer: "Manages the hardware and software components of a computer",
Distractor1: "A program that translates code from one languages to another",
Distractor2: "A system that converts data into machine code",
Distractor3: "A base 2 numerical system made up of 0's and 1's",
Explanation:
"An operating system manages the hardware and software components of a computer.",
Link: "https://www.freecodecamp.org/news/what-is-a-pc-computer-definition-and-computer-basics-for-beginners/"
},
{
Question: "How many bytes make up a Exabyte?",
Answer: "1 quintillion bytes",
Distractor1: "1 billion bytes",
Distractor2: "1 trillion bytes",
Distractor3: "1 thousand bytes",
Explanation: "A Exabyte is composed of 1 quintillion bytes",
Link: "https://www.freecodecamp.org/news/exabyte-definition/"
},
{
Question: "What does API stand for?",
Answer: "Application Programming Interface",
Distractor1: "Apple Pie Inside",
Distractor2: "Application Program Interface",
Distractor3: "Another Program Interface",
Explanation: "API stands for Application Programming Interface.",
Link: "https://www.freecodecamp.org/news/what-does-api-stand-for-a-definition-of-the-coding-acronym-in-plain-english/"
},
{
Question: "How many bytes make up a Gigabyte?",
Answer: "1 billion bytes",
Distractor1: "1 quintillion bytes",
Distractor2: "1 trillion bytes",
Distractor3: "1 hundred bytes",
Explanation: "A Gigabyte is composed of 1 billion bytes",
Link: "https://www.freecodecamp.org/news/gigabyte-definition/"
},
{
Question:
"Select the type of loop that repeats a sequence of instructions an unknown number of times while a condition is True. ",
Answer: "While loop",
Distractor1: "For loop",
Distractor2: "Infinite loop",
Distractor3: "Circular loop",
Explanation:
"While loops repeat a block of code an unknown number of times while a condition is True and they stop when the condition is False. ",
Link: "https://www.freecodecamp.org/news/python-while-loop-tutorial/"
},
{
Question: "How many bytes make up a Yottabyte?",
Answer: "1 septillion bytes",
Distractor1: "1 thousand bytes",
Distractor2: "1 million bytes",
Distractor3: "1 billion bytes",
Explanation: "A Yottabyte is made up of 1 septillion bytes",
Link: "https://www.freecodecamp.org/news/yottabyte-definition/"
},
{
Question: "How many bytes make up a Kilobyte?",
Answer: "1,000 bytes",
Distractor1: "100 bytes",
Distractor2: "10 bytes",
Distractor3: "1 byte",
Explanation: "A Kilobyte is composed of 1,000 bytes",
Link: "https://www.freecodecamp.org/news/kilobyte-definition/"
},
{
Question: "What is a bit?",
Answer: "Smallest form of data on a computer",
Distractor1: "Structured assembly language ",
Distractor2: "A special type of file system",
Distractor3: "A special type of object",
Explanation:
'A binary digit or "bit" is the smallest form of data on a computer',
Link: "https://www.freecodecamp.org/news/bit-definition/"
},
{
Question: "What is RAM?",
Answer:
"A type of short term memory that stores data that computer processors need access to",
Distractor1: "A type of memory that computers use to call servers",
Distractor2: "A type of memory that computers use to delete data",
Distractor3:
"A type of memory that computers use to connect with other devices",
Explanation:
"Random Access Memory is a type of short term memory that stores data that computer processors can access frequently.",
Link: "https://www.freecodecamp.org/news/ram-definition/"
},
{
Question: "What unit is used to measure the speed of a CPU?",
Answer: "GHz (gigahertz)",
Distractor1: "MHz (megahertz)",
Distractor2: "kHz (kilohertz)",
Distractor3: "THz (terahertz)",
Explanation:
"The speed of a computer is determined by its clock cycle. The clock speed measures the number of cycles the CPU executes per second. Hertz is a unit of frequency. The CPU clock cycle is measured in GHz (gigahertz). 1GHz is equal to 10 ⁹ Hz (hertz).So 1Gigahertz means 10 ⁹ cycles per second.",
Link: "https://www.freecodecamp.org/news/how-does-a-cpu-work/"
},
{
Question:
"Each one of the alternative sequence of statements in a conditional statement is known as...",
Answer: "Branch",
Distractor1: "Decision",
Distractor2: "Path",
Distractor3: "Loop",
Explanation:
"Each one of the alternative sequence of statements in a conditional statement is known as a branch.",
Link: "https://www.freecodecamp.org/news/python-if-else-statement-conditional-statements-explained/"
},
{
Question: "What is an infinite loop?",
Answer:
"A loop that will continue endlessly unless an external intervention stops its execution. ",
Distractor1: "A loop that only completes two iterations.",
Distractor2:
"A loop that cannot be stopped, even with external intervention. ",
Distractor3: "A loop that never runs.",
Explanation:
"An infinite loop is a loop whose condition is always true, so it will continue running endlessly unless there is some external intervention to stop it.",
Link: "https://www.freecodecamp.org/news/python-while-loop-tutorial/"
},
{
Question: "What is pair programming?",
Answer: "Two people coding together on one computer",
Distractor1: "One person coding on two computers at the same time",
Distractor2:
"Programming on a non-Apple computer (also known as pear programming)",
Distractor3: "Programming where you use each data structure twice",
Explanation:
'When Pair Programming, one developer is the "driver" with their hands on the keyboard. The other is the "navigator" helping talk through the problem and decide what to do. They periodically switch roles. This is an efficient and commonly used Agile Software Development methodology.',
Link: "https://www.freecodecamp.org/news/want-to-be-a-developer-you-should-probably-be-pair-programming-2c6ec12c4866/"
},
{
Question: "What does CPU stand for?",
Answer: "Central Processing Unit",
Distractor1: "Central Protocol Unit",
Distractor2: "Central Programming Unit",
Distractor3: "Control Processing Unit",
Explanation:
"CPU stands for Central Processing Unit which performs logic computations for the program.",
Link: "https://www.freecodecamp.org/news/what-is-cpu-meaning-definition-and-what-cpu-stands-for/"
},
{
Question: "How many bytes make up a Petabyte?",
Answer: "1 quadrillion bytes",
Distractor1: "1 quintillion bytes",
Distractor2: "1 hundred bytes",
Distractor3: "1 million bytes",
Explanation: "A Petabyte is composed of 1 quadrillion bytes",
Link: "https://www.freecodecamp.org/news/petabyte-definition/"
},
{
Question: "What is a Boolean?",
Answer: "A data type representing a true or false value.",
Distractor1: "A data type representing a number.",
Distractor2: "A programming language.",
Distractor3: "A Python library.",
Explanation:
"In computer science, a Boolean is a data type which only has two possible values of true or false.",
Link: "https://www.freecodecamp.org/news/boolean-definition/"
},
{
Question: "What is a virtual machine?",
Answer: "A computer inside another computer",
Distractor1: "a popular JavaScript library",
Distractor2: "a Linux distribution",
Distractor3: "another name for a compiler",
Explanation:
"A virtual machine is a program you run on a computer that acts like it is a separate computer. It is basically a way to create a computer within a computer.",
Link: "https://www.freecodecamp.org/news/what-is-a-virtual-machine-and-how-to-setup-a-vm-on-windows-linux-and-mac/"
},
{
Question: "What is a password?",
Answer: "A secret set of characters",
Distractor1: "A way to request data from a server",
Distractor2: "A special type of computer memory",
Distractor3: "A type of array",
Explanation:
"A password is a secret set of characters used to login in to applications",
Link: "https://www.freecodecamp.org/news/password-definition/"
},
{
Question:
"A special symbol used to perform arithmetic or logical computations is known as...",
Answer: "Operator",
Distractor1: "Operand",
Distractor2: "Operation",
Distractor3: "Operative",
Explanation:
"A special symbol used to perform arithmetic or logical computations is known as operator.",
Link: "https://en.wikipedia.org/wiki/Operator_(computer_programming)"
},
{
Question: "Which one is NOT a popular operating system for computers?",
Answer: "PASSIM",
Distractor1: "Microsoft Windows",
Distractor2: "macOS",
Distractor3: "Linux",
Explanation:
"Linux, Microsoft Windows and macOS are three popular operating systems used by developers.",
Link: "https://www.freecodecamp.org/news/what-is-a-pc-computer-definition-and-computer-basics-for-beginners/"
},
{
Question: "What is RGB?",
Answer: "A color model",
Distractor1: "An Internet Protocol",
Distractor2: "HTML syntax",
Distractor3: "A secret password",
Explanation:
"RGB is an acronym that stands for Red Green Blue. It expresses colors in terms of the amount of red, green, and blue they are made up of and uses a human counting system with integers ranging from 0-255 or a percentage ranging from (0% - 100%).",
Link: "https://www.freecodecamp.org/news/rgb-color-html-and-css-guide/"
},
{
Question:
"Fonts that are generally available across most browsers and operating systems are known as...",
Answer: "Web safe fonts",
Distractor1: "General fonts",
Distractor2: "Universal fonts",
Distractor3: "Web Fonts",
Explanation:
"Web safe fonts are the fonts that are generally available across most browsers and operating systems.",
Link: "https://www.freecodecamp.org/news/web-safe-fonts/"
},
{
Question: "What does GIF stand for?",
Answer: "Graphics Interchange Format",
Distractor1: "Graphical International Format",
Distractor2: "Graphical Interconnected Functions",
Distractor3: "General Interchange Format",
Explanation: "GIF stands for Graphics Interchange Format.",
Link: "https://www.freecodecamp.org/news/how-to-make-a-gif-create-animated-gifs-without-downloading-software/#:~:text=A%20GIF%20(Graphics%20Interchange%20Format,with%20your%20friends%20and%20family."
},
{
Question: "When was the World Wide Web invented?",
Answer: "1989",
Distractor1: "1990",
Distractor2: "1995",
Distractor3: "2005",
Explanation: "Tim Berners-Lee invented the World Wide Web in 1989.",
Link: "https://en.wikipedia.org/wiki/World_Wide_Web"
},
{
Question: "What does DOM stand for?",
Answer: "Document Object Model",
Distractor1: "Direct Object Model",
Distractor2: "Document Objective Model",
Distractor3: "Documentary Object Mobile",
Explanation: "DOM stands for Document Object Model.",
Link: "https://www.freecodecamp.org/news/what-is-the-dom-document-object-model-meaning-in-javascript/#:~:text=DOM%20stands%20for%20Document%20Object,remove%20elements%20from%20the%20document."
},
{
Question: "What does PNG stand for?",
Answer: "Portable Network Graphics",
Distractor1: "Portable New Graphics",
Distractor2: "Premium Network Graphics",
Distractor3: "Portable Network Green",
Explanation: "PNG stands for Portable Network Graphics.",
Link: "https://en.wikipedia.org/wiki/Portable_Network_Graphics"
},
{
Question: "What color would rgb(255,255,255) give?",
Answer: "White",
Distractor1: "Red",
Distractor2: "Black",
Distractor3: "Blue",
Explanation:
"The maximum value of 255 represents that the full amount of all colors and their full intensity is on display.",
Link: "https://www.freecodecamp.org/news/rgb-color-html-and-css-guide/"
},
{
Question:
"The rules that determine the correct structure of the code in a computer program are known as...",
Answer: "Syntax",
Distractor1: "Semantics",
Distractor2: "Interpreter",
Distractor3: "Compiler",
Explanation:
"The rules that determine the correct structure of the code in a computer program are known as syntax.",
Link: "https://en.wikipedia.org/wiki/Syntax_(programming_languages)"
},
{
Question: "What do R, G, and B in RGB stand for?",
Answer: "Red, green, and blue",
Distractor1: "Red, gray, and black ",
Distractor2: "Red, green, and black",
Distractor3: "Red, gray, and blue",
Explanation: "RGB is an acronym that stands for Red Green Blue",
Link: "https://www.freecodecamp.org/news/rgb-color-html-and-css-guide/"
},
{
Question: "What does a CPU do?",
Answer: "A CPU executes commands from a computer program",
Distractor1: "Writes code for developers",
Distractor2: "Displays images and text on screen",