Junior programmer Interview Questions
719
Junior Programmer interview questions shared by candidates
How to check if a number is divisible by 16 without using operator / or % ?
8 Answers↳
Bit wise right shift four times, if integer then divisible.
↳
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. Less
↳
should do using bit-wise operators

How to check if a number is even or odd without using % or / ?
4 Answers↳
perform 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 odd Less
↳
int num; cout > num; if ((1 & num) == 1) { cout << "Odd \n"; } else { cout << "Even \n"; } Less
↳
How 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; } Less

Sabes que es c++?
4 Answers↳
Si, lo sé
↳
Es un lenguaje de programación .
↳
Sí, lo sé. Es un lenguaje de programación.

Do you have any children?
3 Answers↳
This question cannot be asked by an HR person. Illegal
↳
No I don't have any yet. I'd like to get married first.
↳
It is illegal, but they ask questions like that all the time. You can just answer it if you think it won't be used against you. But I prefer, "That's an interesting question, why do you ask?" Less

1. reverse a string eg. " the ram " to "mar eht" 2. one pattern questions eg. pyramid
2 Answers


All the questions were easy and basic. Do you know how to download and install software?
1 Answers↳
Yes I have experience doing this