Dunzo Interview Experience

Dunzo is an Indian firm that distributes groceries, household items, fruits and vegetables, meat, pet supplies, cuisine, and pharmaceuticals to major cities.
Dunzo reported revenue from operations of $6.22 million (Rs 45.8 crore) in FY21, up 66.5 percent from $3.73 million (Rs 27.5 crore) in FY20. In FY19, the Bangalore-based delivery firm recorded total revenue of $483K (INR 3.5 crores).
In this article I will share my Dunzo interview experience.
Round 1 (DS/Algo):
The test consisted of three questions on the hacker rank platform under 100 miniuts.
Two of them were DS Algorithms, and one was to implement a function.
Q1. Matrix summation
class Solution: def findBeforematrix(self, afterMatrix): m = len(afterMatrix) n = len(afterMatrix[0]) for i in range(m-1, -1, -1): for j in range(n-1, -1, -1): if i-1 = 0 and j-1 = 0: afterMatrix[i][j] = afterMatrix[i][j] - afterMatrix[i-1][j] - afterMatrix[i][j-1] + afterMatrix[i-1][j-1] elif j-1 = 0 and i-1 0: afterMatrix[i][j] -= afterMatrix[i][j-1] elif i-1 = 0 and j-1 0: afterMatrix[i][j] -= afterMatrix[i-1][j] return afterMatrix s = Solution() afterMatrix = [[2,5], [7,17]] result = s.findBeforematrix(afterMatrix) print(result)
Q2. Maximum Sum of 3 Non-Overlapping Subarrays
from itertools import accumulate
from functools import lru_cache
class Solution:
def maxSumOfThreeSubarrays(self, nums: List[int], k: int) - List[int]:
n = len(nums)
windows = list(accumulate(nums))
windows = [windows[i+k-1]-(windows[i-1] if i0 else 0) for i in range(len(windows)-k+1)]
@lru_cache(None)
def dfs(i, t):
if t == 0:
return 0, []
if i = len(windows):
return float('-inf'), []
cost1, sol1 = dfs(i+k, t-1)
cost2, sol2 = dfs(i+1, t)
if windows[i] + cost1 cost2:
return cost2, sol2
return windows[i] + cost1, [i]+sol1
return dfs(0, 3)[1]
Comments