Engineering Manager Interview Questions

8,496 engineering manager 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 7691 - 7700 interview questions

Glassdoor has 8,496 interview questions and reports from Engineering manager interviews. Prepare for your interview. Get hired. Love your job.