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

Interview Related Programming Questions

This document lists common programming questions asked during interviews. It covers questions related to loops, strings, arrays, and general programming problems. The loop questions involve programs for factorials, palindrome checks, Armstrong numbers, Fibonacci sequences, prime number checks and more. The string questions involve reversing, checking for vowels, palindromes, anagrams and other string manipulations. The array questions involve checking for duplicates, sorting, finding maximum/minimum values, merging arrays and other array operations. Finally, extra questions cover a wide range of programming problems on topics like series, patterns, searching/sorting and string/array manipulations.

Uploaded by

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

Interview Related Programming Questions

This document lists common programming questions asked during interviews. It covers questions related to loops, strings, arrays, and general programming problems. The loop questions involve programs for factorials, palindrome checks, Armstrong numbers, Fibonacci sequences, prime number checks and more. The string questions involve reversing, checking for vowels, palindromes, anagrams and other string manipulations. The array questions involve checking for duplicates, sorting, finding maximum/minimum values, merging arrays and other array operations. Finally, extra questions cover a wide range of programming problems on topics like series, patterns, searching/sorting and string/array manipulations.

Uploaded by

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

Interview Related Programming

Questions
1. Looping Program Questions:
 Find the Factorial of the given number
 Find the reverse of the number Program
 Check whether the number is palindrome or not Program
 Check whether the number is Armstrong or not Program
 Print the Armstrong number available between 0 to 1000 Program
 To print the palindrome available between 0 to 100 Program
 Print the count of the given number Program
 Find the Sum of the digit Program
 Swap of two number using third variable Program
 Swap of two variable without using third variable Program
 To find even/odd number Program
 Count of even and odd count Program
 Fibonacci series Program
 Print the value in Fibonacci series up to 100 Program
 Write a Java program to check if the given number is a prime number
 Write a Java program to print a Fibonacci sequence using recursion
 Program to print first n Prime Number with explanation
 Program to find the Average of numbers with explanations
 Write a program to check given number is perfect or not
 Write a program to find greatest among three integers
 Write a program to check if a number is binary
 Write a logic to check whether a triangle is valid or not If 3 sides are
given
 Program to find simple interest
 Multiplication of the given number Program

2. String Program Questions:


 How do you reverse a string in Java?
 Write a Java program to check if a vowel is present in a string
 How do you check whether a string is a palindrome in Java?
 How do you remove spaces from a string in Java?
 How do you remove leading and trailing spaces from a string in Java?
 Count of each Character in the String Program
 Count of each Word Program
 Assume the string is he,xa,wa,re and give the output as hexaware
 Find the special character, uppercase, lowercase, Number of digits in
the given string
 Separate reverse of each word in the string Program
 Find the duplicate count in the string Program
 Count of vowels and non-vowels Program
 Count of Uppercase, lowercase, digits, special character Program
 Program to find the length of a string without using In-built functions
with dynamic inputs
 Write a Program to print all substrings of a given string
 Write a program to insert a sub-string into main string
 write a program that will check if two words are anagrams or not If
anagrams the output will be 1 if not the output will be 0
 write a program that will take one string as input the program will
then remove vowels a, e, i, o, from the string if there are two or more
than two vowels that occur together then the program shall ignore all
of those vowels

3. Array Program Question:


 Write a Java program that checks if two arrays contain the same
elements
 How do you find the second largest number in an array in Java?
 How do you reverse a linked list in Java?
 How do you sort an array in Java?
 Find the 3rd maximum number in an array Program
 Find the duplicate count in an array Program
 Remove duplicates from stored array Program
 How to check length of an array?
 How do you implement a binary search in Java?
 Write a Java program that illustrates merge sort
 How do you get the sum of all elements in an integer array in Java?
 How do you shuffle an array in Java?
 write a program to find the sum of diagonal elements of the n*n
matrix(square matrix).
 Write a program to Calculate sum of Primary and Secondary Diagonal
elements.
 Write a program that will search for the saddle points in a 5×5 matrix
array of integers

4. Extra Programming Questions:


 Write a program to check whether a given number is prime or not.
 Write a program to find the factorial of a given number.
 Write a program to find the sum of the digits of a given number.
 Write a program to reverse a given number.
 Write a program to find the GCD (Greatest Common Divisor) of two
numbers.
 Write a program to find the LCM (Least Common Multiple) of two
numbers.
 Write a program to check whether a given number is a palindrome or
not.
 Write a program to find the Armstrong number of a given number.
 Write a program to check whether a given number is perfect or not.
 Write a program to generate the Fibonacci series up to a given
number.
 Write a program to generate the Fibonacci series up to a given
number.
 Write a program to generate the sum of the series 1/1! + 2/2! + 3/3!
+ ... + n/n!
 Write a program to generate the sum of the series 1 + 1/3 + 1/5 + ... +
1/(2n-1)
 Write a program to generate the sum of the series 1 + 2 + 4 + 7 + 11 +
... + n terms
 Write a program to generate the sum of the series 1^2 + 2^2 + 3^2
+ ... + n^2
 Write a program to generate the sum of the series 1 + 1/2 + 1/4 + ... +
1/(2^n)
 Write a program to generate the sum of the series 1 - x^2/2! + x^4/4!
- ... + (-1)^n * x^(2n)/(2n)!
 Write a program to generate the sum of the series 1 + x/1! + x^2/2!
+ ... + x^n/n!
 Write a program to generate the sum of the series 1 + (1+x)/2! +
(1+x)^2/3! + ... + (1+x)^n/(n+1)!
 Write a program to print a right triangle pattern of asterisks with a
given height.
 Write a program to print a square pattern of asterisks with a given
side length.
 Write a program to print a diamond pattern of asterisks with a given
width.
 Write a program to print a pyramid pattern of asterisks with a given
height.
 Write a program to print a staircase pattern of asterisks with a given
height.
 Write a program to print a pattern of numbers in a pyramid shape.
 Write a program to print a pattern of numbers in a diamond shape.
 Write a program to print a pattern of alphabets in a right triangle
shape.
 Write a program to print a pattern of alphabets in a pyramid shape.
 Write a program to print a pattern of alphabets in a diamond shape.
 Write a program to reverse a given string.
 Write a program to count the number of vowels in a given string.
 Write a program to check whether a given string is a palindrome or
not.
 Write a program to check whether a given string is an anagram of
another string.
 Write a program to find the longest common prefix of a given array of
strings.
 Write a program to find the first non-repeating character in a given
string.
 Write a program to find the most frequent character in a given string.
 Write a program to remove all the white spaces from a given string.
 Write a program to convert a given string to all uppercase or all
lowercase.
 Write a program to find the length of the last word in a given string.
 Write a program to find the largest element in an array.
 Write a program to find the second largest element in an array.
 Write a program to find the smallest element in an array.
 Write a program to find the sum of all the elements in an array.
 Write a program to find the average of all the elements in an array.
 Write a program to find the most frequent element in an array.
 Write a program to rotate an array by a given number of elements.
 Write a program to sort an array in ascending or descending order.
 Write a program to remove all the duplicates from an array.
 Write a program to merge two sorted arrays into a single sorted
array.

You might also like