Zoho Latest Placement Exam: Leaked Question Paper

Zoho Latest Placement Exam: Leaked Questions & Answers

1)  A thief is spotted by a police from a distance of 100m. When the police start the chase, the thief also starts running. If the speed of the thief is 8km/hr and that of the police 10km/hr, how far the thief will have run before he is overtaken?

 

Answer: The thief will run approximately 396.67 meters before being overtaken.

2)Richard, Meredith, Shepherd, and Altman are seated around a square table. Richard is sitting to the left of Meredith. Shepherd is sitting to the right of Altman. Which of the following pairs are seated opposite each other?
a. Richard and Meredith
b. Shepherd and Altman
c. Shepherd and Meredith
d. Shepherd and Richard

Answer: d. Shepherd and Richard (assuming left/right as relative positions)

3)A basket contains 5 red 4 blue 3 green marbles. If three marbles are picked up at random, what is the probability that either all are green or all are red?
Answer: Probability is 120\frac{1}{20}.

4)In a group of 6 boys and 4 girls, 4 children are to be selected. In how many different ways can they be selected such that at least one boy should be there?
Answer: 209 ways.

5)A crate of mangoes contains one bruised mango for every 30 mangoes in the crate. If 3 out of every 4 bruised mangoes are considered unsellable, and there are 12 unsellable mangoes in the crate, then how many mangoes are there in the crate?Answer: 480 mangoes.

6)Robert walked 25 m towards the south. Then he turned to his left and walked 20 m. He then turned to his left and walked 25 m. He again turned to his right and walked 15 m. At what distance is he from the starting point and in which direction?Answer: 35 m east.

7)The average weight of a group of 22 students is 34 kg. When the weight of the staff is also included, the average weight increases by 2 kg. What is the weight of the staff?

Answer: The staff weighs 80 kg.

8)The sum of the present ages of a father and his son is 60 years. Six years ago, the father’s age was five times the age of the son. After six years, what will the son’s age be?

Answer: Son’s age will be 20 years.9)Susan’s Maths test had 75 problems. They were split into 10 arithmetic, 30 algebra, and 35 geometry problems. Although she answered 70% of the arithmetic, 40% of the algebra, and 60% of the geometry problems correctly, she did not pass the test because she got less than 60% of the problems right. How many more questions should she have answered correctly to earn a 60% pass grade?Answer: She needs 5 more correct answers to pass.

10)If 6 men and 8 boys can do a piece of work in 10 days while 26 men and 48 boys can do the same in 2 days, the time taken by 15 men and 20 boys to do the same type of work will be?

  • Answer: Time taken = 4 days.

11)A train 110 m long is running at a speed of 60 kmph. At what time will it pass a man who is running at 6 kmph in the direction opposite to that in which the train is going? (Answer in seconds)

  • Answer: It will take approximately 6 seconds for the train to pass the man.

12)Find the odd one out:
352, 682, 891, 972, 8124

  • Answer: The odd one out is 352.

13)A boat covers a certain distance downstream in 2 hours, while it comes back in 2 1/2 hours. If the speed of the stream is 5 kmph, what is the speed of the boat in still water?

  • Answer: The speed of the boat in still water is 45 km/h.

14)What will be the next number in the series: 400, 399, 402, 393, 402, 420,…?

  • Answer: The next number in the series is 402.

15)I. Blue apples cost more than green apples.
II. Blue apples cost less than red apples.
III. Red apples cost more than green apples and blue apples.

If the first two statements are true, is the third statement true or false?

  • Answer: The third statement is true.

Section B: Programming

1. Output of the Program

Given:

num = 30;
for (int counter = 0; counter < 5; counter++) {
switch (counter) {
case 0:
num += 3;
break;
case 2:
num += 2;
break;
case 4:
num += 4;
break;
default:
num -= 1;
}
}

  • Answer: The final value of num is 37.

2)Write the output of below snippet

#include <stdio.h>
void main() {
int p = 20, q = -30;
int x = (p++) + (–p) + (p–) + (++p) + (p–) + (++q);
int y = (–p) + (++q) + (q++) + (p++) + (q–) + (++q);
int z = (p++) + (–q);
printf(“%d %d %d %d %d”, x, p, y, q, z);
}

Answer:

  • p starts at 20 and q at -30.
  • After evaluating all the expressions:
    • x = (p++) + (--p) + (p--) + (++p) + (p--) + (++q) results in x = 20 + 20 + 21 + 21 + 20 + -29 = 73
    • y = (--p) + (++q) + (q++) + (p++) + (q--) + (++q) results in y = 19 + -28 + -28 + 19 + -27 + -27 = -72
    • z = (p++) + (--q) results in z = 20 + -28 = -8
  • Final values of p and q are 20 and -28, respectively.
  • The printf statement outputs: 73 20 -72 -28 -8

3)Write the output of the below code:

#include <stdio.h>
int rec(int n) {
if (n <= 1)
return 1;
return n * rec(n – 1);
}

int main() {
int num = 4;
int result = rec(num);
printf(“Result: %d\n”, result);
return 0;
}

Answer:

The output of the recursive factorial program:

  • rec(4) calculates the factorial of 4: 4×3×2×1=244 \times 3 \times 2 \times 1 = 24
  • The output will be: Result: 24

4)What does the below snippet achieve

void custom_fn(int &x, int &y) {
x = x ^ y;
y = x ^ y;
x = x ^ y;
}

Answer:

The function custom_fn achieves swapping the values of x and y without using a temporary variable. This is done using the XOR bitwise operation.

5) Write the output of the below program :

#include <stdio.h>
int main() {
int x = 5;
int y = 3;
int z;
z = x + (-y) * z;
printf(“Result: %d\n”, z);
return 0;
}

 

6)Write the output of the below program :

#include <stdio.h>
void fun(int* arr, int n) {
int i;
*arr += *(arr + n – 1); // arr[0] = arr[0] + arr[n-1]
*(arr + n – 1) += *arr; // arr[n-1] = arr[n-1] + arr[0]
}

void printArr(int* arr, int n) {
int i;
for(i = 0; i < n; ++i)
printf(“%d “, arr[i]);
}

int main() {
int arr[] = {20, 30, 40};
int size = sizeof(arr) / sizeof(*arr);
fun(arr, size);
printArr(arr, size);
return 0;
}

Answer:
After the function, the array is {60, 30, 100}.

7) What should be the if condition to print “lighthouse”?

#include <stdio.h>
int main() {
if( 1 ) { // This is the required condition
printf(“%s”, “light”);
} else {
printf(“%s”, “house”);
}
return 0;
}
Answer:
To print “lighthouse,” the if condition must always be true. The simplest way to do this in C is to use if(1) which is always true. Therefore, the complete word “lighthouse” will be printed when the program runs.

8)

#include <stdio.h>

int main() {
int var1 = 9;
int var2 = 3;
printf(” %d\n”, var1);
printf(“%d\n”, var2);
return 0;
}

Answer :
9

3

9)

class Main {

public static int i = 10;

Main() {
int i = 80; // This is a local variable in the constructor
}

public static void main(String[] args) {
change(); // Calls the static method change()
new Main(); // Creates a new instance of Main, but doesn’t affect the static variable i
System.out.println(i); // Prints the static variable i
}

static int change() {
i = 22; // Changes the value of the static variable i
return i;
}
}

Answer:
22

10)

#include <stdio.h>

int fun(int a, int b) {
if (b == 0)
return 0;
if (b % 2 == 0)
return fun(a + a, b / 2);
return fun(a + a, b / 2) + a;
}

Answer:
15

Round 2
—————————————
Need to write/ execute  4 codes correctly

Problem 1: Closest Larger Number

Given an array of numbers, for each element in the array, identify the closest number that is larger than the current element. Use -1 if no such larger number exists.

Example:

  • Input: [1, 4, 2, 5, 4]
  • Output: 4  5 5  -1  -1

Explanation:

  • For 1: The next largest is 4.
  • For 4: The next largest is 5.
  • For 2: The next largest is 5.
  • For 5: No larger number exists.
  • For 4: No larger number exists.

Problem 2: Longest Palindromic Substring

Given a string, find the longest substring which is a palindrome.

Input 1: “Revives”
Output 1: “evive”
Explanation: The longest palindromic substring is “evive”.

Input 2: “Statues”
Output 2: “tat”
Explanation: The longest palindromic substring is “tat”.

Input 3: “Kayak”
Output 3: “Kayak”
Explanation: The longest palindromic substring is “Kayak”.

Problem 3: Mask Email Address

Given an email address, mask all characters in the username part of the email except for the first and last characters. Keep the domain part unchanged. If the username is less than or equal to two characters, leave it unchanged.

Input 1:management@longexample.com
Output 1: “m**********t@longexample.com

Input 2:administrator@testing.com
Output 2: “a***********r@testing.com

Input 3:scheessantsex@example.com
Output 3: “s***********x@example.com

Input 4:info@test.com
Output 4: “i**o@test.com

Problem 4: Numerical Keypad Typing

Given a phrase, find the equivalent number combination to print the phrase in a numeric keypad of a mobile phone. Use space to denote pause, in case of repeated characters.

  • Key 1: 1
  • Key 2: a,b,c
  • Key 3: d,e,f
  • Key 4: g,h,i
  • Key 5: j,k,l
  • Key 6: m,n,o
  • Key 7: p,q,r,s
  • Key 8: t,u,v
  • Key 9: w,x,y,z
  • Key 0: space

Example:

  • Input: sour mango
  • Output: 77776668887770626664666
  • Input: balloon
  • Output: 22 2555 555666 666 66

    Code :


Problem 5:

Given two strings containing 24-hour format time of the format “hh:mm

” (example: “13:10:05”), find the smallest time difference between the two, in number of seconds.

Input | Output
10:10:00 | 5
10:10:05

22:59:00 | 60
23:00:00

12:00:00 | 3600
13:00:00

3rd Round

Need to execute one question out of three


1)Tic Tac Toe game
2)Hashmaps question
3) Taxi booking System

Leave a Reply

Your email address will not be published. Required fields are marked *