0% found this document useful (0 votes)
2 views

Common Coding Questions

The document lists common coding problems categorized into various sections including Basic Problems, String Problems, Array Problems, Sorting and Searching, Mathematical Problems, Recursion Problems, Bit Manipulation Problems, and Additional Problems. Each category contains specific tasks such as checking if a number is even, reversing a string, implementing sorting algorithms, and finding the longest increasing subsequence. This comprehensive list serves as a resource for practicing coding skills and problem-solving techniques.

Uploaded by

sameer bagde
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Common Coding Questions

The document lists common coding problems categorized into various sections including Basic Problems, String Problems, Array Problems, Sorting and Searching, Mathematical Problems, Recursion Problems, Bit Manipulation Problems, and Additional Problems. Each category contains specific tasks such as checking if a number is even, reversing a string, implementing sorting algorithms, and finding the longest increasing subsequence. This comprehensive list serves as a resource for practicing coding skills and problem-solving techniques.

Uploaded by

sameer bagde
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Common Coding Questions

Basic Problems

1. Check if a number is even or odd.


2. Check if a year is a leap year.
3. Find the factorial of a number.
4. Check if a number is prime.
5. Find the GCD (Greatest Common Divisor) of two numbers.
6. Find the LCM (Least Common Multiple) of two numbers.
7. Reverse a given number.
8. Find the sum of digits of a number.
9. Check if a number is an Armstrong number.
10.Check if a number is a palindrome.

String Problems

11.Reverse a string.
12.Check if a string is a palindrome.
13.Count vowels and consonants in a string.
14.Find the frequency of a character in a string.
15.Convert a string to uppercase and lowercase.
16.Remove vowels from a string.
17.Find the first non-repeating character in a string.
18.Check if two strings are anagrams.
19.Remove duplicate characters from a string.
20.Find the longest word in a sentence.

Array Problems

21.Find the largest element in an array.


22.Find the smallest element in an array.
23.Reverse an array.
24.Find the sum of all elements in an array.
25.Find the second largest element in an array.
26.Remove duplicates from an array.
27.Find the missing number in a range of numbers.
28.Rotate an array by k positions.
29.Find the intersection of two arrays.
30.Find the union of two arrays.

Sorting and Searching

31.Implement Bubble Sort.


32.Implement Selection Sort.
33.Implement Insertion Sort.
34.Implement Merge Sort.
35.Implement Quick Sort.
36.Implement Binary Search.
37.Implement Linear Search.
38.Find the kth smallest element in an array.
39.Find the kth largest element in an array.
40.Find the index of an element in a rotated sorted array.

Mathematical Problems

41.Find the Fibonacci series up to n terms.


42.Find the sum of n natural numbers.
43.Check if a number is a perfect square.
44.Find the sum of all prime numbers up to n.
45.Convert a decimal number to binary.
46.Convert a binary number to decimal.
47.Find the power of a number using recursion.
48.Find the square root of a number without using built-in functions.
49.Find the sum of a geometric series.
50.Find the sum of an arithmetic series.

Recursion Problems

51.Find factorial using recursion.


52.Find Fibonacci series using recursion.
53.Find the sum of digits of a number using recursion.
54.Find the Greatest Common Divisor (GCD) using recursion.
55.Reverse a string using recursion.
56.Check if a number is palindrome using recursion.
57.Find the nth power of a number using recursion.
58.Find the number of paths in a matrix using recursion.
59.Find the number of ways to climb stairs using recursion.
60.Generate all permutations of a string using recursion.

Bit Manipulation Problems

61.Check if a number is a power of two.


62.Count the number of 1s in a binary representation of a number.
63.Find the unique element in an array where every element appears twice
except one.
64.Swap two numbers without using a third variable.
65.Multiply a number by 2 without using multiplication.
66.Find the XOR of all elements in an array.
67.Convert a lowercase character to uppercase using bitwise operations.
68.Find the missing number in an array using XOR.
69.Find two missing numbers in an array.
70.Check if a number is odd or even using bitwise operations.

Additional Problems

71.Find the first missing positive integer in an array.


72.Find the longest substring without repeating characters.
73.Find the maximum subarray sum using Kadane’s algorithm.
74.Find the median of two sorted arrays.
75.Find the square root of a number using binary search.
76.Implement a function to check balanced parentheses.
77.Implement a function to generate Pascal’s triangle.
78.Check if a number is a perfect number.
79.Find the largest prime factor of a number.
80.Generate all subsets of a given set.
81.Find the longest common prefix in an array of strings.
82.Implement a function to generate the power set of a given set.
83.Find the longest increasing subsequence.
84.Implement a function to compute the edit distance between two strings.
85.Find the maximum product subarray.
86.Implement a function to convert Roman numerals to integers.
87.Find the majority element in an array.
88.Implement a function to check if a given string is a valid palindrome
considering only alphanumeric characters.
89.Find the longest valid parentheses substring.
90.Find the minimum window substring containing all characters of another
string.
91.Implement a function to merge overlapping intervals.
92.Find the minimum number of jumps required to reach the end of an array.
93.Find the best time to buy and sell stock for maximum profit.
94.Find the total number of ways to make change for a given amount using
given denominations.
95.Implement a function to find the longest mountain in an array.
96.Implement a function to find the shortest palindrome by adding characters
at the beginning of a string.
97.Find the number of islands in a matrix using DFS.
98.Implement a function to solve the N-Queens problem.
99.Find the number of trailing zeros in the factorial of a number.
100. Find the smallest missing positive integer in an unsorted array.

You might also like