0% found this document useful (0 votes)
13 views18 pages

Interview Prospective Programming Questions

The document lists a series of programming interview questions that cover various topics such as algorithms, data structures, and string manipulation. Each question requires writing a program to solve a specific problem, ranging from finding factorials to checking for palindromes and array equality. The questions are designed to assess a candidate's coding skills and understanding of fundamental programming concepts.

Uploaded by

madhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views18 pages

Interview Prospective Programming Questions

The document lists a series of programming interview questions that cover various topics such as algorithms, data structures, and string manipulation. Each question requires writing a program to solve a specific problem, ranging from finding factorials to checking for palindromes and array equality. The questions are designed to assess a candidate's coding skills and understanding of fundamental programming concepts.

Uploaded by

madhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Interview prospective programming questions

1. Write a program to find factorial of the given number. ?

2. Write a program to check whether the given number is even or odd.


3. Write a program to swap two numbers using a temporary variable.

4. Write a program to swap two numbers without using a temporary


variable.
5. Write a program to swap two numbers using bitwise operators.

6. Write a program to find the greatest of three numbers.


7. Write a program to find the greatest among ten numbers.

8. Write a program to check whether the given number is a prime.


9. Write a program to check whether the given number is a palindrome c
number.

10. Write a program to check whether the given string is a palindrome.


11. Write a program to generate the Fibonacci series.

12. Write a program to print "Hello World" without using semicolon


anywhere in the code.
13. Write a program to print a semicolon without using a semicolon
anywhere in the code.

14. Write a program to delete a specified line from a text file.


15. Write a program to find the number of lines in a text file.

16. Write a program to display the multiplication table of a given


number.
17. WAP to find out the longest word in a string.

18. WAP to print the triangle of letters in increasing order of lines..

19. WAP to print 'xay' In place of every 'a 'in a string


20. Count the Total Number of 7 coming between 1 to 100.

21. WAP to find out if a given number is a power series of 2 or not?


22. WAP to check Array Equality without using predefined method.
package com.array.prog;

import java.util.Arrays;

public class ArrayEquality {


// Approach : 1(By using Predefined methods)

public boolean equal(int[] i1, int[] i2) {


boolean isEqual = false;

Arrays.sort(i1);
Arrays.sort(i2);

if (Arrays.equals(i1, i2)) {
isEqual = true;
} else {
isEqual = false;
}
return isEqual;
}

// Approach : 2(without using Predefined methods)


public boolean equalArray(int[] i1, int[] i2) {
boolean isEqual = false;
for (int i = 0; i <= i1.length - 1; i++) {
for (int j = 0; j <= i2.length - 1; j++) {
if (i1[i] == i2[j]) {
isEqual = true;
}
}
}
return isEqual;
}

public static void main(String[] args) {


System.out.println("is Equal :"
+ new ArrayEquality().equal(new int[] { 1,
2, 3, 4 },
new int[] { 4, 3, 2, 1 }));

System.out.println("is Equal :"


+ new ArrayEquality().equalArray(new int[] {
1, 2, 3, 4 },
new int[] { 1, 2, 3, 4 }));
}
}
23. WAP to find duplicate from Array?

24. WAP to print second largest number of given Array?


25. WAP to find sum of no forgiven number from Array?

26. WAP to find duplicate from String?


By using Collection:
By using String method:

27. WAP to find number of occurrence of character from given String?


28. WAP to remove White Space from given Sentence?

29. WAP to check string anagram?


30. WAP to reverse string?
31. WAP to find Armstrong number?

32. WAP to find sum of digit?

You might also like