Mock Interview Questions
Mock Interview Questions
11. Write a program to find the two repeating elements in a given array.
12. Write a program to separate prime and non-prime numbers in separate arrays.
13. Write a program to move all zeros(0’s) to the end of a given array.
14. Write a program to move all zeros(0’s) to the beginning of a given array.
18. Write a program to count the total number of negative elements in an array.
19. Write a program to replace all Even numbers by 0 and Odd numbers by 1.
20. Write a program to replace all prime numbers by 0 and non-prime numbers by 1.
25. Write a program to separate positive and negative numbers in separate arrays.
26. Write a program to count the total number of unique elements in an array.
27. Write a program to count the total number of prime numbers in an array.
* *
** **
*** ***
**** ****
***** *****
****** ******
******* *******
******** ********
********* *********
********************
*
**
***
****
*****
******
*******
********
*********
**********
*********
********
*******
******
*****
****
***
**
*
3) Print this pattern using c programming.
1
232
34543
4567654
567898765
******
*****
****
***
**
*
**
***
****
*****
******
* *
** **
*** ***
*******
*** ***
** **
* *
6) print this pattern using c programming.
0
1 0 1
2 1 0 1 2
3 2 1 0 1 2 3
4 3 2 1 0 1 2 3 4
5 4 3 2 1 0 1 2 3 4 5
* * * * * * * *
* *
* *
* *
* *
* *
* *
*
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
9) print this pattern using c programming.
1 1
2 2
3 3
4 4
5
4 4
3 3
2 2
1 1
*****
* *
* *
* *
*****
**********
**** ****
*** ***
** **
* *
* *
** **
*** ***
**** ****
**********
12) print this pattern using c programming.
*****
****
***
**
*
**
***
****
*****
*****
* *
* *
* *
*****
*
*1*
*121*
*12321*
*1234321*
*123454321*
*1234321*
*12321*
*121*
*1*
*
15) print this pattern using c programming.
* *
* * * * * *
* * * * * * * * * *
* * * * * * * * * * *
* * * * *
* * * *
* * *
* *
* *
* * *
* * * *
* * * * *
17)print this pattern using c programming.
22
333
4444
55555
666666
*A*
*A*A*
*A*A*A*
* * * * *
* *
* * * * *
20) print this pattern using c programming.
*******
*******
*******
*******
*******
*******
*******
121
12321
1234321
123454321
12345654321
22) print this pattern using c programming.
5
45
345
2345
12345
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7
1 2 3 4 5
1 2 3
1
24)print this pattern using c programming.
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
+
+
+
+++++++
+
+
+
26)print this pattern using c programming.
*
**
* *
* *
* *
* *
* *
**
*
********
** **
* * * *
* ** *
* ** *
* * * *
** **
********
28)print this pattern using c programming.
*******
* *
* *
* *
* *
* *
*******
*
$*
*$*
$*$*
*$*$*
30)print this pattern using c programming.
A
11
BBB
2222
CCCCC
- - - - *
- - - * *
- - * * *
- * * * *
* * * * *
***
*****
*******
*********
*** ***
*** ***
*** ***
33) print this pattern using c programming.
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * *
* * * * *
* * * *
*
**
***
****
*****
35) print this pattern using c programming.
CO
COM
COMP
COMPU
COMPUT
COMPUTE
COMPUTER
HE
HEL
HELL
HELLO
HELL
HEL
HE
H
37) print this pattern using c programming.
12344321
123**321
12****21
1******1
5432*
543*1
54*21
5*321
*4321
" * "
" *** "
" ***** "
" ******* "
"*********"
40)print this pattern using c programming.
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1