Java developer Interview Questions in Gurgaon, Haryana | Glassdoor.co.in

Java developer Interview Questions in Gurgaon, Haryana

378

java developer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

program for Armstrong number and program for factorial

3 Answers

*Armstrong Number= { int num=370,number,temp,total=0; number=num; while(number!=0) { temp=number%10; total=total+temp*temp*temp; number/=10; } if(tota==num) System.out.println(num+"is an Armstrong Number"); else System.out.println(num+"is not an Armstrong Number"); } *Factorial using For Loop= { int number=5; long fact=1; for(int i=1;i<=number;i++) { fact=fact*i; } System.out.println("Factorial of "+number+" is:"+fact); } *Factorial using While Loop= { int=5; long fact=1 int i=1; while(int i<=number) { fact=fact*i; i++; } System.out.println("Factorial of "+number+" is:"+fact); }

*Armstrong Number= { int num=370,number,temp,total=0; number=num; while(number!=0) { temp=number%10; total=total+temp*temp*temp; number/=10; } if(tota==num) System.out.println(num+"is an Armstrong Number"); else System.out.println(num+"is not an Armstrong Number"); } *Factorial using For Loop= { int number=5; long fact=1; for(int i=1;i<=number;i++) { fact=fact*i; } System.out.println("Factorial of "+number+" is:"+fact); } *Factorial using While Loop= { int=5; long fact=1 int i=1; while(int i<=number) { fact=fact*i; i++; } System.out.println("Factorial of "+number+" is:"+fact); }

*Armstrong Number= { int num=370,number,temp,total=0; number=num; while(number!=0) { temp=number%10; total=total+temp*temp*temp; number/=10; } if(tota==num) System.out.println(num+"is an Armstrong Number"); else System.out.println(num+"is not an Armstrong Number"); } *Factorial using For Loop= { int number=5; long fact=1; for(int i=1;i<=number;i++) { fact=fact*i; } System.out.println("Factorial of "+number+" is:"+fact); } *Factorial using While Loop= { int=5; long fact=1 int i=1; while(int i<=number) { fact=fact*i; i++; } System.out.println("Factorial of "+number+" is:"+fact); }

find out even and odd number without using %(modulas) and /(division) operator.

3 Answers

Find two elements with given sum in BST- expected answer in O(n) time ans O(1) space complexity. Java OOPS Singleton, Synchronized and Puzzles

2 Answers

Sum Array Puzzle Anagram find substring in particular string (All programs with a minimum complexity)

2 Answers

Factory design pattern

2 Answers

Can we have multiple inheritance in JAVA?

2 Answers

find the smallest number from sorted array has been rotated (Written Test)

1 Answer

core java basics question

1 Answer

OOPS Concept, Adv. java, Frameworks in java, Design Patterns

1 Answer

Coin change challenge DP problem (Written Test)

1 Answer
110 of 378 Interview Questions