## General Instructions

- This question paper comprises 2 sections and a total of 20 questions.

- Section A comprises 10 programming questions for 40 minutes.

- Section B comprises 10 Aptitude questions for 35 minutes.

- The questions have no mistakes in logic, spelling, syntax, or meaning.

- Incorrect answers will not result in Negative marks.

- Each question carries one mark.

- Strictly avoid any form of malpractice; it will result in immediate disqualification.

- Write answers on the provided Answer Sheet and use the Rough Sheets for calculations.

- Please do not write or scribble anything on the question paper.

## Section A- Programming 6 questions | 25 minutes

**What does the ‘zoho’ method return when given the input ‘nums [7,1,5,3,6]’?**

public static int zoho(int[] nums) {

return help(nums, 0, Integer.MAX_VALUE, 0);

}

private static int help(int[] nums, int i, int min, int max){

if (nums.length==i)

return max;

int diff = nums[i] – min;

max=Math.max(diff, max);

min=Math.min(min, nums[i]);

return help(nums, ++i, min, max);

}

**What does the ‘zoho’ method return when given the input ‘nums = [6,5,4,12]’?**

public int[] zoho(int[] nums) {

int[] temp=new int[101];

for(int i=0; i<nums. length; i++)

temp[mums[i]] +=1;

for(int j=1;j<= 100; j++)

temp[j] += temp[j-1];

for(int k=0; k<nums.length; k++) {

int pos = nums[k];

nums[k]=pos==0 ? 0 : temp[pos-1];

}

return nums;

}

**What is the ‘zoho’ method’s output with ‘s = “RLRRLLRLRL”’?**

public int zoho(String s) {

int result = 0;

int sum = 0;

for (char c: s.toCharArray()) {

sum+=(c==’R’? 1: -1);

if (sum==0)

result++;

}

retum result;

}

**What is the ‘zoho’ method’s output with’s “l[*e*et|c**|*de|”’?**

public int zoho(String s) {

int ans-0, j=0;

for (int i=0; i<s.length(); ++i) {

if (s.charAt(i) ==’*’ &&j%2==0)

ans++;

if(s.charAt(i) ==’|’)

j++;

}

return ans;

}

**What is the output of the ‘zoho’ method with ‘nums = [5,1,2,0,3 4]’ as input?**

public int[] zoho(int[]nums)

{

int[] ans = new int (nums,length);

for(int i=0;i<nums.length;i++)

ans[i]=nums[nums[i]];

return ans;

}

**What is the output of the ‘zoho’ method with ‘arr = [- 4, – 3, – 2, 6, 3, 1]’ as input?**

public int zoho(int[] arr)(

int curr=0;

int h = cur;

for(int i:arr){

cur +=i;

h=Math.max(h, cur);

}

retum h;

## Section B - Aptitude 10 questions | 35 minutes

- A train that is 500 meters long is moving at a speed of 63 kilometers per hour. A man is walking in the same direction as the train, and he is walking at a speed of 3 kilometers per hour. How many seconds will it take for the train to pass by the man completely?

- In how many ways can we choose a group of 5 men and 6 women from a pool of 8 men and 10 women?

- A man travels a certain distance. It takes him 10 hours to complete his journey. For the first half of the distance, he moves at a speed of 21 km/hr, for the second half, he travels at 24 km/hr. How long is the entire journey in kilometres?

- What is the smallest positive integer that is evenly divisible by all the integers from 1 to 10 (inclusive)?

- If four people who weave mats can make four mats in four days, how many mats would eight people who weave mats be able to make in eight days, assuming they all work at the same speed?

- A shopkeeper sells an item at a 250% loss. If he had sold it for 560 more, he would have made a 15% profit. What is the cost price of the item?

- If the average of five consecutive odd numbers is 23, what is the largest of these numbers?

- If A can complete a task in 15 days, B can complete the same task in 12 days, and C can complete it in 10 days, how long will it take for all three working together to complete the task?

- Two numbers A and B are such that the sum of 5% of A and 4% of B is two-third of the sum of 6% of A and 8% of B. Find the ratio of A: В.

- What is the probability that the sum of the numbers shown on two rolled dice is a prime number?