-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestions.py
1462 lines (1101 loc) · 65.3 KB
/
questions.py
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
# Quiz questions
quiz_data = [
{"question": "What is the output of `print(2**3)`?",
"options": ["6", "8", "9", "12"], "answer": "8", "tech": "python", "tech": "python"},
{"question": "Which data type is mutable in Python?",
"options": ["tuple", "string", "list", "int"], "answer": "list", "tech": "python", "tech": "python"},
{"question": "What does `len()` do in Python?",
"options": ["Finds length", "Sorts list", "Checks type", "Converts type"], "answer": "Finds length", "tech": "python", "tech": "python"},
{"question": "Which keyword is used to create a function in Python?",
"options": ["function", "define", "def", "lambda"], "answer": "def", "tech": "python", "tech": "python"},
{"question": "What is the time complexity of accessing an element in a dictionary?",
"options": ["O(1)", "O(n)", "O(log n)", "O(n^2)"], "answer": "O(1)", "tech": "python", "tech": "python"},
{"question": "What is the output of `[1,2,3] + [4,5,6]`?",
"options": ["[1,2,3,4,5,6]", "[1,2,3],[4,5,6]", "Error", "[5,7,9]"],
"answer": "[1,2,3,4,5,6]", "tech": "python", "tech": "python"},
{"question": "Which method adds an element to the end of a list?",
"options": ["append()", "extend()", "insert()", "add()"],
"answer": "append()", "tech": "python"},
{"question": "What is the output of `[1,2,3].pop()`?",
"options": ["1", "2", "3", "[1,2]"],
"answer": "3", "tech": "python"},
{"question": "How do you get the length of list `my_list`?",
"options": ["my_list.length()", "my_list.size()", "len(my_list)", "size(my_list)"],
"answer": "len(my_list)", "tech": "python"},
{"question": "What is the time complexity of `list.append()`?",
"options": ["O(1)", "O(n)", "O(log n)", "O(n^2)"],
"answer": "O(1)", "tech": "python"},
{"question": "How do you access the last element of list `lst`?",
"options": ["lst[-1]", "lst[end]", "lst[len(lst)]", "lst.last()"],
"answer": "lst[-1]", "tech": "python"},
{"question": "What does `lst.extend([4,5])` do?",
"options": ["Adds [4,5] as one element", "Adds 4 and 5 individually", "Creates new list", "Raises error"],
"answer": "Adds 4 and 5 individually", "tech": "python"},
{"question": "What is the output of `[x*2 for x in [1,2,3]]`?",
"options": ["[2,4,6]", "[1,2,3,1,2,3]", "[1,4,9]", "Error"],
"answer": "[2,4,6]", "tech": "python"},
{"question": "How do you remove first occurrence of value 'x' from list?",
"options": ["list.remove('x')", "list.pop('x')", "list.delete('x')", "del list['x']"],
"answer": "list.remove('x')", "tech": "python"},
{"question": "What is `lst[::2]`?",
"options": ["Every second element", "First two elements", "Last two elements", "Middle elements"],
"answer": "Every second element", "tech": "python"},
{"question": "What is the output of `[1,2,3].index(2)`?",
"options": ["1", "2", "3", "Error"],
"answer": "1", "tech": "python"},
{"question": "How do you reverse a list in place?",
"options": ["list.reverse()", "reversed(list)", "list[::-1]", "list.sort(reverse=True)"],
"answer": "list.reverse()", "tech": "python"},
{"question": "What is the output of `list('python')`?",
"options": ["['p','y','t','h','o','n']", "'python'", "['python']", "Error"],
"answer": "['p','y','t','h','o','n']", "tech": "python"},
{"question": "Which creates empty list?",
"options": ["[]", "list()", "Both A and B", "None"],
"answer": "Both A and B", "tech": "python"},
{"question": "What is the time complexity of `in` operator for lists?",
"options": ["O(n)", "O(1)", "O(log n)", "O(n^2)"],
"answer": "O(n)", "tech": "python"},
{"question": "What does `sorted(lst)` return?",
"options": ["New sorted list", "None", "Original list sorted", "Error"],
"answer": "New sorted list", "tech": "python"},
{"question": "How to get first 3 elements of list?",
"options": ["lst[:3]", "lst[0:3]", "Both A and B", "lst[3]"],
"answer": "Both A and B", "tech": "python"},
{"question": "What is `[0] * 3`?",
"options": ["[0,0,0]", "[3]", "[0]", "Error"],
"answer": "[0,0,0]", "tech": "python"},
{"question": "How to check if list is empty?",
"options": ["if not lst:", "if lst == []", "Both A and B", "if lst.empty()"],
"answer": "Both A and B", "tech": "python"},
{"question": "What does `del lst[1:3]` do?",
"options": ["Removes elements 1 through 2", "Removes elements 1 through 3", "Removes first 3 elements", "Removes last element"],
"answer": "Removes elements 1 through 2", "tech": "python"},
{"question": "What is the output of `{'a':1, 'b':2}.keys()`?",
"options": ["['a', 'b']", "('a', 'b')", "dict_keys(['a', 'b'])", "{a, b}"],
"answer": "dict_keys(['a', 'b'])", "tech": "python"},
{"question": "How do you create an empty dictionary?",
"options": ["{}", "dict()", "Both A and B", "[]"],
"answer": "Both A and B", "tech": "python"},
{"question": "What is the time complexity of dictionary lookup?",
"options": ["O(1)", "O(n)", "O(log n)", "O(n^2)"],
"answer": "O(1)", "tech": "python"},
{"question": "What happens if you access missing key without get()?",
"options": ["KeyError", "None", "False", "Empty string"],
"answer": "KeyError", "tech": "python"},
{"question": "What does `dict.get(key, default)` do?",
"options": ["Returns default if key missing", "Raises error", "Always returns default", "Returns None"],
"answer": "Returns default if key missing", "tech": "python"},
{"question": "How to merge two dictionaries in Python 3.9+?",
"options": ["dict1 | dict2", "dict1 + dict2", "dict1.merge(dict2)", "dict1.update(dict2)"],
"answer": "dict1 | dict2", "tech": "python"},
{"question": "What is `{x:x*2 for x in range(3)}`?",
"options": ["{0:0, 1:2, 2:4}", "[0,2,4]", "{0,2,4}", "Error"],
"answer": "{0:0, 1:2, 2:4}", "tech": "python"},
{"question": "How to remove key 'k' from dictionary?",
"options": ["del dict['k']", "dict.remove('k')", "dict.pop('k')", "Both A and C"],
"answer": "Both A and C", "tech": "python"},
{"question": "What method returns (key,value) pairs?",
"options": ["items()", "pairs()", "elements()", "values()"],
"answer": "items()", "tech": "python"},
{"question": "What is `dict.setdefault(key,val)` used for?",
"options": ["Set default if key missing", "Always set value", "Remove key", "Check if key exists"],
"answer": "Set default if key missing", "tech": "python"},
{"question": "How to check if key exists in dict?",
"options": ["key in dict", "dict.has_key(key)", "dict.contains(key)", "key.exists(dict)"],
"answer": "key in dict", "tech": "python"},
{"question": "What happens: `dict1.update(dict2)`?",
"options": ["Updates dict1 in place", "Creates new dict", "Returns merged dict", "Updates dict2"],
"answer": "Updates dict1 in place", "tech": "python"},
{"question": "Valid dictionary key types include:",
"options": ["str,int,tuple", "list,set,dict", "None,bool,float", "All mentioned"],
"answer": "str,int,tuple", "tech": "python"},
{"question": "What is `dict.fromkeys(['a','b'], 0)`?",
"options": ["{'a':0, 'b':0}", "['a','b']", "{0:'a', 1:'b'}", "Error"],
"answer": "{'a':0, 'b':0}", "tech": "python"},
{"question": "How to get all values from dict?",
"options": ["dict.values()", "dict.get()", "dict.items()", "dict.keys()"],
"answer": "dict.values()", "tech": "python"},
{"question": "What happens: `dict[missing_key] = val`?",
"options": ["Adds new key-value", "Raises error", "Returns None", "Updates existing"],
"answer": "Adds new key-value", "tech": "python"},
{"question": "Best way to copy a dictionary?",
"options": ["dict.copy()", "dict[:]", "dict()", "list(dict)"],
"answer": "dict.copy()", "tech": "python"},
{"question": "What is `{**dict1, **dict2}`?",
"options": ["Merges dictionaries", "Creates tuple", "Raises error", "Creates set"],
"answer": "Merges dictionaries", "tech": "python"},
{"question": "Time complexity of `key in dict`?",
"options": ["O(1)", "O(n)", "O(log n)", "O(n^2)"],
"answer": "O(1)", "tech": "python"},
{"question": "What does `dict.clear()` return?",
"options": ["None", "Empty dict", "Original dict", "Error"],
"answer": "None", "tech": "python"},
{"question": "What is the output of `1 if True else 0`?",
"options": ["1", "0", "True", "Error"],
"answer": "1", "tech": "python"},
{"question": "Which statement exits a loop completely?",
"options": ["break", "continue", "pass", "return"],
"answer": "break", "tech": "python"},
{"question": "What does `while True:` create?",
"options": ["Infinite loop", "Single iteration", "Syntax error", "Empty loop"],
"answer": "Infinite loop", "tech": "python"},
{"question": "Which is valid in a for loop?",
"options": ["else clause", "elif clause", "case clause", "when clause"],
"answer": "else clause", "tech": "python"},
{"question": "What does `pass` do?",
"options": ["Nothing", "Breaks loop", "Continues loop", "Raises error"],
"answer": "Nothing", "tech": "python"},
{"question": "Which creates a generator?",
"options": ["yield keyword", "gen()", "make_generator()", "create()"],
"answer": "yield keyword", "tech": "python"},
{"question": "What does `try/finally` ensure?",
"options": ["Cleanup code runs", "No errors occur", "Better performance", "Multiple attempts"],
"answer": "Cleanup code runs", "tech": "python"},
{"question": "Which is correct ternary syntax?",
"options": ["a if b else c", "if b then a else c", "b ? a : c", "if b: a else: c"],
"answer": "a if b else c", "tech": "python"},
{"question": "What catches all exceptions?",
"options": ["except:", "except *:", "except all:", "except Exception:"],
"answer": "except:", "tech": "python"},
{"question": "Valid context manager keyword?",
"options": ["with", "using", "context", "manage"],
"answer": "with", "tech": "python"},
{"question": "What does `else` in try/except do?",
"options": ["Runs if no exception", "Always runs", "Runs on error", "Never runs"],
"answer": "Runs if no exception", "tech": "python"},
{"question": "Which is not a loop control?",
"options": ["skip", "break", "continue", "pass"],
"answer": "skip", "tech": "python"},
{"question": "What creates list comprehension?",
"options": ["Square brackets", "Parentheses", "Curly braces", "Angle brackets"],
"answer": "Square brackets", "tech": "python"},
{"question": "When does `finally` run?",
"options": ["Always", "On success", "On error", "Never"],
"answer": "Always", "tech": "python"},
{"question": "Valid in match/case statement?",
"options": ["case _:", "default:", "else:", "otherwise:"],
"answer": "case _:", "tech": "python"},
{"question": "How to skip loop iteration?",
"options": ["continue", "skip", "next", "pass"],
"answer": "continue", "tech": "python"},
{"question": "What does `for/else` do?",
"options": ["Runs if no break", "Always runs", "Never runs", "Runs on break"],
"answer": "Runs if no break", "tech": "python"},
{"question": "Which checks multiple conditions?",
"options": ["elif", "else if", "otherwise", "or if"],
"answer": "elif", "tech": "python"},
{"question": "Generator expression uses:",
"options": ["Parentheses", "Square brackets", "Curly braces", "Angle brackets"],
"answer": "Parentheses", "tech": "python"},
{"question": "Valid way to raise error?",
"options": ["raise ValueError", "throw ValueError", "error ValueError", "except ValueError"],
"answer": "raise ValueError", "tech": "python"},
{"question": "What does `*args` in a function do?",
"options": ["Accepts multiple positional args", "Accepts keyword args", "Marks as private", "Creates generator"],
"answer": "Accepts multiple positional args", "tech": "python"},
{"question": "Which creates a lambda function?",
"options": ["lambda x: x*2", "def lambda(x): x*2", "function(x): x*2", "anonymous(x): x*2"],
"answer": "lambda x: x*2", "tech": "python"},
{"question": "What's the purpose of `**kwargs`?",
"options": ["Accept keyword arguments", "Unpack dictionary", "Both A and B", "Create dictionary"],
"answer": "Both A and B", "tech": "python"},
{"question": "How to document a function?",
"options": ["Docstring", "# comments", "/** */", "<!-- -->"],
"answer": "Docstring", "tech": "python"},
{"question": "Valid function return types:",
"options": ["Any Python object", "Only one value", "Maximum two values", "Numbers only"],
"answer": "Any Python object", "tech": "python"},
{"question": "What is a decorator?",
"options": ["Function modifier", "Class creator", "Variable type", "Import statement"],
"answer": "Function modifier", "tech": "python"},
{"question": "Default arguments are evaluated:",
"options": ["At definition time", "At runtime", "When called", "Never"],
"answer": "At definition time", "tech": "python"},
{"question": "Purpose of `global` keyword?",
"options": ["Modify global variable", "Create global", "Import global", "Delete global"],
"answer": "Modify global variable", "tech": "python"},
{"question": "What does `return` alone do?",
"options": ["Returns None", "Error", "Exits program", "Continues execution"],
"answer": "Returns None", "tech": "python"},
{"question": "Function type hints use:",
"options": ["-> notation", "@ notation", "# notation", "$ notation"],
"answer": "-> notation", "tech": "python"},
{"question": "What creates closure?",
"options": ["Nested function", "Class method", "Global variable", "Module import"],
"answer": "Nested function", "tech": "python"},
{"question": "Valid decorator syntax:",
"options": ["@decorator", "@(decorator)", "decorator@", "#decorator"],
"answer": "@decorator", "tech": "python"},
{"question": "Purpose of `nonlocal`?",
"options": ["Modify enclosing scope", "Create global", "Import function", "Delete variable"],
"answer": "Modify enclosing scope", "tech": "python"},
{"question": "What is `func.__name__`?",
"options": ["Function name string", "Memory address", "Return value", "Documentation"],
"answer": "Function name string", "tech": "python"},
{"question": "How to unpack arguments?",
"options": ["*list, **dict", "*args", "**kwargs", "unpack()"],
"answer": "*list, **dict", "tech": "python"},
{"question": "First class functions can:",
"options": ["Be passed as args", "Be declared only", "Not be assigned", "Not be returned"],
"answer": "Be passed as args", "tech": "python"},
{"question": "Purpose of `partial()`?",
"options": ["Fix some arguments", "Split function", "Merge functions", "Delete function"],
"answer": "Fix some arguments", "tech": "python"},
{"question": "Valid in function body:",
"options": ["yield", "async", "Both A and B", "None"],
"answer": "Both A and B", "tech": "python"},
{"question": "What is recursion limit?",
"options": ["1000 by default", "100 by default", "Unlimited", "System dependent"],
"answer": "1000 by default", "tech": "python"},
{"question": "Purpose of __call__?",
"options": ["Make object callable", "Create function", "Delete function", "Rename function"],
"answer": "Make object callable", "tech": "python"}
]
# quiz_data2 = [{**q, "tech": "python"} for q in quiz_data]
#
git1_questions = [
{"question": "What Git command creates a new repository?",
"options": ["git init", "git start", "git create", "git new"],
"answer": "git init", "tech": "github"},
{"question": "How do you clone a repository?",
"options": ["git clone <url>", "git copy <url>", "git download <url>", "git pull <url>"],
"answer": "git clone <url>", "tech": "github"},
{"question": "What command shows commit history?",
"options": ["git log", "git history", "git show", "git commits"],
"answer": "git log", "tech": "github"},
{"question": "How to stage all changes?",
"options": ["git add .", "git stage all", "git commit all", "git push all"],
"answer": "git add .", "tech": "github"},
{"question": "What creates a new branch?",
"options": ["git branch <name>", "git new branch", "git create <name>", "git checkout new"],
"answer": "git branch <name>", "tech": "github"},
{"question": "How to switch branches?",
"options": ["git checkout <branch>", "git switch <branch>", "git change <branch>", "git move <branch>"],
"answer": "git checkout <branch>", "tech": "github"},
{"question": "What does `git pull` do?",
"options": ["Fetches and merges changes", "Only fetches changes", "Pushes local changes", "Creates new branch"],
"answer": "Fetches and merges changes", "tech": "github"},
{"question": "How to discard local changes?",
"options": ["git checkout -- <file>", "git discard <file>", "git remove changes", "git clean <file>"],
"answer": "git checkout -- <file>", "tech": "github"},
{"question": "What shows modified files?",
"options": ["git status", "git show", "git modified", "git changes"],
"answer": "git status", "tech": "github"},
{"question": "How to rename a branch?",
"options": ["git branch -m <name>", "git rename branch", "git change name", "git modify branch"],
"answer": "git branch -m <name>", "tech": "github"},
{"question": "What command deletes a branch?",
"options": ["git branch -d <name>", "git delete <name>", "git remove branch", "git clean branch"],
"answer": "git branch -d <name>", "tech": "github"},
{"question": "How to create and switch to new branch?",
"options": ["git checkout -b <name>", "git branch new", "git create switch", "git new checkout"],
"answer": "git checkout -b <name>", "tech": "github"},
{"question": "What lists all branches?",
"options": ["git branch", "git show branches", "git list", "git all"],
"answer": "git branch", "tech": "github"},
{"question": "How to merge branches?",
"options": ["git merge <branch>", "git combine <branch>", "git join <branch>", "git unite <branch>"],
"answer": "git merge <branch>", "tech": "github"},
{"question": "What shows commit differences?",
"options": ["git diff", "git show diff", "git compare", "git changes"],
"answer": "git diff", "tech": "github"},
{"question": "How to add remote repository?",
"options": ["git remote add origin <url>", "git add remote", "git create remote", "git new remote"],
"answer": "git remote add origin <url>", "tech": "github"},
{"question": "What creates a tag?",
"options": ["git tag <name>", "git create tag", "git new tag", "git add tag"],
"answer": "git tag <name>", "tech": "github"},
{"question": "How to push tags to remote?",
"options": ["git push --tags", "git push tags", "git upload tags", "git send tags"],
"answer": "git push --tags", "tech": "github"},
{"question": "What removes a file from git?",
"options": ["git rm <file>", "git delete <file>", "git remove <file>", "git clean <file>"],
"answer": "git rm <file>", "tech": "github"},
{"question": "How to stash changes?",
"options": ["git stash", "git save", "git store", "git hide"],
"answer": "git stash", "tech": "github"},
{"question": "What applies stashed changes?",
"options": ["git stash apply", "git stash use", "git stash get", "git stash pull"],
"answer": "git stash apply", "tech": "github"},
{"question": "How to view remote URLs?",
"options": ["git remote -v", "git show remote", "git list remote", "git urls"],
"answer": "git remote -v", "tech": "github"},
{"question": "What shows branch graphs?",
"options": ["git log --graph", "git show graph", "git branch graph", "git tree"],
"answer": "git log --graph", "tech": "github"},
{"question": "How to revert last commit?",
"options": ["git revert HEAD", "git undo commit", "git remove commit", "git delete commit"],
"answer": "git revert HEAD", "tech": "github"},
{"question": "What shows commit details?",
"options": ["git show <commit>", "git detail <commit>", "git info <commit>", "git read <commit>"],
"answer": "git show <commit>", "tech": "github"},
{"question": "How to force push changes?",
"options": ["git push -f", "git push force", "git force push", "git override push"],
"answer": "git push -f", "tech": "github"},
{"question": "What creates .gitignore?",
"options": ["touch .gitignore", "git ignore create", "git new ignore", "git make ignore"],
"answer": "touch .gitignore", "tech": "github"},
{"question": "How to see commit author?",
"options": ["git log --author", "git show author", "git who", "git blame"],
"answer": "git log --author", "tech": "github"},
{"question": "What fetches from remote?",
"options": ["git fetch", "git download", "git get", "git retrieve"],
"answer": "git fetch", "tech": "github"},
{"question": "How to rename remote?",
"options": ["git remote rename", "git change remote", "git modify remote", "git update remote"],
"answer": "git remote rename", "tech": "github"}
]
# Extend the existing quiz_data with new questions
quiz_data.extend(git1_questions)
git2_questions = [
{"question": "What's the purpose of .github/workflows?",
"options": ["Store GitHub Actions", "Keep documentation", "Store images", "Configure settings"],
"answer": "Store GitHub Actions", "tech": "github"},
{"question": "How to create a pull request template?",
"options": ["Add PULL_REQUEST_TEMPLATE.md", "Create pr_template.txt", "Use template.yaml", "Edit settings.json"],
"answer": "Add PULL_REQUEST_TEMPLATE.md", "tech": "github"},
{"question": "What indicates a GitHub repo is a template?",
"options": ["Green 'Use this template' button", "Template label", "Special icon", "README badge"],
"answer": "Green 'Use this template' button", "tech": "github"},
{"question": "Where are GitHub Actions secrets stored?",
"options": ["Repository settings", "Actions folder", "Security tab", "Config files"],
"answer": "Repository settings", "tech": "github"},
{"question": "What creates GitHub release notes?",
"options": ["Releases tab", "README file", "Actions workflow", "Issues page"],
"answer": "Releases tab", "tech": "github"},
{"question": "How to enable GitHub Pages?",
"options": ["Repository settings", "Pages folder", "Actions workflow", "Special branch"],
"answer": "Repository settings", "tech": "github"},
{"question": "What's the default branch protection rule?",
"options": ["None", "Require reviews", "Block force push", "Require tests"],
"answer": "None", "tech": "github"},
{"question": "Where to configure branch rules?",
"options": ["Settings/Branches", "Security tab", "Actions page", "Repo front page"],
"answer": "Settings/Branches", "tech": "github"},
{"question": "What shows repo traffic data?",
"options": ["Insights tab", "Analytics page", "Statistics view", "Traffic folder"],
"answer": "Insights tab", "tech": "github"},
{"question": "How to mark issue as duplicate?",
"options": ["Comment 'duplicate of #X'", "Use label", "Close issue", "Mark checkbox"],
"answer": "Comment 'duplicate of #X'", "tech": "github"},
{"question": "What triggers GitHub Actions workflow?",
"options": ["on: push specification", "run: command", "trigger: event", "action: start"],
"answer": "on: push specification", "tech": "github"},
{"question": "Default visibility for new repo?",
"options": ["Public", "Private", "Internal", "Protected"],
"answer": "Private", "tech": "github"},
{"question": "What shows code frequency?",
"options": ["Insights/Code frequency", "Statistics tab", "Commits page", "Analytics view"],
"answer": "Insights/Code frequency", "tech": "github"},
{"question": "How to lock conversations?",
"options": ["Lock conversation button", "Security settings", "Moderation tab", "Admin panel"],
"answer": "Lock conversation button", "tech": "github"},
{"question": "What's a GitHub gist?",
"options": ["Code snippet", "Issue template", "Pull request", "Action workflow"],
"answer": "Code snippet", "tech": "github"},
{"question": "Purpose of CODEOWNERS file?",
"options": ["Assign review responsibilities", "Set permissions", "List contributors", "Track changes"],
"answer": "Assign review responsibilities", "tech": "github"},
{"question": "Where to set repo description?",
"options": ["About section", "README file", "Settings page", "Profile view"],
"answer": "About section", "tech": "github"},
{"question": "What shows repo dependencies?",
"options": ["Insights/Dependency graph", "Package list", "Requirements file", "Security tab"],
"answer": "Insights/Dependency graph", "tech": "github"},
{"question": "How to archive a repository?",
"options": ["Settings/Archive", "Delete option", "Close repo", "Mark inactive"],
"answer": "Settings/Archive", "tech": "github"},
{"question": "What creates issue templates?",
"options": [".github/ISSUE_TEMPLATE/", "templates/", "docs/", ".issues/"],
"answer": ".github/ISSUE_TEMPLATE/", "tech": "github"},
{"question": "Default branch name setting location?",
"options": ["Repository settings", "Global settings", "Branch page", "Config file"],
"answer": "Repository settings", "tech": "github"},
{"question": "How to enable discussions?",
"options": ["Settings/Features", "Discussions tab", "Community page", "Forum settings"],
"answer": "Settings/Features", "tech": "github"},
{"question": "What shows contribution activity?",
"options": ["Profile contribution graph", "Activity tab", "Statistics page", "Timeline view"],
"answer": "Profile contribution graph", "tech": "github"},
{"question": "How to transfer repository ownership?",
"options": ["Settings/Transfer", "Admin panel", "Permissions page", "Owner tab"],
"answer": "Settings/Transfer", "tech": "github"},
{"question": "What creates release tags?",
"options": ["Releases page", "Tags section", "Version control", "Branch settings"],
"answer": "Releases page", "tech": "github"},
{"question": "How to set repo topics?",
"options": ["About section", "Tags page", "Categories tab", "Settings menu"],
"answer": "About section", "tech": "github"},
{"question": "What shows repo network?",
"options": ["Insights/Network", "Connections tab", "Graph view", "Tree diagram"],
"answer": "Insights/Network", "tech": "github"},
{"question": "How to enable wikis?",
"options": ["Settings/Features", "Wiki tab", "Docs section", "Pages settings"],
"answer": "Settings/Features", "tech": "github"},
{"question": "What shows security alerts?",
"options": ["Security tab", "Alerts page", "Issues list", "Notifications"],
"answer": "Security tab", "tech": "github"},
{"question": "How to set repository visibility?",
"options": ["Settings/Danger Zone", "Privacy tab", "Security settings", "Access control"],
"answer": "Settings/Danger Zone", "tech": "github"}
]
# Extend the quiz_data with more questions
quiz_data.extend(git2_questions)
java_questions = [
{"question": "What is the default value of int variable?",
"options": ["0", "null", "undefined", "1"],
"answer": "0", "tech": "java"},
{"question": "Which is not a valid access modifier?",
"options": ["friendly", "public", "private", "protected"],
"answer": "friendly", "tech": "java"},
{"question": "What is the size of double in Java?",
"options": ["8 bytes", "4 bytes", "2 bytes", "1 byte"],
"answer": "8 bytes", "tech": "java"},
{"question": "ArrayList implements which interface?",
"options": ["List", "Set", "Map", "Queue"],
"answer": "List", "tech": "java"},
{"question": "What does JVM stand for?",
"options": ["Java Virtual Machine", "Java Video Machine", "Java Visual Machine", "Java Vital Machine"],
"answer": "Java Virtual Machine", "tech": "java"},
{"question": "Which collection is thread-safe?",
"options": ["Vector", "ArrayList", "LinkedList", "HashMap"],
"answer": "Vector", "tech": "java"},
{"question": "What does 'final' keyword do?",
"options": ["Prevents inheritance", "Allows inheritance", "Creates interface", "None"],
"answer": "Prevents inheritance", "tech": "java"},
{"question": "String objects are stored in:",
"options": ["String Pool", "Heap Memory", "Stack Memory", "Cache"],
"answer": "String Pool", "tech": "java"},
{"question": "Which interface has compareTo() method?",
"options": ["Comparable", "Comparator", "Both", "Neither"],
"answer": "Comparable", "tech": "java"},
{"question": "What is autoboxing?",
"options": ["Primitive to Wrapper", "Wrapper to Primitive", "Type casting", "Type checking"],
"answer": "Primitive to Wrapper", "tech": "java"},
{"question": "HashSet implements which interface?",
"options": ["Set", "List", "Map", "Queue"],
"answer": "Set", "tech": "java"},
{"question": "What is marker interface?",
"options": ["Empty interface", "Functional interface", "Abstract interface", "Static interface"],
"answer": "Empty interface", "tech": "java"},
{"question": "Which collection allows duplicates?",
"options": ["ArrayList", "HashSet", "TreeSet", "LinkedHashSet"],
"answer": "ArrayList", "tech": "java"},
{"question": "What is the parent class of all classes?",
"options": ["Object", "String", "Class", "Main"],
"answer": "Object", "tech": "java"},
{"question": "Which is immutable class?",
"options": ["String", "StringBuilder", "StringBuffer", "None"],
"answer": "String", "tech": "java"},
{"question": "What does static keyword do?",
"options": ["Class level member", "Instance member", "Local variable", "Parameter"],
"answer": "Class level member", "tech": "java"},
{"question": "Which operator is right associative?",
"options": ["=", "+", "*", "-"],
"answer": "=", "tech": "java"},
{"question": "What is constructor overloading?",
"options": ["Multiple constructors", "Multiple methods", "Multiple classes", "Multiple interfaces"],
"answer": "Multiple constructors", "tech": "java"},
{"question": "Which collection is ordered?",
"options": ["LinkedHashMap", "HashMap", "HashSet", "TreeSet"],
"answer": "LinkedHashMap", "tech": "java"},
{"question": "What is method overriding?",
"options": ["Same method in subclass", "Different method in subclass", "New method in subclass", "Abstract method"],
"answer": "Same method in subclass", "tech": "java"},
{"question": "Default interface methods are:",
"options": ["public", "private", "protected", "package-private"],
"answer": "public", "tech": "java"},
{"question": "Which supports multiple inheritance?",
"options": ["Interfaces", "Classes", "Abstract classes", "None"],
"answer": "Interfaces", "tech": "java"},
{"question": "What is try-with-resources?",
"options": ["Auto resource management", "Exception handling", "File handling", "Thread management"],
"answer": "Auto resource management", "tech": "java"},
{"question": "Which collection is LIFO?",
"options": ["Stack", "Queue", "List", "Set"],
"answer": "Stack", "tech": "java"},
{"question": "What is lambda expression?",
"options": ["Anonymous function", "Named function", "Static method", "Abstract method"],
"answer": "Anonymous function", "tech": "java"},
{"question": "Which package is imported by default?",
"options": ["java.lang", "java.util", "java.io", "java.net"],
"answer": "java.lang", "tech": "java"},
{"question": "What is the scope of package-private?",
"options": ["Same package", "All packages", "Subclasses", "Same class"],
"answer": "Same package", "tech": "java"},
{"question": "Which is not a primitive type?",
"options": ["String", "int", "char", "boolean"],
"answer": "String", "tech": "java"},
{"question": "What does volatile keyword do?",
"options": ["Thread visibility", "Thread safety", "Thread creation", "Thread scheduling"],
"answer": "Thread visibility", "tech": "java"},
{"question": "Which collection is synchronized?",
"options": ["Hashtable", "HashMap", "TreeMap", "LinkedHashMap"],
"answer": "Hashtable", "tech": "java"}
]
# Extend the quiz_data with Java questions
quiz_data.extend(java_questions)
more_java_questions = [
{"question": "What is the return type of main method?",
"options": ["void", "int", "String", "Object"],
"answer": "void", "tech": "java"},
{"question": "Which stream reads binary data?",
"options": ["DataInputStream", "BufferedReader", "Scanner", "PrintWriter"],
"answer": "DataInputStream", "tech": "java"},
{"question": "What is the size of char in Java?",
"options": ["2 bytes", "1 byte", "4 bytes", "8 bytes"],
"answer": "2 bytes", "tech": "java"},
{"question": "Which interface is for sorting?",
"options": ["Comparator", "Serializable", "Cloneable", "Runnable"],
"answer": "Comparator", "tech": "java"},
{"question": "What is a daemon thread?",
"options": ["Background thread", "Main thread", "User thread", "System thread"],
"answer": "Background thread", "tech": "java"},
{"question": "Which class cannot be inherited?",
"options": ["Final class", "Abstract class", "Static class", "Public class"],
"answer": "Final class", "tech": "java"},
{"question": "What is try-catch-finally order?",
"options": ["try-catch-finally", "catch-try-finally", "finally-try-catch", "try-finally-catch"],
"answer": "try-catch-finally", "tech": "java"},
{"question": "What does instanceof operator check?",
"options": ["Object type", "Method type", "Variable type", "Class type"],
"answer": "Object type", "tech": "java"},
{"question": "Which supports primitive arrays?",
"options": ["Arrays class", "Collections class", "List interface", "Set interface"],
"answer": "Arrays class", "tech": "java"},
{"question": "What is method overloading?",
"options": ["Different parameters", "Same parameters", "Different return type", "Same return type"],
"answer": "Different parameters", "tech": "java"},
{"question": "Which collection is thread-safe?",
"options": ["ConcurrentHashMap", "HashMap", "TreeMap", "LinkedHashMap"],
"answer": "ConcurrentHashMap", "tech": "java"},
{"question": "What is default method access?",
"options": ["package-private", "public", "private", "protected"],
"answer": "package-private", "tech": "java"},
{"question": "Which is checked exception?",
"options": ["IOException", "NullPointerException", "ArrayIndexOutOfBoundsException", "ArithmeticException"],
"answer": "IOException", "tech": "java"},
{"question": "What does super keyword do?",
"options": ["Calls parent method", "Calls child method", "Creates object", "Deletes object"],
"answer": "Calls parent method", "tech": "java"},
{"question": "Which collection is sorted?",
"options": ["TreeSet", "HashSet", "LinkedHashSet", "ArrayList"],
"answer": "TreeSet", "tech": "java"},
{"question": "What is StringBuffer characteristic?",
"options": ["Synchronized", "Not synchronized", "Immutable", "Fixed size"],
"answer": "Synchronized", "tech": "java"},
{"question": "Which is valid identifier?",
"options": ["_name", "2name", "#name", "@name"],
"answer": "_name", "tech": "java"},
{"question": "What is default array value?",
"options": ["null for objects", "0", "undefined", "false"],
"answer": "null for objects", "tech": "java"},
{"question": "Which interface is functional?",
"options": ["Runnable", "Serializable", "Cloneable", "Random"],
"answer": "Runnable", "tech": "java"},
{"question": "What is anonymous class?",
"options": ["Class without name", "Empty class", "Abstract class", "Final class"],
"answer": "Class without name", "tech": "java"},
{"question": "Which method is thread-safe?",
"options": ["StringBuffer append", "StringBuilder append", "String concat", "Array copy"],
"answer": "StringBuffer append", "tech": "java"},
{"question": "What is polymorphism type?",
"options": ["Runtime", "Compiletime", "Both", "Neither"],
"answer": "Runtime", "tech": "java"},
{"question": "Which supports variable arguments?",
"options": ["varargs (...)", "array[]", "ArrayList", "Vector"],
"answer": "varargs (...)", "tech": "java"},
{"question": "What is default interface method?",
"options": ["Has implementation", "No implementation", "Abstract", "Static"],
"answer": "Has implementation", "tech": "java"},
{"question": "Which is immutable class?",
"options": ["Integer", "StringBuilder", "StringBuffer", "Array"],
"answer": "Integer", "tech": "java"},
{"question": "What is transient keyword for?",
"options": ["Skip serialization", "Force serialization", "Enable threading", "Disable threading"],
"answer": "Skip serialization", "tech": "java"},
{"question": "Which collection is fail-fast?",
"options": ["ArrayList", "CopyOnWriteArrayList", "Vector", "Stack"],
"answer": "ArrayList", "tech": "java"},
{"question": "What is static block used for?",
"options": ["Class initialization", "Object initialization", "Method initialization", "Variable initialization"],
"answer": "Class initialization", "tech": "java"},
{"question": "Which supports multiple inheritance?",
"options": ["Default methods", "Abstract classes", "Concrete classes", "Static methods"],
"answer": "Default methods", "tech": "java"},
{"question": "What is reflection used for?",
"options": ["Runtime manipulation", "Compile time checking", "Code optimization", "Memory management"],
"answer": "Runtime manipulation", "tech": "java"}
]
# Extend the quiz_data with more Java questions
quiz_data.extend(more_java_questions)
bash_questions = [
{"question": "What command lists directory contents?",
"options": ["ls", "dir", "list", "show"],
"answer": "ls", "tech": "bash"},
{"question": "How to change directory permissions?",
"options": ["chmod", "chown", "chgrp", "chdir"],
"answer": "chmod", "tech": "bash"},
{"question": "What displays current directory?",
"options": ["pwd", "cd", "dir", "path"],
"answer": "pwd", "tech": "bash"},
{"question": "How to create empty file?",
"options": ["touch", "make", "create", "new"],
"answer": "touch", "tech": "bash"},
{"question": "Which redirects stdout and stderr?",
"options": ["2>&1", ">", ">>", "<"],
"answer": "2>&1", "tech": "bash"},
{"question": "What shows running processes?",
"options": ["ps", "proc", "top", "list"],
"answer": "ps", "tech": "bash"},
{"question": "How to search file contents?",
"options": ["grep", "find", "search", "lookup"],
"answer": "grep", "tech": "bash"},
{"question": "What represents home directory?",
"options": ["~", "/", "./", "../"],
"answer": "~", "tech": "bash"},
{"question": "How to display file contents?",
"options": ["cat", "show", "display", "print"],
"answer": "cat", "tech": "bash"},
{"question": "Which finds files by name?",
"options": ["find", "search", "locate", "grep"],
"answer": "find", "tech": "bash"},
{"question": "What shows disk usage?",
"options": ["df", "du", "disk", "space"],
"answer": "df", "tech": "bash"},
{"question": "How to rename file?",
"options": ["mv", "ren", "rename", "change"],
"answer": "mv", "tech": "bash"},
{"question": "What kills a process?",
"options": ["kill", "end", "stop", "terminate"],
"answer": "kill", "tech": "bash"},
{"question": "How to create directory?",
"options": ["mkdir", "md", "makedir", "create"],
"answer": "mkdir", "tech": "bash"},
{"question": "Which shows command history?",
"options": ["history", "show", "past", "commands"],
"answer": "history", "tech": "bash"},
{"question": "What compresses files?",
"options": ["tar", "zip", "compress", "archive"],
"answer": "tar", "tech": "bash"},
{"question": "How to check file type?",
"options": ["file", "type", "what", "check"],
"answer": "file", "tech": "bash"},
{"question": "Which shows system info?",
"options": ["uname", "sys", "info", "system"],
"answer": "uname", "tech": "bash"},
{"question": "What shows network connections?",
"options": ["netstat", "network", "net", "conn"],
"answer": "netstat", "tech": "bash"},
{"question": "How to sort file contents?",
"options": ["sort", "order", "arrange", "organize"],
"answer": "sort", "tech": "bash"},
{"question": "What shows file differences?",
"options": ["diff", "compare", "cmp", "change"],
"answer": "diff", "tech": "bash"},
{"question": "How to count words in file?",
"options": ["wc", "count", "words", "length"],
"answer": "wc", "tech": "bash"},
{"question": "Which shows calendar?",
"options": ["cal", "calendar", "date", "time"],
"answer": "cal", "tech": "bash"},
{"question": "What shows system load?",
"options": ["top", "load", "sys", "cpu"],
"answer": "top", "tech": "bash"},
{"question": "How to change file owner?",
"options": ["chown", "owner", "change", "modify"],
"answer": "chown", "tech": "bash"},
{"question": "Which shows disk space?",
"options": ["du", "disk", "space", "usage"],
"answer": "du", "tech": "bash"},
{"question": "What shows current user?",
"options": ["whoami", "user", "who", "me"],
"answer": "whoami", "tech": "bash"},
{"question": "How to make script executable?",
"options": ["chmod +x", "make exec", "run", "execute"],
"answer": "chmod +x", "tech": "bash"},
{"question": "Which shows file permissions?",
"options": ["ls -l", "perms", "rights", "access"],
"answer": "ls -l", "tech": "bash"},
{"question": "What checks disk integrity?",
"options": ["fsck", "check", "disk", "verify"],
"answer": "fsck", "tech": "bash"}
]
# Extend the quiz_data with bash questions
quiz_data.extend(bash_questions)
more_bash_questions = [
{"question": "What symbol represents pipeline?",
"options": ["|", "&", ">>", "<<"],
"answer": "|", "tech": "bash"},
{"question": "How to view last n lines?",
"options": ["tail -n", "head -n", "last -n", "end -n"],
"answer": "tail -n", "tech": "bash"},
{"question": "What's the 'not' operator in bash?",
"options": ["!", "not", "~", "^"],
"answer": "!", "tech": "bash"},
{"question": "How to set environment variable?",
"options": ["export VAR=value", "set VAR=value", "var VAR=value", "env VAR=value"],
"answer": "export VAR=value", "tech": "bash"},
{"question": "Which finds pattern in files?",
"options": ["awk", "sed", "cut", "paste"],
"answer": "awk", "tech": "bash"},
{"question": "What represents background job?",
"options": ["&", "#", "@", "$"],
"answer": "&", "tech": "bash"},
{"question": "How to view file start?",
"options": ["head", "start", "begin", "top"],
"answer": "head", "tech": "bash"},
{"question": "What represents current process ID?",
"options": ["$$", "$PID", "$@", "$#"],
"answer": "$$", "tech": "bash"},
{"question": "How to create symbolic link?",
"options": ["ln -s", "link -s", "symlink", "mklink"],
"answer": "ln -s", "tech": "bash"},