Junior software engineer Interview Questions | Glassdoor.co.in

# Junior software engineer Interview Questions

1,628

junior software engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

17 Apr 2018
hai

4 Oct 2017

### Junior Software Engineer at Pratian Technologies was asked...

15 Jun 2015
 write a program to print the given series (user need to enter the nth series number from keyboard) 2,3,5,11,23,29,41,53,83,89 .....n11 Answersimport java.util.Scanner; public class prg2 { public static void main(String[] args) { //2,3,5,11,23,29,41,53,83,89 .....n int i,count=0,n,j,flag,x=0; System.out.println("Enter number of term:"); Scanner sc=new Scanner(System.in); n=sc.nextInt(); for(i=2;true;i++){ flag=1; for(j=2;j<=i/2;j++){ if(i%j==0){ flag=0; break; } } if(flag==1){ ++count; if(count%4!=0){ System.out.println(i); ++x; } } if(x==n) break; } } }import java.util.Scanner; public class Series2 { static Boolean prime(int p) { for(int i=2; iwhat's the logic?Show more responses#include main() { int i,k,n,m,count=0; scanf("%d",&n); for(i=2;i<=n;i++) { for(k=0;k<=i;k++) { if((i%k==0)) count++; } if(count==2) m=2*i+1; count==0; for(k=0;(m!=0)&&(k<=m);k++) { if((m%k==0)) count++; } if(count==0) printf("%d",m); } }#include main() { int i,n,p,k,count=0,plus=0; printf(:enter the no\n"); scanf("%d",&n); for(i=2;i#include int prime(int num) { int i,c=0; for(i=2;iAnswer is in java :100% correct public class ProgramDemo { public static void main(String[] args) { System.out.println("Enter the value :"); Scanner read = new Scanner(System.in); int number = read.nextInt(); for(int i=2;i<=number;i++){ if(Prime(i)){ if(Prime(2*i+1)){ System.out.print(" "+i); } } } } static boolean Prime(int a) { int temp, c; for (c = 2; c <= a - 1; c++) { temp = a % c; if (temp == 0) { return false; } } if (c == a) { return true; } return false; } } I Hope its helpful for you :) Plese give me one like for it ....Excellent broimport java.util.Scanner; public class HelloJava { public static void main(String args[]) { int i,flag=0; for( int x = 2 ;x<100 ;x++) { flag=0; for(i=2;i<=x-1;i++) { if(x%i==0) { flag = 1; break; } } if(flag==0) { for( i = 2; iCan anyone please explain the logic?#include #include void main() { int i; printf("Enter no. of terms \n"); for(i=2; i<=50 ; i= 2*i+1) { printf("\n %d", i); } return 0; }

### Junior Programmer at Ubisoft was asked...

14 Jul 2017
 How to check if a number is divisible by 16 without using operator / or % ?8 Answersshould do using bit-wise operatorsI will run a loop that'll subtract 16 from the number. If result is zero than it is divisible else if it goes less than zero than its is not.Bit wise right shift four times, if integer then divisible.Show more responsesfor(int i=0;in) { break; } //number is not divisible by 16 //which will be decided by the flag } }Sorry for that incompleted answer ! I want to say that simply use a loop upto n and multiply each number with 16 and store in a variable and then go for a check if it is matched by n or not. If matched then flag==true else break;If a number is divisible by 2^n, do bitwise right shift n times and then bitwise left shift n times to get back the same number.if(16>>4 == 0 ) True; else FalseThe above condition should be 1 instead of 0. if(16>>4 == 1 ) True; else False

### Junior Java Developer at Naaptol was asked...

20 Dec 2017
 question mostly about output prediction of java code 5 Answersthey have already started conducting interviewsCan I know starting date pleaseWas it only for profound studentsShow more responsesHow many were shortlisted for the next round..??I have attended third round. That was horrible

### Junior Programmer at Ubisoft was asked...

14 Jul 2017
 How to check if a number is even or odd without using % or / ?4 Answersperform bitwise AND of given number with 1 and check the last bit if it is zero then number is even and if it is 1 then number is oddHow if we subtract 2 from given number while x>0. set flag=1 in while loop if x==0 found and break the while loop. Like this : int main() { int x,flag=0; cin>>x; do { x=x-2; if(x==0) { flag=1; break; } }while(x>0); if(flag==1) { cout<<"Even"; } else {cout<<"ODD";} return 0; }#include using namespace std; int main() { int n; cout>n; bool flag=false; //lets do the logic //1.even/odd logic for(int i=2;in) { break;//break the loop for time complexity } } } if(flag) { cout<<"It is even number"<Show more responsesint num; cout > num; if ((1 & num) == 1) { cout << "Odd \n"; } else { cout << "Even \n"; }

### Junior Software Engineer at People Tech Group was asked...

25 Sep 2014
 Describe yourself in three words.4 AnswersConfident Conscientious DiligentI am very interested in learningI am very interested in learningShow more responsesI am very interested in learning

26 Jun 2012