DoorDash coding round (new grad 2024)
Anonymous User
1136

These are few questions that were encounteered in the DoorDash new grad 2024 hiring coding rounds.

  1. Each item in a list has a specific rating associated with it. You are given an item (its rating) and have to find the N items that are most similar to it (the absolute difference of ratings should be as less as possible for them to be similar). The item (rating) may or may not exist in the list. If you have two numbers that have the same difference, choose the smaller one.
    For e.g., items = [1,2,3,4,5], item=3, get_similar = 4
    Return [1,2,3,4]
  2. A variation of Coco eating bananas
  3. You have a binary tree of zones, represented as a list of numbers which has the parents of each node (index is the node, and the value in the list is the parent of that particular node). E.g., if the list is [-1, 0, 0] -> the parent of node 0 is -1 (as it is a root node), parent of node 1 and node 2 both are 0. The root zone has value 0, and all values are +ve integers. Remove one edge each time. The value of each zone is product of values of all nodes in that region. Return the number of nodes when the entire tree has the most optimized value.

Hope this helps!

Comments (5)