-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintermidiate.js
More file actions
117 lines (106 loc) · 9.55 KB
/
Copy pathintermidiate.js
File metadata and controls
117 lines (106 loc) · 9.55 KB
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
// ===================== Arrays – Interview Questions (30) ===============================
// 1. Find average of array.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 2. Find largest difference in array.::::::::::::::::::::::::::::::::::::::::::::::::::::
// 3. Find intersection of two arrays.:::::::::::::::::::::::::::::::::::::::::::::::::::::
// 4. Find union of two arrays.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 5. Find missing number in sequence.:::::::::::::::::::::::::::::::::::::::::::::::::::::
// 6. Find duplicate elements.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 7. Find majority element (> n/2 times).:::::::::::::::::::::::::::::::::::::::::::::::::
// 8. Find kth largest element.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 9. Find equilibrium index.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 10. Find pair with target sum.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 11. Count pairs with given sum.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 12. Find subarray with max sum (Kadane).::::::::::::::::::::::::::::::::::::::::::::::::
// 13. Find subarray with given sum.:::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 14. Find longest consecutive sequence.::::::::::::::::::::::::::::::::::::::::::::::::::
// 15. Find product of array except self.::::::::::::::::::::::::::::::::::::::::::::::::::
// 16. Move zeros to end.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 17. Sort array of 0s, 1s, 2s (Dutch National Flag).:::::::::::::::::::::::::::::::::::::
// 18. Spiral traversal of matrix.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 19. Rotate matrix 90 degrees.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 20. Transpose of matrix.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 21. Diagonal sum of matrix.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 22. Print boundary elements of matrix.::::::::::::::::::::::::::::::::::::::::::::::::::
// 23. Snake pattern of matrix.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 24. Find saddle point of matrix.::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 25. Search element in sorted matrix.::::::::::::::::::::::::::::::::::::::::::::::::::::
// 26. Flatten 2D array.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 27. Merge overlapping intervals.::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 28. Insert interval.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 29. Minimum platforms (train problem).::::::::::::::::::::::::::::::::::::::::::::::::::
// 30. Rainwater trapping problem.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ===================== Objects – Interview Questions (15) ===============================
// 31. Create student object with methods.:::::::::::::::::::::::::::::::::::::::::::::::::
// 32. Add/remove properties dynamically.:::::::::::::::::::::::::::::::::::::::::::::::::
// 33. Count properties of object.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 34. Check if property exists.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 35. Iterate keys and values.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 36. Convert object to array of pairs.:::::::::::::::::::::::::::::::::::::::::::::::::::
// 37. Convert array of pairs to object.:::::::::::::::::::::::::::::::::::::::::::::::::::
// 38. Freeze object (polyfill).::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 39. Seal object.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 40. Shallow copy vs deep copy.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 41. Implement Object.create.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 42. Deep compare objects.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 43. Group objects by property.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 44. Sort array of objects by property.::::::::::::::::::::::::::::::::::::::::::::::::::
// 45. Deep merge two objects.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ===================== DOM – Interview Questions (20) ==================================
// 46. Create a button dynamically.::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 47. Change text content of element.:::::::::::::::::::::::::::::::::::::::::::::::::::::
// 48. Change style dynamically.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 49. Add/remove class.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 50. Add event listener.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 51. Event delegation example.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 52. Prevent default behavior.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 53. Stop event propagation.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 54. Build counter app.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 55. Build to-do list app.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 56. Build accordion UI.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 57. Build modal popup.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 58. Build image slider.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 59. Build tab navigation.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 60. Build stopwatch.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 61. Build digital clock.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 62. Form validation script.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 63. Fetch API data and display table.::::::::::::::::::::::::::::::::::::::::::::::::::::
// 64. DOM search filter.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 65. Infinite scroll loader.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ===================== Async JS – Interview Questions (20) ===============================
// 66. Callback example (setTimeout).:::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 67. Promise example.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 68. Chaining promises.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 69. Promise.all example.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 70. Promise.race example.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 71. Custom promise polyfill.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 72. Async/await with fetch.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 73. Retry API call (async/await).:::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 74. Parallel API calls.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 75. Sequential API calls.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 76. Cancelable promise.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 77. Implement sleep(ms).::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 78. Throttle function.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 79. Debounce function.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 80. Task scheduler.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 81. Rate limiter.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 82. Event loop demonstration.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 83. Microtask vs macrotask demo.::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 84. Custom event emitter.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 85. Pub-sub implementation.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ===================== Error Handling – Interview Questions (5) ==========================
// 86. Try/catch demo.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 87. Throw custom error.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 88. Create custom Error class.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 89. Handle async errors (try/catch).::::::::::::::::::::::::::::::::::::::::::::::::::::
// 90. Graceful fallback function.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ===================== ES6+ – Interview Questions (10) ==================================
// 91. Template literals.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 92. Default parameters.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 93. Rest parameters.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 94. Spread operator.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 95. Array destructuring.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 96. Object destructuring.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 97. Optional chaining.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 98. Nullish coalescing.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 99. Import/export modules.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// 100. Dynamic import.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::