Meesho Coding Questions and Answers
Meesho Coding Questions with Solutions
Here on this page you will get Sample Meesho coding questions and answers which will help you to prepare for Online Coding Assessment of Meesho to hire freshers for SDE Role.
Let you know that the Online Assessment will be conducted on Hackerearth Platform. After Resume Shortlisting Candidates will be communicated through mail for Online Assessment on Hackerearth.
Meesho Hiring 2025 Details
Role: SDE Trainee (6-month traineeship)
Stipend: ₹1,00,000 per month
Location: Bengaluru (Hybrid, 3 days in-office)
Eligibility: B.E/B.Tech/M.E/M.Tech (CSE, IT, ECE, EEE, E&I) & MCA (2024 & 2025 batch)
Selection Process:
- Application Submission
- HackerEarth Coding Test
- Technical & Hiring Manager Interview
- Offer Letter Rollout
Full-Time Opportunity: Based on performance, FTE offer with ₹20 LPA + benefits
Key Dates:
- Apply by: 14th March 2025
- Coding Test: 22nd March 2025
- Interviews: 4th – 11th April 2025
- Offer Rollout: 12th April 2025
Note: No active backlogs allowed. Candidates who participated in Meesho hiring in the last 6 months are not eligible.
Checkout PrepInsta Prime:
Practice Coding Questions:
Further on this page you will get Sample Meesho Coding Questions and Answers that will help you to prepare for Meesho Online Coding Assessment on Hackerearth Platform.
Sample Meesho Coding Questions with Solutions
Question 1: Program to check Valid Palindrome.
Given a string s, return true if it is a palindrome, otherwise return false.
A palindrome is a string that reads the same forward and backward. It is also case-insensitive and ignores all non-alphanumeric characters.
Output: true
Explanation: After considering only alphanumerical characters we have “wasitacaroracatisaw”, which is a palindrome.
Constraints:
- 1 <= s.length <= 1000
- s is made up of only printable ASCII characters.
Solution:
Reverse String Method
This approach involves reversing the string representation of the array elements, sorting the reversed strings, and then checking for the longest consecutive sequence. However, it’s not commonly used for this problem as it focuses on string manipulation.
- Time complexity: O(n)
- Space complexity: O(n)
Code
public class Solution { public boolean isPalindrome(String s) { StringBuilder newStr = new StringBuilder(); for (char c : s.toCharArray()) { if (Character.isLetterOrDigit(c)) { newStr.append(Character.toLowerCase(c)); } } return newStr.toString().equals(newStr.reverse().toString()); } }
class Solution: def isPalindrome(self, s: str) -> bool: newStr = '' for c in s: if c.isalnum(): newStr += c.lower() return newStr == newStr[::-1]
class Solution { /** * Check if a character is alphanumeric * @param {char} char * @return {boolean} */ isAlphanumeric(char) { return (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z') || (char >= '0' && char <= '9'); } /** * @param {string} s * @return {boolean} */ isPalindrome(s) { let newStr = ''; for (let c of s) { if (this.isAlphanumeric(c)) { newStr += c.toLowerCase(); } } return newStr === newStr.split('').reverse().join(''); } }
Question 2: Buying and Selling Stocks Problem.
You are given an array prices, where each element prices[i] represents the price of PrepCoin on the i-th day.
Your task is to determine the maximum profit you can make by selecting one day to buy a PrepCoin and another day after it to sell.
If it’s not possible to make any profit (e.g., prices are decreasing every day), you should return 0. This means you can also choose not to make any transactions.
Output: 0
Explanation : No profitable transactions can be made, thus the max profit is 0.
Constraints:
- 1 <= prices.length <= 100
- 0 <= prices[i] <= 100
Solution:
Method 1: Two Pointers Method
Use a single pass with two variables to track the minimum price so far and the maximum profit, updating them as you traverse the array. This has a time complexity of O(n).
- Time complexity: O(n)
- Space complexity: O(1)
Code
public class Solution { public int maxProfit(int[] prices) { int l = 0, r = 1; int maxP = 0; while (r < prices.length) { if (prices[l] < prices[r]) { int profit = prices[r] - prices[l]; maxP = Math.max(maxP, profit); } else { l = r; } r++; } return maxP; } }
class Solution: def maxProfit(self, prices: List[int]) -> int: l, r = 0, 1 maxP = 0 while r < len(prices): if prices[l] < prices[r]: profit = prices[r] - prices[l] maxP = max(maxP, profit) else: l = r r += 1 return maxP
class Solution { /** * @param {number[]} prices * @return {number} */ maxProfit(prices) { let l = 0, r = 1; let maxP = 0; while (r < prices.length) { if (prices[l] < prices[r]) { let profit = prices[r] - prices[l]; maxP = Math.max(maxP, profit); } else { l = r; } r++; } return maxP; } }
Method 2: Dynamic Programming Method
This method maintain a table or array to store intermediate results, such as the minimum price up to a given day and the maximum profit calculated so far, optimizing computation over multiple traversals. Time complexity is O(n).
- Time complexity: O(n)
- Space complexity: O(1)
Code
public class Solution { public int maxProfit(int[] prices) { int maxP = 0; int minBuy = prices[0]; for (int sell : prices) { maxP = Math.max(maxP, sell - minBuy); minBuy = Math.min(minBuy, sell); } return maxP; } }
class Solution: def maxProfit(self, prices: List[int]) -> int: maxP = 0 minBuy = prices[0] for sell in prices: maxP = max(maxP, sell - minBuy) minBuy = min(minBuy, sell) return maxP
class Solution { /** * @param {number[]} prices * @return {number} */ maxProfit(prices) { let maxP = 0; let minBuy = prices[0]; for (let sell of prices) { maxP = Math.max(maxP, sell - minBuy); minBuy = Math.min(minBuy, sell); } return maxP; } }
Question 3: Program for Koko Eating Bananas Problem
You are given an array piles, where each element piles[i] represents the number of bananas in the i-th pile. You also have h hours to eat all the bananas. You can choose an eating rate of k bananas per hour. In each hour, you can eat up to k bananas from one pile.
If a pile has fewer than k bananas, you finish that pile but cannot switch to another pile during the same hour.
Your task is to find the minimum value of k that allows you to eat all the bananas within h hours.
Output: 2
Explanation:
With an eating rate of 2, you can eat the bananas in 6 hours. With an eating rate of 1, you would need 10 hours to eat all the bananas (which exceeds h=9), thus the minimum eating rate is 2.
Constraints:
- 1 <= piles.length <= 1,000
- piles.length <= h <= 1,000,000
- 1 <= piles[i] <= 1,000,000,000
Solution:
Using Binary Search Method
Use binary search to find the minimum eating speed by searching between 1 and the maximum pile size, checking the feasibility of each mid-speed.
- Time complexity: O(n * log m)
- Space complexity: O(1)
where n is the length of the input array piles and m is the maximum number of bananas in a pile.
Code
public class Solution { public int minEatingSpeed(int[] piles, int h) { int l = 1; int r = Arrays.stream(piles).max().getAsInt(); int res = r; while (l <= r) { int k = (l + r) / 2; long totalTime = 0; for (int p : piles) { totalTime += Math.ceil((double) p / k); } if (totalTime <= h) { res = k; r = k - 1; } else { l = k + 1; } } return res; } }
class Solution: def minEatingSpeed(self, piles: List[int], h: int) -> int: l, r = 1, max(piles) res = r while l <= r: k = (l + r) // 2 totalTime = 0 for p in piles: totalTime += math.ceil(float(p) / k) if totalTime <= h: res = k r = k - 1 else: l = k + 1 return res
class Solution { /** * @param {number[]} piles * @param {number} h * @return {number} */ minEatingSpeed(piles, h) { let l = 1; let r = Math.max(...piles); let res = r; while (l <= r) { const k = Math.floor((l + r) / 2); let totalTime = 0; for (const p of piles) { totalTime += Math.ceil(p / k); } if (totalTime <= h) { res = k; r = k - 1; } else { l = k + 1; } } return res; } }
Sample Meesho Coding Questions
Question 4: Power Function (Pow(x, n))
Implement a function pow(x, n)
that calculates x raised to the power n (i.e., x^n
).
Constraints :
-100.0 < x < 100.0
-231 <= n <= 231-1
n is an integer.
Either x is not zero or n > 0.
-104 <= xn <= 104
Solution:
class Solution { public double myPow(double x, long n) { if(n < 0) { x = 1 / x; n = -n; } double result = 1; double current_product = x; while(n > 0) { if(n % 2 == 1) { result = result * current_product; } current_product = current_product * current_product; n = n / 2; } return result; } }
class Solution: def myPow(self, x: float, n: int) -> float: if n < 0: x = 1 / x n = -n result = 1 current_product = x while n > 0: if n % 2 == 1: result = result * current_product current_product = current_product * current_product n = n // 2 return result
class Solution { myPow(x, n) { if (n < 0) { x = 1 / x; n = -n; } let result = 1; let currentProduct = x; while (n > 0) { if (n % 2 === 1) { result *= currentProduct; } currentProduct *= currentProduct; n = Math.floor(n / 2); } return result; } }
Question 5: Course Schedule Problem of Graphs.
You are given an array prerequisites, where each element prerequisites[i] = [a, b] means you must complete course b before taking course a.
For example, [0, 1] indicates that course 1 must be completed before course 0.
There are a total of numCourses, labeled from 0 to numCourses – 1. Return true if it is possible to complete all courses; otherwise, return false.
Output: true
Explanation: First take course 1 (no prerequisites) and then take course 0.
Constraints :
- 1 <= numCourses <= 1000
- 0 <= prerequisites.length <= 1000
- All prerequisite pairs are unique.
Solution:
Solving by Cycle Detection(DFS) Method
Treat the courses as a graph and use DFS to detect cycles. Maintain a visited set to track the current path during DFS. If a course is revisited in the same path, a cycle exists, making it impossible to complete all courses.
- Time complexity: O(V + E)
- Space complexity: O(V + E)
where V is the number of courses and E is the number of prerequisites.
Code
public class Solution { // Map each course to its prerequisites private Map<Integer, List<Integer>> preMap = new HashMap<>(); // Store all courses along the current DFS path private Set<Integer> visiting = new HashSet<>(); public boolean canFinish(int numCourses, int[][] prerequisites) { for (int i = 0; i < numCourses; i++) { preMap.put(i, new ArrayList<>()); } for (int[] prereq : prerequisites) { preMap.get(prereq[0]).add(prereq[1]); } for (int c = 0; c < numCourses; c++) { if (!dfs(c)) { return false; } } return true; } private boolean dfs(int crs) { if (visiting.contains(crs)) { // Cycle detected return false; } if (preMap.get(crs).isEmpty()) { return true; } visiting.add(crs); for (int pre : preMap.get(crs)) { if (!dfs(pre)) { return false; } } visiting.remove(crs); preMap.put(crs, new ArrayList<>()); return true; } }
class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: # Map each course to its prerequisites preMap = {i: [] for i in range(numCourses)} for crs, pre in prerequisites: preMap[crs].append(pre) # Store all courses along the current DFS path visiting = set() def dfs(crs): if crs in visiting: # Cycle detected return False if preMap[crs] == []: return True visiting.add(crs) for pre in preMap[crs]: if not dfs(pre): return False visiting.remove(crs) preMap[crs] = [] return True for c in range(numCourses): if not dfs(c): return False return True
class Solution { /** * @param {number} numCourses * @param {number[][]} prerequisites * @return {boolean} */ canFinish(numCourses, prerequisites) { const preMap = new Map(); for (let i = 0; i < numCourses; i++) { preMap.set(i, []); } for (let [crs, pre] of prerequisites) { preMap.get(crs).push(pre); } // Store all courses along the current DFS path const visiting = new Set(); const dfs = (crs) => { if (visiting.has(crs)) { // Cycle detected return false; } if (preMap.get(crs).length === 0) { return true; } visiting.add(crs); for (let pre of preMap.get(crs)) { if (!dfs(pre)) { return false; } } visiting.delete(crs); preMap.set(crs, []); return true; } for (let c = 0; c < numCourses; c++) { if (!dfs(c)) { return false; } } return true; } }
Question 6: Counting the Number of 1’s in Binary Representations of Numbers in a Range
Understanding binary numbers and efficiently processing them is a critical skill.
Common problem involves counting how many 1
bits are present in the binary representation of numbers within a given range.In this article, we will explore a solution to count the number of 1
bits in every number from 0
to n
.
We need to count the number of 1
bits in the binary representations of numbers from 0
to 4
. Let’s convert these numbers to binary:
0
in binary:0
→ Number of1
bits:0
1
in binary:1
→ Number of1
bits:1
2
in binary:10
→ Number of1
bits:1
3
in binary:11
→ Number of1
bits:2
4
in binary:100
→ Number of1
bits:1
Solution:
Method 1. Bit Mask – I
Time & Space Complexity
- Time complexity: O(1)O(1)
- Space complexity: O(1)O(1)
class Solution: def hammingWeight(self, n: int) -> int: res = 0 for i in range(32): if (1 << i) & n: res += 1 return res
public class Solution { public int hammingWeight(int n) { int res = 0; for (int i = 0; i < 32; i++) { if ((1 << i & n) != 0) { res++; } } return res; } }
class Solution { /** * @param {number} n - a positive integer * @return {number} */ hammingWeight(n) { let res = 0; for (let i = 0; i < 32; i++) { if ((1 << i) & n) { res++; } } return res; } }
Method 2. Built-In Function
Time & Space Complexity
- Time complexity: O(1)O(1)
- Space complexity: O(1)O(1)
Code
public class Solution { public int hammingWeight(int n) { return Integer.bitCount(n); } }
class Solution: def hammingWeight(self, n: int) -> int: return bin(n).count('1')
class Solution { /** * @param {number} n - a positive integer * @return {number} */ hammingWeight(n) { return n.toString(2).split('0').join('').length; } }
Meesho Coding Questions and Answers
Question 7: Print all combinations of balanced parentheses problem
You are given a positive integer n, representing the number of pairs of parentheses. Your task is to generate and return all possible combinations of well-formed (valid) parentheses strings that can be created using exactly n pairs.
A well-formed parentheses string maintains the correct order, meaning every opening parenthesis ( has a corresponding closing parenthesis ) that appears after it.
Output: ["((()))","(()())","(())()","()(())","()()()"]
Explanation: You may return the answer in any order.
Constraints:
- 1 <= n <= 7
Solution:
Using Dynamic Programming Method
Construct valid combinations using previously computed solutions for smaller values of n, combining them in different ways to form well-balanced parentheses for the current n.
- Time complexity: O(4^n/(n)^1/2)
- Space complexity: O(n)
Code
public class Solution { public ListgenerateParenthesis(int n) { List > res = new ArrayList<>(); for (int i = 0; i <= n; i++) { res.add(new ArrayList<>()); } res.get(0).add(""); for (int k = 0; k <= n; k++) { for (int i = 0; i < k; i++) { for (String left : res.get(i)) { for (String right : res.get(k - i - 1)) { res.get(k).add("(" + left + ")" + right); } } } } return res.get(n); } }
class Solution: def generateParenthesis(self, n): res = [[] for _ in range(n+1)] res[0] = [""] for k in range(n + 1): for i in range(k): for left in res[i]: for right in res[k-i-1]: res[k].append("(" + left + ")" + right) return res[-1]
class Solution { /** * @param {number} n * @return {string[]} */ generateParenthesis(n) { const res = Array.from({ length: n + 1 }, () => []); res[0] = [""]; for (let k = 0; k <= n; k++) { for (let i = 0; i < k; i++) { for (const left of res[i]) { for (const right of res[k - i - 1]) { res[k].push("(" + left + ")" + right); } } } } return res[n]; } }
Question 8: LRU Cache Leetcode Problem
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Implement the LRUCache class:
- LRUCache(int capacity) Initialize the LRU cache with positive size capacity.
- int get(int key) Return the value of the key if the key exists, otherwise return -1.
- void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache.
- If the number of keys exceeds the capacity from this operation, evict the least recently used key.
- The functions get and put must each run in O(1) average time complexity.
[[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]]
Constraints :
- 1 <= capacity <= 3000
- 0 <= key <= 104
- 0 <= value <= 105
- At most 2 * 105 calls will be made to get and put.
Solution:
class LRUCache { class Node { int key; int val; Node prev; Node next; Node(int key, int val) { this.key = key; this.val = val; } } Node head = new Node(-1, -1); Node tail = new Node(-1, -1); int cap; HashMap< Integer, Node> m = new HashMap<>(); public LRUCache(int capacity) { cap = capacity; head.next = tail; tail.prev = head; } private void addNode(Node newnode) { Node temp = head.next; newnode.next = temp; newnode.prev = head; head.next = newnode; temp.prev = newnode; } private void deleteNode(Node delnode) { Node prevv = delnode.prev; Node nextt = delnode.next; prevv.next = nextt; nextt.prev = prevv; } public int get(int key) { if (m.containsKey(key)) { Node resNode = m.get(key); int ans = resNode.val; m.remove(key); deleteNode(resNode); addNode(resNode); m.put(key, head.next); return ans; } return -1; } public void put(int key, int value) { if (m.containsKey(key)) { Node curr = m.get(key); m.remove(key); deleteNode(curr); } if (m.size() == cap) { m.remove(tail.prev.key); deleteNode(tail.prev); } addNode(new Node(key, value)); m.put(key, head.next); } }
class LRUCache: class Node: def __init__(self, key, val): self.key = key self.val = val self.prev = None self.next = None def __init__(self, capacity: int): self.cap = capacity self.head = self.Node(-1, -1) self.tail = self.Node(-1, -1) self.head.next = self.tail self.tail.prev = self.head self.m = {} def addNode(self, newnode): temp = self.head.next newnode.next = temp newnode.prev = self.head self.head.next = newnode temp.prev = newnode def deleteNode(self, delnode): prevv = delnode.prev nextt = delnode.next prevv.next = nextt nextt.prev = prevv def get(self, key: int) -> int: if key in self.m: resNode = self.m[key] ans = resNode.val del self.m[key] self.deleteNode(resNode) self.addNode(resNode) self.m[key] = self.head.next return ans return -1 def put(self, key: int, value: int) -> None: if key in self.m: curr = self.m[key] del self.m[key] self.deleteNode(curr) if len(self.m) == self.cap: del self.m[self.tail.prev.key] self.deleteNode(self.tail.prev) self.addNode(self.Node(key, value)) self.m[key] = self.head.next
class LRUCache { constructor(capacity) { this.capacity = capacity; this.map = new Map(); // Create dummy head and tail nodes this.head = new Node(-1, -1); this.tail = new Node(-1, -1); this.head.next = this.tail; this.tail.prev = this.head; } addNode(node) { let temp = this.head.next; node.next = temp; node.prev = this.head; this.head.next = node; temp.prev = node; } deleteNode(node) { let prev = node.prev; let next = node.next; prev.next = next; next.prev = prev; } get(key) { if (this.map.has(key)) { let resNode = this.map.get(key); let value = resNode.val; this.map.delete(key); this.deleteNode(resNode); this.addNode(resNode); this.map.set(key, this.head.next); return value; } return -1; } put(key, value) { if (this.map.has(key)) { let curr = this.map.get(key); this.map.delete(key); this.deleteNode(curr); } if (this.map.size === this.capacity) { this.map.delete(this.tail.prev.key); this.deleteNode(this.tail.prev); } let newNode = new Node(key, value); this.addNode(newNode); this.map.set(key, this.head.next); } } class Node { constructor(key, val) { this.key = key; this.val = val; this.prev = null; this.next = null; } }
Question 9: Encode and Decode Strings Problem
Design an algorithm to encode a list of strings to a single string. The encoded string is then decoded back to the original list of strings. Please implement encode and decode.
Output: ["we","say",":","yes"]
Constraints:
- 0 <= strs.length < 100
- 0 <= strs[i].length < 200
- strs[i] contains only UTF-8 characters.
Solution:
Solving Encoding and Decoding Method
This method use a delimiter (like a special character or length-prefix) to encode strings, and split the encoded string using the same delimiter to decode. Simple but may face issues with delimiter conflicts.
- Time complexity: O(m) for encode() and decode().
- Space complexity: O(n) for encode() and decode().
where m is the sum of lengths of all the strings and n is the number of strings.
Code
public class Solution { public String encode(Liststrs) { if (strs.isEmpty()) return ""; StringBuilder res = new StringBuilder(); List sizes = new ArrayList<>(); for (String str : strs) { sizes.add(str.length()); } for (int size : sizes) { res.append(size).append(','); } res.append('#'); for (String str : strs) { res.append(str); } return res.toString(); } public List decode(String str) { if (str.length() == 0) { return new ArrayList<>(); } List res = new ArrayList<>(); List sizes = new ArrayList<>(); int i = 0; while (str.charAt(i) != '#') { StringBuilder cur = new StringBuilder(); while (str.charAt(i) != ',') { cur.append(str.charAt(i)); i++; } sizes.add(Integer.parseInt(cur.toString())); i++; } i++; for (int sz : sizes) { res.add(str.substring(i, i + sz)); i += sz; } return res; } }
class Solution: def encode(self, strs: List[str]) -> str: if not strs: return "" sizes, res = [], "" for s in strs: sizes.append(len(s)) for sz in sizes: res += str(sz) res += ',' res += '#' for s in strs: res += s return res def decode(self, s: str) -> List[str]: if not s: return [] sizes, res, i = [], [], 0 while s[i] != '#': cur = "" while s[i] != ',': cur += s[i] i += 1 sizes.append(int(cur)) i += 1 i += 1 for sz in sizes: res.append(s[i:i + sz]) i += sz return res
class Solution { /** * @param {string[]} strs * @returns {string} */ encode(strs) { if (strs.length === 0) return ""; let sizes = [], res = ""; for (let s of strs) { sizes.push(s.length); } for (let sz of sizes) { res += sz + ','; } res += '#'; for (let s of strs) { res += s; } return res; } /** * @param {string} str * @returns {string[]} */ decode(str) { if (str.length === 0) return []; let sizes = [], res = [], i = 0; while (str[i] !== '#') { let cur = ""; while (str[i] !== ',') { cur += str[i]; i++; } sizes.push(parseInt(cur)); i++; } i++; for (let sz of sizes) { res.push(str.substr(i, sz)); i += sz; } return res; } }
Sample Meesho Coding Questions and Answers
Question 10: Kth Largest Element in an Array
Given an integer array nums and an integer k, return the kth largest element in the array.
Note that it is the kth largest element in the sorted order, not the kth distinct element.
Can you solve it without sorting?
Constraints :
- 1 <= k <= nums.length <= 10^5
- -10^4 <= nums[i] <= 10^4
class Solution { findKthLargest(nums, k) { // Create a max heap using a priority queue let maxHeap = new MaxHeap(nums); // Remove the top element (largest) k-1 times for (let i = 0; i < k - 1; i++) { maxHeap.pop(); } // The k-th largest element will be at the top now return maxHeap.top(); } } // Max Heap implementation using a Priority Queue class MaxHeap { constructor(arr) { this.heap = [...arr]; this.buildHeap(); } buildHeap() { this.heap.sort((a, b) => b - a); // Sort in descending order (Max Heap) } pop() { return this.heap.shift(); // Remove and return the largest element } top() { return this.heap[0]; // Return the largest element } }
class Solution { public int findKthLargest(int[] nums, int k) { quickSelect(nums, 0, nums.length - 1, k - 1); return nums[k - 1]; } Random r = new Random(); private int[] pivot(int[] nums, int start, int end) { int idx = start + r.nextInt(end - start + 1); int pivoted = nums[idx]; int i = start, j = start, k = end; while (j <= k) { if (nums[j] > pivoted) { swap(nums, i, j); i++; j++; } else if (nums[j] == pivoted) { j++; } else { swap(nums, j, k); k--; } } return new int[]{i, j}; } private void swap(int[] nums, int i, int j) { int temp = nums[i]; nums[i] = nums[j]; nums[j] = temp; return; } private void quickSelect(int[] nums, int start, int end, int k) { if (start > end) { return; } int[] pivotRes = pivot(nums, start, end); if (k >= pivotRes[0] && k < pivotRes[1]) { return; } if (k < pivotRes[0]) { quickSelect(nums, start, pivotRes[0] - 1, k); } else { quickSelect(nums, pivotRes[1], end, k); } } }
class Solution: def findKthLargest(self, nums: List[int], k: int) -> int: pivot=random.choice(nums) left=[x for x in nums if x>pivot] mid=[x for x in nums if x==pivot] right=[x for x in nums if x< pivot] n=len(left) m=len(mid) if k<=n: return self.findKthLargest(left,k) elif k>(n+m): return self.findKthLargest(right,k-(n+m)) else: return mid[0]
These were some of most Important Meesho Coding Questions and Answers. If you want to practice more you can visit our coding blogs to explore more….and also visit PrepInsta Prime Course.
FAQ's related to Meesho Coding Assessment
Question 1. What types of coding questions are asked in the Meesho hiring process?
Answer:
Meesho Coding Questions mainly includes topics like arrays, strings, dynamic programming, graphs, and recursion.
Problems can range from easy to hard, depending on the role you are applying for.
Question 2. Which programming languages are allowed for the meesho coding test?
Answer:
- Meesho allows candidates to code in multiple languages, including Java, Python and JavaScript.
It is best to use one of these three languages that you are comfortable with and has built-in support for efficient data structures.
Question 3. How can I prepare for Meesho coding round?
Answer:
To prepare effectively:
- Practice Coding Questions from our PrepInsta’s Coding Dashboard.
- Focus on Time & Space Complexity of solutions.
- Revise important algorithms like Binary Search, Two Pointers, and Graph Traversal.