Ultimate Coding Questions Cheat Sheet for Interviews
1. Array Manipulation
- Traverse and print array
- Insert/Delete at a given index
- Reverse an array (in-place)
- Left/Right rotate by k positions
- Find max/min element
- Find second largest element
- Remove duplicates (sorted array)
- Merge two sorted arrays
- Two Sum problem
- Subarray with given sum
- Count frequency of elements
2. String Manipulation
- Reverse a string
- Check for palindrome
- Remove duplicate characters
- Count vowels and consonants
- Anagram check
- Substring search
- Longest common prefix
- String compression
- Toggle case of characters
3. Searching & Sorting
- Linear search
- Binary search (sorted array)
- Bubble sort
- Selection sort
- Insertion sort
- Merge sort
- Quick sort
- Count sort
4. Pointers & Memory in C
- Difference between array and pointer
- Swap values using pointers
- Dynamic memory allocation using malloc
- Double pointer basics
- Pointer to a function
5. Mathematical Problems
- Palindrome number check
- Armstrong number check
- Prime number check
- GCD and LCM
- Factorial using recursion
- Fibonacci (iterative & recursive)
- Power of 2 check
6. Bit Manipulation
- Set, clear, and toggle bit
- Count set bits
- Check if number is even/odd using bitwise
- Swap two numbers using XOR
7. Basic Data Structures
- Stack using array
- Queue (including circular queue)
- Singly linked list (traverse and insert)
8. Logic Building / Patterns
- Pascal's Triangle
- Number/star patterns
- Move all zeros to end
- Rearranging positive and negative numbers
- Majority Element using Boyer-Moore Voting
Preparation Tips
- Solve at least 5 problems from each section.
- Start with brute-force, then optimize.
- Write code in C and Python.
- Track time and space complexity.