Panda Guru LogoPanda
Guru

Doordash | Items changed in the Menu

Round 1

Questions: Specific question not provided.

Follow-up Question

Candidate's Approach

The candidate described a method to compare two tree structures representing menus. The approach involves:

  • Defining a Node class to represent each item in the menu.
  • Implementing a countChangedNodes function to traverse both trees and count the number of changed nodes based on value changes and active status changes.
  • Handling cases where the tree structures differ by counting all nodes in the new tree if the old tree is null, and vice versa.
  • Using maps to facilitate comparison of child nodes and identifying additions, deletions, and intersections.
Interviewer's Feedback

No feedback provided.