The Palantir FDE internship OA consisted of three connected parts built around a grocery-store discount system. The problem started with straightforward percentage coupons, then added category-level discounts and multiplicative stacking, and finally turned the same system into an optimization problem with a limited discount-point budget.
Interview Details
Part 1 — Apply Item-Specific Discounts
You are given a shopping cart and a collection of discount coupons. Each item contains:
name
price in integer cents
Each coupon contains:
The item name it applies to
A percentage discount
At most one item-specific coupon exists for each item name. Coupons that do not match anything in the shopping cart should be ignored.
subtotal is the sum of original item prices, total_discount is the total savings, and final_total is the amount remaining after all applicable discounts.
The final discount for each individual item should be rounded to the nearest cent using round(). Intermediate values should not be rounded, and the returned totals should be integers.