Array Questions
1. Find the maximum subarray sum (Kadane's Algorithm).
2. Find the missing number in an array of size n with elements from 1 to n+1.
3. Find the duplicate number in an array.
4. Merge two sorted arrays.
5. Rearrange array in alternating positive & negative items.
6. Sort an array of 0s, 1s and 2s (Dutch National Flag).
7. Find the majority element in the array.
8. Find the equilibrium index.
9. Rotate an array by k positions.
10. Check if array is a palindrome.
11. Trapping Rain Water problem.
12. Maximum product subarray.
13. Count inversions in the array.
14. Find the longest subarray with a given sum.
15. Find the pair with a given sum in a sorted array.
16. Find all pairs with a given sum.
17. Next permutation of a number array.
18. Longest consecutive sequence in an array.
19. Minimum number of jumps to reach end.
20. Merge overlapping intervals.
21. Find common elements in three sorted arrays.
22. Replace each element with the greatest on its right.
23. Move all zeros to the end of the array.
24. Maximum sum of i*arr[i] over all rotations.
25. Array subset of another array.
26. Find duplicate in array without extra space.
27. Rearrange array in-place with O(1) extra space.
28. Find two repeating elements in array.
29. Rearrange array in max/min form (alternating).
30. Find all elements that appear more than n/3 times.
31. Maximum length of subarray with equal 0s and 1s.
32. Minimum size subarray with sum >= target.
33. Binary search in a rotated sorted array.
34. Peak element in an array.
35. Maximum sum increasing subsequence.
36. Count subarrays with sum divisible by k.
37. Count subarrays with given XOR.
38. Longest subarray with equal number of 1s and 0s.
39. Find duplicate and missing number.
40. Find first and last occurrence of an element in sorted array.
Math Questions
1. Check if a number is prime.
2. Sieve of Eratosthenes.
3. Count total factors of a number.
4. Find GCD (Euclidean algorithm).
5. Find LCM using GCD.
6. Count trailing zeros in factorial.
7. Check if a number is power of 2.
8. Modular exponentiation.
9. Compute nCr % p.
10. Count digits in a number.
11. Reverse digits of an integer.
12. Palindrome number check.
13. Check if number is an Armstrong number.
14. Find square root using binary search.
15. Fast exponentiation (power function).
16. Check for Pythagorean triplet.
17. Find factorial of large numbers.
18. Count numbers divisible by a in a range [l, r].
19. Sum of digits of a number.
20. Digital root of a number.
21. Find nth Fibonacci number (modulo included).
22. Fibonacci using matrix exponentiation.
23. Find all prime factors of a number.
24. Solve linear equations ax + by = c.
25. Count of numbers <= N with exactly k set bits.
26. Number of trailing zeros in n!
27. Convert a number to any base.
28. Sum of n natural numbers (formula-based).
29. Count perfect squares between two numbers.
30. Number of divisors of a factorial.
Hashing Questions
1. Two sum problem.
2. Subarray with 0 sum.
3. Longest subarray with given sum (positive & negative).
4. Count frequency of elements.
5. Group anagrams together.
6. Find all pairs with sum equal to K.
7. Find the first repeating element.
8. Longest consecutive subsequence.
9. Count distinct elements in every window of size k.
10. Largest subarray with equal number of 0s and 1s.
11. Subarrays with equal number of 1s and 0s.
12. Check if two arrays are equal (frequency match).
13. Count pairs with given XOR.
14. Check if a subarray with 0 sum exists.
15. Longest substring without repeating characters.
16. Minimum window substring.
17. Count of all subarrays with sum = k.
18. Find the element with highest frequency.
19. Detect loop in a linked list using hashing.
20. Implement LRU Cache.
21. Design a HashMap.
22. Count number of subarrays with XOR = K.
23. Check if anagram exists in another string.
24. Word pattern matching.
25. Longest common prefix in array of strings.
26. Substring with all unique characters.
27. Find common elements in two arrays.
28. Find smallest subarray with all distinct elements.
29. Check if two strings are isomorphic.
30. Number of subarrays with at most K distinct integers.