Manager Engineering Interview Questions

8,494 manager engineering interview questions shared by candidates

Write a function to select the best coupon from a list that provides the maximum discount for a given cart value. Each coupon has fields: code (string), max_discount (numeric), priority (numeric, lower is higher priority), and min_cart_value (numeric). A coupon is eligible only if the cart value meets or exceeds its min_cart_value. Selection Rules Filter eligible coupons first, then rank by these criteria in order: Highest max_discount (primary) Lowest priority if discounts tie (secondary) Earliest occurrence in input list if both discount and priority tie (tertiary)​ Return the coupon details (or null/none if no eligible coupons). Assume input is an array of coupon objects and a numeric cart_value.
avatar

Engineering Manager

Interviewed at Tanla Platforms

3.5
Dec 3, 2025

Write a function to select the best coupon from a list that provides the maximum discount for a given cart value. Each coupon has fields: code (string), max_discount (numeric), priority (numeric, lower is higher priority), and min_cart_value (numeric). A coupon is eligible only if the cart value meets or exceeds its min_cart_value. Selection Rules Filter eligible coupons first, then rank by these criteria in order: Highest max_discount (primary) Lowest priority if discounts tie (secondary) Earliest occurrence in input list if both discount and priority tie (tertiary)​ Return the coupon details (or null/none if no eligible coupons). Assume input is an array of coupon objects and a numeric cart_value.

Viewing 7681 - 7690 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 8,494 interview questions and reports from Manager engineering interviews. Prepare for your interview. Get hired. Love your job.