- Published on
Meesho OA
- Author
- Shared Anonymously
Meesho Online Assessment (OA) Experience:
During the Meesho Online Assessment, the initial round was conducted on the HackerRank platform. In this round, participants were required to solve three Data Structure and Algorithms (DSA) problems within a time frame of 1.5 hours. Diverse sets of problems were provided for candidates to work on. As a result of this assessment, I encountered the following questions:
Question 1: Optimizing Code
For the first question, we were presented with a code snippet that needed optimization. The code resembled the following:
function getXor(array, K):
loop from 0 to k-1:
array[i%n] = array[i%n] ^ array[n - (i%n)-1]
Here, the variable n
represented the size of the array, and K
represented the count of bitwise operations. The constraints were: 1 <= n <= 1e5 and 1 <= K <= 1e12.
Question 2: Substring Count
The second question was related to counting substrings based on a character, and the details of the problem can be found at the following link:
https://www.geeksforgeeks.org/number-substrings-count-character-k/
Question 3: Knapsack Problem with Constraints
The third question resembled the classic 0-1 Knapsack Problem, but with specific constraints:
- Number of items (n) was limited to 36.
- Profit[i] < 1e9, weight[i] < 1e9, and target < 1e9.
I initially attempted the 0-1 Knapsack approach using a map as dynamic programming, but unfortunately, I faced Time Limit Exceeded (TLE) due to the constraints. The problem had a feasible solution using the mid in the middle approach.