Bootsess v2
Bootsess v2
Bootsess v2
Reverse n1
If rev(n1) > n2
N1+n2+rev(n1)
12345 12 3 45
n1 n2 n3
Reverse n1
If rev(n1) > n2
N1+n2+rev(n1)
Else
N1 + increment n2 + rev(n1)
Write a ‘C’ program to print the
following pattern
4444444
4333334
4322234
4321234
4322234
4333334
4444444
555555555
544444445
543333345
543222345
543212345
543222345
543333345
544444445
555555555
• 2n - 1 times print n
• decrement n , increment
row , col
•Repeat it till n becomes
zero
MsExcel columns has a pattern like
ABC…Z
AA AB AC…. AZ BA BB … ZZ
AAA AAB
A has code 1
Z has code 26
AA has code 27
AAA has code 626
given a number return a column name
as string
Write a function
isFactorialDivisible( int x, int y)
return true if x! is divisible by y
else
return false
Ex : isFactorialDivisible(5 ,6) returns TRUE
isFactorialDivisible(7,13) returns FALSE
• Find the factorial of X , divide
by Y check for reminder
•If Y is less than X,Y has to be
divisible by X
•Find all factors Y and check for
less than X
Given a number N, find the smallest 3 digits
number such that product of its digits is equal to N.
( algo+ optimal code)
if(n >729)
return -1; // number does not exist
else
find all the factors of the number n
if the greatest factor is greater than 9 return -1; //
number does not exist
else
generate lowest 3 digit number using a logic
Smart question i would say by the interviewer.
Ex : 100 - 455
Given a number design the
algorithm to find the next greater
number which contains exactly same
digits. e.g. n= 123 next greater with
same digits = 132
Ex :12345 – 12354 ,123454321 –
1235123445,54321 – NO , 12354 -
12435
Given a 2D matrix, print all elements of the given matrix in diagonal
order. For example, consider the following 5 X 4 input matrix.
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
Output :
1
5 2
9 6 3
13 10 7 4
17 14 11 8
18 15 12
19 16
20
Given a number N, now find the number of occurrences of
each digit 0..9 from 0 to N
Eg:
i/p: 12
o/p:
2
5
2
1
1
1
1
1
1
1
Print the numbers between 30 to 3000.
CONSTRAINT:
The numbers shouldn’t contain digits either in
increasing order or decreasing order.
FOLLOWING ALLOWED:
243,27,578,2344 etc.,
Implement a sudoku solution verifier function. The rules for
sudoku is this:
You have a 9 by 9 board. This board is divided into nine rows,
nine columns, and nine 3x3 blocks. In a solved puzzle, every
row, every column, and every 0 block has to contain each of the
digits from 1 to 9. This is an example of a solved puzzle:
248|395|716
571|628|349
936|741|582
---+---+---
682|539|174
359|174|628
714|862|953
---+---+---
863|417|295
195|286|437
427|953|861
Find numbers which are
palindromic in both their decimal
and octal representations
EX : (121)10 - (171)8
(292)10 - (444)8
(333)10 - (515)8
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 35 75 45 95 50 70 40 60 90 3
15 10
25 55
35 75
45 95 50 70 40 60 90 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 35 75 45 95 50 70 40 60 90 3
5
1 2
15 10
3 4
5 6
25 55
35 75
7 8 9 10 11 12 13 14
45 95 50 70 40 60 90 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 35 90 45 95 50 70 40 60 75 3
0
5
1 2
15 10
3 4
5 6
25 55
35 90
7 8 9 10 11 12 13 14
45 95 50 70 40 60 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 35 90 45 95 50 70 40 60 75 3
0
5
1 2
15 10
3 4
5 6
25 55
35 90
7 8 9 10 11 12 13 14
45 95 50 70 40 60 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 60 90 45 95 50 70 40 35 75 3
0
5
1 2
15 10
3 4
5 6
25 55
60 90
7 8 9 10 11 12 13 14
45 95 50 70 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 60 90 45 95 50 70 40 35 75 3
0
5
1 2
15 10
3 4
5 6
25 55
60 90
7 8 9 10 11 12 13 14
45 95 50 70 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 55 60 90 45 95 50 70 40 35 75 3
0
5
1 2
15 10
3 4
5 6
25 55
60 90
7 8 9 10 11 12 13 14
45 95 50 70 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 70 60 90 45 95 50 55 40 35 75 3
0
5
1 2
15 10
3 4
5 6
25 70
60 90
7 8 9 10 11 12 13 14
45 95 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 70 60 90 45 95 50 55 40 35 75 3
0
5
1 2
15 10
3 4
5 6
25 70
60 90
7 8 9 10 11 12 13 14
45 95 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 25 70 60 90 45 95 50 55 40 35 75 3
0
5
1 2
15 10
3 4
5 6
25 70
60 90
7 8 9 10 11 12 13 14
45 95 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 95 70 60 90 45 25 50 55 40 35 75 3
0
5
1 2
15 10
3 4
5 6
95 70
60 90
7 8 9 10 11 12 13 14
45 25 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 95 70 60 90 45 25 50 55 40 35 75 3
0
5
1 2
15 10
3 4
5 6
95 70
60 90
7 8 9 10 11 12 13 14
45 25 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 10 95 70 60 90 45 25 50 55 40 35 75 3
0
5
1 2
15 10
3 4
5 6
95 70
60 90
7 8 9 10 11 12 13 14
45 25 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 90 95 70 60 10 45 25 50 55 40 35 75 3
0
5
1 2
15 90
3 4
5 6
95 70
60 10
7 8 9 10 11 12 13 14
45 25 50 55 40 35 75 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 90 95 70 60 75 45 25 50 55 40 35 10 3
0
5
1 2
15 90
3 4
5 6
95 70
60 75
7 8 9 10 11 12 13 14
45 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 90 95 70 60 75 45 25 50 55 40 35 10 3
0
5
1 2
15 90
3 4
5 6
95 70
60 75
7 8 9 10 11 12 13 14
45 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 15 90 95 70 60 75 45 25 50 55 40 35 10 3
0
5
1 2
15 90
3 4
5 6
95 70
60 75
7 8 9 10 11 12 13 14
45 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 95 90 15 70 60 75 45 25 50 55 40 35 10 3
0
5
1 2
95 90
3 4
5 6
15 70
60 75
7 8 9 10 11 12 13 14
45 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 95 90 45 70 60 75 15 25 50 55 40 35 10 3
0
5
1 2
95 90
3 4
5 6
45 70
60 75
7 8 9 10 11 12 13 14
15 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 95 90 45 70 60 75 15 25 50 55 40 35 10 3
0
5
1 2
95 90
3 4
5 6
45 70
60 75
7 8 9 10 11 12 13 14
15 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
5 95 90 45 70 60 75 15 25 50 55 40 35 10 3
0
5
1 2
95 90
3 4
5 6
45 70
60 75
7 8 9 10 11 12 13 14
15 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
95 5 90 45 70 60 75 15 25 50 55 40 35 10 3
0
95
1 2
5 90
3 4
5 6
45 70
60 75
7 8 9 10 11 12 13 14
15 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
95 70 90 45 5 60 75 15 25 50 55 40 35 10 3
0
95
1 2
70 90
3 4
5 6
45 5
60 75
7 8 9 10 11 12 13 14
15 25 50 55 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
95 70 90 45 55 60 75 15 25 50 55 40 35 10 3
0
95
1 2
70 90
3 4
5 6
45 55
60 75
7 8 9 10 11 12 13 14
15 25 50 5 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
95 70 90 45 55 60 75 15 25 50 55 40 35 10 3
0
95
1 2
70 90
3 4
5 6
45 55
60 75
7 8 9 10 11 12 13 14
15 25 50 5 40 35 10 3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
3 70 90 45 55 60 75 15 25 50 5 40 35 10 95
0
3
1 2
70 90
3 4
5 6
45 55
60 75
7 8 9 10 11 12 13 14
15 25 50 5 40 35 10 95
1
1
2
2 3
6 5 4
5
6
3 4 7
7
3
2
1 4
5
8
6
7
1 2 3 4 5 6 7 8 9 10
1 1 1 1 1 1 0 0 0 0 0
2 1 1 0 0 0 1 0 0 0 0
3 1 0 1 1 0 1 1 0 0 0
4 1 0 1 1 1 0 0 1 0 0
5 1 0 0 1 1 0 0 0 1 0
6 0 1 1 0 0 1 0 0 0 1
7 0 0 1 0 0 0 1 0 0 0
8 0 0 0 1 0 0 0 1 0 1
9 0 0 0 0 1 0 0 0 1 1
10 0 0 0 0 0 1 0 1 1 1
START Name Link
-1 0 -1
1 -1
2 -1
3 -1
4 -1
END 5 -1
-1 6 -1
7 -1
8 -1
9 -1
10 -1
11 -1
NEWPOS
12 -1
-1
13 -1
14 -1
15 -1
16 -1
START Name Link
6 0 -1
1 -1
2 -1
3 -1
4 -1
END 5 -1
6 6 Sridhar Arumugasamy -1
7 -1
8 -1
9 -1
10 -1
11 -1
NEWPOS
12 -1
6
13 -1
14 -1
15 -1
16 -1
START Name Link
6 0 -1
1 Ashok I -1
2 -1
3 -1
4 -1
END 5 -1
1 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 -1
11 -1
NEWPOS
12 -1
1
13 -1
14 -1
15 -1
16 -1
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 -1
END 5 -1
15 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 -1
11 -1
NEWPOS
12 -1
15
13 -1
14 -1
15 Vaishnavi Narayanan -1
16 -1
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 -1
END 5 -1
10 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 Sophia Victor -1
11 -1
NEWPOS
12 -1
10
13 -1
14 -1
15 Vaishnavi Narayanan 10
16 -1
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 -1
END 5 NavaneethaPriya -1
5 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 Sophia Victor 5
11 -1
NEWPOS
12 -1
5
13 -1
14 -1
15 Vaishnavi Narayanan 10
16 -1
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 Jasdev -1
END 5 NavaneethaPriya 4
4 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 Sophia Victor 5
11 -1
NEWPOS
12 -1
4
13 -1
14 -1
15 Vaishnavi Narayanan 10
16 -1
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 Jasdev 16
END 5 NavaneethaPriya 4
16 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 Sophia Victor 5
11 -1
NEWPOS
12 -1
16
13 -1
14 -1
15 Vaishnavi Narayanan 10
16 Anthea -1
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 Jasdev 16
END 5 NavaneethaPriya 4
14 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 Sophia Victor -1
11 -1
NEWPOS
12 -1
14
13 -1
14 Revathi -1
15 Vaishnavi Narayanan 10
16 Anthea 14
START Name Link
6 0 -1
1 Ashok I 15
2 -1
3 -1
4 Jasdev 16
END 5 NavaneethaPriya 4
13 6 Sridhar Arumugasamy 1
7 -1
8 -1
9 -1
10 Sophia Victor 5
11 -1
NEWPOS
12 -1
13
13 KoushikPrabhu -1
14 Revathi 13
15 Vaishnavi Narayanan 10
16 Anthea 14
START Name Link
6 0 -1
1 4
5
8
6
7
3 3
2
1 4
5
8
6
7
3 3
2
2
9
1 4
5
8
6
7
3 3
2
2
9 1
1 4
5
8
6
7
3 3
2
2
9 1
6
1 4
5
8
6
7
3 3
2
2
9 1
6
1 4 5
5
8
6
7
3 3
2
2
9 1
6
1 4 5
5
8 4
6
7
3 3
2
2
9 1
6
1 4 5
5
8 4
6
7
3 3
2
2
9 1
6
1 4 5
5
8 4
8
6
7
3 3
2
2
9 1
6
1 4 5
5
8 4
8
7
6
7
3 3
2
2
9 1
6
1 4 5
5
8 4
8
7
6
7
50
50
40
50
40 70
50
40 70
10
50
40 70
10 44
50
40 70
10 44 60 80
50
40 70
10 44 60 80
20 75
50
40 70
10 44 60 80
49 55 65
20 75 90
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
50
40 70
10 44 60 80
49 55 65
20 75 90
15 46 53 58 73 77 91
45 47 72 74
START END
1000 2100
1550
26 2000
2000
16 2100
2100
95 NULL
START END
1000 4000
1550
26 2000
2000
4000 16 2100
25 NULL
3000 2100
65 4000 95 3000
START END
1000 4000
1550
26 2000
2000
4000 16 2100
25 NULL
3000 2100
65 4000 95 3000
START
1000
1000
45 1200
DATA NEXT 1200
65 1700
1700
DATA NEXT
15 1700
DATA NEXT