注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
原题
面试官是烙印态度很差貌似也没看过question
[\hide=100]
# Part 1 # You are in charge of implementing the dasher payment model. The first # version of the payment model is naively based on how much time dasher # spends on each order. Given the sequence of accepted/fulfilled order # activities from a given dasher on a given day, calculate the dasher # pay based on the following payment rules # 1. base pay rate: $0.3 per minute # 2. multi order pay rate: # ongoing deliveries * base pay rate # (when dasher is delivering multiple orders at the same time) # Assumptions: # 1. All order activities are from the same calendar day # 2. Order activity sequence is valid. All orders are fulfilled by end # of day (no duplicates, no fulfillment without pickup, no pickup # without fulfillment, etc).yle="color:rgb(226, 224, 220)"># 06:33: Dx picked up order B # 06:36: Dx fulfilled order A # 06:45: Dx fulfilled order B
# Output: final pay: $18.0
# Explanation: # 06:15 - 06:18 -> pay = $0.9 # 06:18 - 06:19 -> pay = 2 orders * 0.3 = $0.6 # 06:19 - 06:20 -> pay = $0.3 # 06:20 - 06:22 -> **peak pay** = 0.6 * 2 = $1.2 # 06:22 - 06:30 -> **peak pay** = 2 orders * 0.6 * 8= $9.6 # 06:30 - 06:33 -> pay = $0.9 # 06:33 - 06:36 -> pay = 2 orders * 0.3 * 3 = $1.8 # 06:36 - 06:45 -> pay = 0.3 * 9 = $2.7 [\hide] |