72Laboratories

📚 Frequently Asked Coding Questions (Fresher’s CheatSheet)


🔢 Arrays

🟢 Basic Logic-Based Questions

1. Find the Sum of All Elements in an Array

2. Find the Maximum and Minimum Element in an Array

3. Calculate the Average of Elements in an Array

5. Count the Number of Even and Odd Numbers in an Array

6. Find the Second Largest Element in an Array

7. Reverse an Array In-Place

8. Copy One Array into Another


🟡 Slightly Interesting / Tricky Questions

9. Find Duplicate Elements in an Array

10. Remove Duplicates from a Sorted Array In-Place

11. Sort an Array (Ascending and Descending)

12. Merge Two Sorted Arrays

13. Left and Right Rotate an Array by One Position

14. Rotate an Array by k Positions

15. Find the Frequency of Each Element

16. Move All Zeros to the End

17. Find the Missing Number

18. Find a Pair with a Given Sum (Two Sum)

19. Sort an Array of 0s, 1s, and 2s (Dutch National Flag)

20. Check if an Array is Sorted in Ascending Order


🎁 Bonus Challenges

21. Check if an Array is a Palindrome

22. Find Common Elements Between Two Arrays

23. Difference Between Sum of Even and Odd Numbers

24. Product of Array Except Self

25. Maximum Subarray Sum (Kadane’s Algorithm)

26. Find the Duplicate Number

27. Container With Most Water

28. Majority Element

29. Best Time to Buy and Sell Stock

30. Plus One


🧵 String Questions

🟢 Basic Level

🟡 Intermediate Level

🔴 Advanced / Tricky Level


✖️➕🟰 Math-Based Questions

🟢 Basic Level

  1. Check if a Number is Prime
  2. Generate First N Prime Numbers
  3. Check if a Number is Palindrome
  4. Reverse a Number
  5. Check if a Number is an Armstrong Number
  6. Calculate the Factorial of a Number
  7. Print All Factors of a Number
  8. Find the Greatest Common Divisor (GCD)
  9. Find the Least Common Multiple (LCM)
  10. Count Digits in a Number
  11. Sum of Digits in a Number
  12. Check if a Number is a Perfect Square
  13. Check if a Number is a Power of Two
  14. Convert Decimal to Binary
  15. Convert Binary to Decimal

🟡 Intermediate Level

  1. Generate the Fibonacci Sequence up to N Terms
  2. Find the Nth Fibonacci Number
  3. Find the Integer Square Root of a Number
  4. Calculate the Power of a Number (Exponentiation)
  5. Count the Number of Set Bits (1s) in Binary
  6. Check if a Number is a Power of 10
  7. Compute nCr (Combinations)
  8. Check for Leap Year
  9. Find the Number of Trailing Zeros in Factorial
  10. Implement Arithmetic Operations Without Using Operators (Add, Subtract, Multiply, Divide)
  11. Check Whether Three Numbers Can Form a Triangle

🔴 Advanced Level

  1. Sieve of Eratosthenes (Generate Primes up to n)
  2. Find All Prime Factors of a Number
  3. Convert Roman Numerals to Integer
  4. Check if a Number Has All Unique Digits (No Repetition)
  5. Missing Number in a Sequence (1 to n)
  6. Two Sum Problem (Find Pair with Given Sum)
  7. Generate Pascal’s Triangle (n Rows)
  8. Find the Digital Root of a Number
  9. Find Modular Multiplicative Inverse
  10. Fast Exponentiation (Modular Power)