Algorithm · DoorDash · Medium
Problem: Refund Decision Tree Evaluation An automated refund service uses a binary decision tree to determine the result of every refund request. A non-leaf node tests a boolean condition, such as: is_late == true missing_items >= 2 order_value > 50 A leaf contains the final outcome, such as: NO_REFUND PARTIAL_REFUND FULL_REFUND ESCALATE Given the tree and a collection of refund requests, determine the outcome produced for each request. Input Format The input begins with two…
Checking your access…