Panda Guru LogoPanda
Guru

Meesho | SDE-1 | OA

Round 1

Questions:

  1. Question 1:

    You are given an array of size N consisting of lowercase English alphabets. A continuous subarray is good if it consists of only vowels. Count the number of good subarrays. Input - 1st line consists of length of string 2nd line contains the string Example input - 3 iab Example output - 3
  2. Question 2:

    Given a large array a of size n initially filled with elements a[i]=i, the following process is repeated until there is only one element left: 1. Erase the first element, a[1]. 2. Let x be the number of elements remaining in the current array. Move the first floor(x/2) elements after the last x-floor(x/2) elements. 3. Erase the first element a[1]. 4. Reverse the entire array. 5. Repeat the process from step 1 until only one element is left. The goal is to find the value of the last remaining element in the array after performing this cyclic process. You can break in the middle if there is only one element left. Note: The array is indexed from 1. Sample testcase - Input=5 => Output=2. Explanation - The array transformation here is 1. [1,2,3,4,5] 2. [2,3,4,5] 3. [4,5,2,3] 4. [5,2,3] 5. [3,2,5] 6. [2,5] 7. [5,2] 8. [2]
  3. Question 3:

    You have a group of friends who are playing a video game. Each friend has won (Ai) and lost (Bi) number of matches. The score of each friend is calculated using a specific formula. Your task is to sort the friends based on their scores and print the leaderboard. Each friend is assigned a unique number from 1 to N. The score of each friend is calculated using the formula: (Ai-Bi)^2 / (Ai*Bi). If two friends have the same score, the friend with the higher number (i.e. the one who played later) is considered to have a better score. Input format - 1st line contains N Next N lines contain Ai and Bi Sample input - 3 2 1 3 2 4 2 Sample output - 3 1 2
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.