50 Codingquestions Rishikesh
50 Codingquestions Rishikesh
1. Factorial of a number.
2. Find area/perimeter of a circle/rectangle/square.
3. Check leap year or not.
4. GCD of two number.
5. Check whether a given number is a prime number or not.
6. Print all prime numbers in a given range.
7. Sieve of Eratosthenes.(to find prime number till n)(recursion)
8. Check given number is perfect number or not.
9. Check whether a given number is a Strong number or not.
10.Check whether a number/string is a Palindrome or not.
11.Check whether a given number is an Armstrong number.
12.Fibonacci series up to N terms.
13.Binary/octal/decimal to decimal/binary/octal conversion.
14. Sum of all prime numbers within a range.
15. Reversing a given number/string.
16. Pattern printing using stars/numbers.(next pdf)
17. Second smallest and second largest element in an array.
18. Find the duplicate elements in an array.
19. Find the non-duplicate(different) elements in an array.
20. Rotate an array.
21. Rotate an array from specified position.
22. Arrange negative number at left/right side and positive number at
right/left side in an array.
23. Check number is even or odd.
24. Check no. is even or odd without modulo operator.
25. Add node in linked list.(any position)
26. Count number of node in linked list.
27. Write a program to reverse the linked list.
28. Write a program to detect loop in a linked list.
29. Count number of child in left/right side of tree.
30. Sort array.(all method known)
31. Check valid braces in expression({[()]})/balanced parenthesis problem.
32. Solve quadratic equation.
33. Check linked list is circular or not.
34. Swap two number without using 3rd variable.
35. Find number of bits required to convert a to b.
36. Print all substring/powerset of a string.
37. Binary search algorithm.
38. Find LCM or HCF.
39. Check number of times substrings(aba) occur in a string(ababababa).
40. Rotate the matrix clockwise/anticlockwise/90 degree at n number of
times.
41.Find duplicate in an array.
42.Spiral traversal in matrix.
43. Find the first repeated word in the string.(e.g.- It is the Taj mahal, it is in
white colour and also it is one of from 7 wonders)
44. String matching or String compare.
45. Print anagrams.
46. Print all subarray with 0 sum.(e.g.- [2,-4,2,2,1])
47. Minimum number of swap required to sort array.
48. Print no. of Trailing 0(zeros) in factorial.
49. Print all permutation of string.
50. Count he character in each word in a given sentence.(e.g.- hello, this is
rishikesh verma)