ZOHO

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ZOHO

Round – I
1. Write a C program for the following output
If input is 5

The sample output should be


0
505
45054
3450543
234505432
12345054321

2. Write a C program to validate the input string as given below.


Get the string
Example:
{}[{}] - Valid string
}{[}{ - Invalid string
{}{[}] - Invalid string

3. Get a 3 digit or 2 digit number and add it with the reversed number. Check whether the sum
is palindrome if not add it with the reversed number and check whether it is palindrome.
Example:

39+93=132
132+231=363 Stop

122+221=343 Stop

173+371=544
544+445=989 Stop

If the iteration reaches five (5) terminate the program.

4. Reverse the string by keeping the special characters in the same position.

my name:? is natara!jan;
najara:?ta nsiema!nym;

5. Generate the 10 digit number with non-repeating digits


i) first digit should be divisible by 1
ii) first 2 digits should be divisible by 2
. .
. .
. .
iii) first 10 digits should be divisible by 10
6. Input Input
3 5
0
Output Output
303 505
32023 54045
3210123 5430345
543202345
54321012345

7. Input: I buy a pen (by traversing only once through the array)
Output: n ipa u ubi

8. Generate a special 10 digit no. whose


First digit is divisible by 1
First 2 digits are divisible by 2
First 3 digits are divisible by 3
.
.
.
First 10 digits are divisible by 10 without any repetition in digits.

Zoho: Round – II
1. To check if given parenthesis is balanced or not
Ex.
a. { { [ ] } } – balanced
b. { { } ] - not balanced
2. I / P : 3
O/P: 0
a. 3 0 3
b. 2 3 0 3 2
c. 1 2 3 0 3 2 1
3. Get a 2 or 3 digit number as input, reverse the number and add with the same number and
check if the result and is palindrome or not. If it is not palindrome. eg. A in reverse the
numbers add and check if it is palindrome, if not repeat it 5 times .if it is not palindrome upto
5 steps print “No” if it is palindrome print “Yes”.
4. Reverse given string with space and special character at the same places
E.g. House 1 no :12
21one 1 su : oh
5. Generate a 10 digit number such that 1st number is divisible by 1, first & second number is
divisible by 2, first three number divisible by 3.first 10 number divisible by 10
6. No. of squares in a chess board (Answer: 12+22+…….+82)

7. There are 10 coins in 10 stack. Each stack weighs 10 grams except 1 stack which weights
11 grams. Find the heaviest stack in minimum no. of weighs in balance.
8. Cost of 1 horse = Rs.10
1 goat = Rs.1
8 ducks=Rs.1
A farmer has Rs.100. He has to buy 100 animals containing at least one in all the three
Cow?

9. A family was stuck inside a cave, father can travel through it within 1 min, mother in 2 min,
daughter 5 min, son 4 min. only two can travel through a tunnel at a time. No one travels
alone. Find the least time taken for the family to cross.
Note: The speed of the two (together) is the least among the two.

10. In a bus, there are 4 children. Each has 4 bag. Each bag has 4 dogs. Each dog has 4
puppies. Each puppy has 4 legs. Each leg has 4 toes. Find the total no. of toes in the bus.

11. X has bought 150 pens and misplaced some pens. The clue given by her to find the
misplaced pens are
i) The count when divided by 2 gives remainder 1
ii) The count %3 gives rem 2
iii) The count %4 gives rem 3
iv) The count %5 gives rem 4
v) The count %6 gives rem 5
vi) The count %7 gives rem 0
Find the no. of misplaced number

Zoho: Round – III

Taxi booking system based on following conditions


1. The program should work for ‘n’ number of taxis.
a) First of all the taxis are in the same position
b) There are 6 points A,B,C,D,E and F which are in straight line
c) The distance between each and every point is 15 km.the amount to be paid for the
taxi should be based on,
d) For the 1st 5km ---Rs.500, Next---Rs.10 for each km
e) Get the starting point, destination, point,pickup time and customer ID from the user
f) Taxi should allotted to customer based on,
(i) Nearest starting point
(ii) Taxi with lowest salary
(iii) Pickup time

2. To find the minimum and maximum number in a given unsorted array within one iteration.

3. Merge two sorted array into single sorted array.

4. In a matrix, if an element ‘0’ is found, make the corresponding row and column as ‘0’. Find
the resultant matrix.

5. Print 1 to 100. Instead of nos. divisible by 15 print “fifteen” instead of nos. divisible by 3 print
“three” instead of nos. divisible by 5, print “five”.
What is graph, tree, map data structure

You might also like