Zoho Interview Experience | Set 22 (Experienced)

Only user-defined functions. No inbuilt functions at all.
No scanning for inputs, directly assign to vars.

Level 1: (2 hours – pen & paper)
1.Solve the equation X power Y with given values.

    Input: X=2, Y=-2
    Output: 0.25

2.Find the distance between two given points and round it to the nearest number.

    Input: (2,4)(4,10)
    Output: 6

3.Count the numbers of characters in the given string treating ‘$’ as escape sequence. If ‘$’ is preceeded by ”, consider it as normal ‘$’ and not the escape sequence. If ” occurs, treat it as single ”.

    Input: Hello$World$
    Output: 11

4.Given a 2D matrix, find the sum of all the elements.

    Input: [1 2 3]
           [4 5 6]
           [7 8 9]
    Output: 45

Level 2:
Finish one question to get the next type. Total 5 questions. (3 hours – machine round)
1.Solve the equation (XpowerY/Z!) + (Z/(X!+Z)) with given values of X, Y, Z. X and Z cannot be negative.

    Input: X=2, Y=3, Z=4
    Output: 1

2.Batman, Spiderman and Superman are going to start a business. The total investment is 1000M$. Anyone can add new investment to their existing investment. They can transfer investments between themselves. The program should be in OOP style and should have a menu for user to do all operations. (Something similar to below example.)

    a.Total investment should always be 
      equal to or lesser than 1000M$.
    b.Spiderman's investment should never
      exceed Batman's.
    c.Investment cannot go into negative.
    d.Display investments on each update.
    Input: batman = 300, spiderman = 250,
          superman = 100
    batman - 300
    spiderman - 250
    superman - 100
    add 100 into spiderman
    sorry, spiderman cant have more 
    investment than batman add 200 
    to batman
    batman - 500
    spiderman - 250
    superman - 100
    add 500 to superman
    sorry, total investment cant 
    exceed 1000. 

I couldn’t get the 3rd question as I ran out of time. Need to complete 3 questions to qualify for next round.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up