1. What is Data Structure?
    A way of organizing and storing data efficiently for easy access and modification.
  2. What is Algorithm?
    A step-by-step procedure to solve a problem.
  3. What is Time Complexity?
    It measures how execution time grows with input size.
  4. What is Space Complexity?
    Memory used by an algorithm.
  5. Define Big-O notation.
    Represents worst-case complexity.
  6. What is Big-Theta?
    Represents average-case complexity.
  7. What is Big-Omega?
    Represents best-case complexity.
  8. What is linear search?
    Sequentially checking each element.
  9. What is binary search?
    Search in sorted array by dividing into halves.
  10. Difference between array and linked list?
    Array uses contiguous memory, linked list uses nodes.
  11. What is recursion?
    Function calling itself.
  12. Base case in recursion?
    Condition to stop recursion.
  13. What is iterative approach?
    Using loops.
  14. What is divide and conquer?
    Breaking problem into subproblems.
  15. What is greedy algorithm?
    Chooses best option at each step.
  16. What is dynamic programming?
    Solving problems using stored results.
  17. What is stack?
    LIFO structure.
  18. What is queue?
    FIFO structure.
  19. What is heap?
    Tree-based structure.
  20. What is graph?
    Collection of nodes and edges.
  21. What is tree?
    Hierarchical structure.
  22. What is node?
    Basic unit in data structures.
  23. What is pointer?
    Stores memory address.
  24. What is sorting?
    Arranging data in order.
  25. What is searching?
    Finding an element.
  26. Best sorting algorithm?
    Depends on use-case.
  27. What is stable sorting?
    Maintains order of equal elements.
  28. What is in-place algorithm?
    Uses constant extra space.
  29. What is hashing?
    Mapping data to fixed size values.
  30. What is collision?
    Two keys map to same index.
  31. What is load factor?
    Ratio of filled slots.
  32. What is adjacency matrix?
    Graph representation.
  33. What is adjacency list?
    List-based graph representation.
  34. What is DFS?
    Depth-first search.
  35. What is BFS?
    Breadth-first search.
  36. What is recursion stack?
    Stack used in recursion.
  37. What is tail recursion?
    Recursive call at end.
  38. What is memoization?
    Storing computed results.
  39. What is tabulation?
    Bottom-up DP approach.
  40. What is backtracking?
    Try all possibilities.
  41. What is NP problem?
    Non-deterministic polynomial problem.
  42. What is amortized analysis?
    Average cost over operations.
  43. What is brute force?
    Trying all possibilities.
  44. What is recursion tree?
    Visualization of recursion calls.
  45. What is greedy choice property?
    Local optimum leads to global optimum.
  46. What is optimal substructure?
    Problem can be divided into subproblems.
  47. What is sliding window?
    Technique for subarray problems.
  48. What is two-pointer technique?
    Using two indices.
  49. What is prefix sum?
    Cumulative sum array.
  50. What is suffix sum?
    Reverse cumulative sum.

🔹 PART 2: ARRAYS (Q51–Q100)

  1. What is an array?
    Collection of elements stored in contiguous memory.
  2. Advantages of arrays?
    Fast access using index.
  3. Disadvantages?
    Fixed size.
  4. How to find largest element?
    Traverse array and compare.
  5. Find smallest element?
    Traverse and compare.
  6. Reverse array?
    Swap elements from both ends.
  7. Check if sorted?
    Compare adjacent elements.
  8. Find second largest?
    Track max and second max.
  9. Remove duplicates?
    Use set or two-pointer.
  10. Rotate array?
    Use reversal algorithm.
  11. Left rotate?
    Shift elements left.
  12. Right rotate?
    Shift elements right.
  13. Find missing number?
    Sum formula or XOR.
  14. Find duplicates?
    Use hashing.
  15. Maximum subarray sum?
    Kadane’s Algorithm.
  16. Move zeros to end?
    Two-pointer approach.
  17. Union of arrays?
    Combine unique elements.
  18. Intersection?
    Common elements.
  19. Longest subarray with sum K?
    Use hashmap.
  20. Sort array?
    Use sorting algorithms.
  21. Merge two arrays?
    Combine and sort.
  22. Find pair with sum?
    Two-pointer or hashmap.
  23. Majority element?
    Boyer-Moore algorithm.
  24. Stock buy sell?
    Track min price.
  25. Find peak element?
    Compare neighbors.
  26. Search in rotated array?
    Modified binary search.
  27. Find equilibrium index?
    Prefix and suffix sum.
  28. Count inversions?
    Merge sort method.
  29. Product of array except self?
    Prefix & suffix product.
  30. Trapping rain water?
    Two-pointer approach.
  31. Maximum product subarray?
    Track max & min.
  32. Find subarray with 0 sum?
    Hashmap.
  33. Longest consecutive sequence?
    Use set.
  34. Minimum swaps?
    Cycle detection.
  35. Rearrange positive negative?
    Partition method.
  36. Next permutation?
    Lexicographic approach.
  37. Find repeating and missing?
    Math or XOR.
  38. Check palindrome array?
    Compare ends.
  39. Count subarrays?
    n(n+1)/2.
  40. Split array?
    Divide into parts.
  41. Find kth largest?
    Heap or sorting.
  42. Median of array?
    Sort and pick middle.
  43. Find frequency?
    Hashmap.
  44. Sliding window max?
    Deque.
  45. Minimum window size?
    Two-pointer.
  46. Longest unique subarray?
    Set.
  47. Binary search on array?
    Divide into halves.
  48. Check subset?
    Use hashing.
  49. Find triplets sum?
    Two-pointer.
  50. 4-sum problem?
    Nested loops + two-pointer.
  51. Find maximum difference?
    Track min element.

 

📢 Join Our WhatsApp Channel

💼 Get Daily IT Job Updates, Interview Preparation Tips & Instant Alerts directly on WhatsApp.

👉 Join WhatsApp Now

📢 Join Our Telegram Channel

💼 Get Daily IT Job Updates, Interview Tips & Exclusive Alerts directly on Telegram!

👉 Join Telegram

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2022 - 2025 itfreesource.com

Enable Notifications OK No thanks