Software Engineer • Staff-Level
Software Engineer • Staff-Level
High QualityInterview Summary
The Faire onsite coding round focused on an e-commerce category hierarchy represented as a DAG rather than a strict tree. Because a category may have multiple parents, a product can inherit discounts through several different ancestor paths.
The first part asked for the maximum applicable discount for each product. The second part extended the problem into an audit use case where the system needed to expose which discount-bearing ancestor categories contributed to each leaf category.
Interview Details
Part 1 — Find the Maximum Inherited Discount
An e-commerce platform organizes product categories hierarchically. The hierarchy is a directed acyclic graph, so one category can belong to multiple parent categories.
For example C3_Shirts could belong to both C2_Mens and C2_Womens. A product inherits discounts from:
- Its own category
- Every ancestor category reachable from its category
The final discount applied to the product is the largest discount value among all of those categories. Implement a function conceptually like find_discount_sources(category_edges, products, discounts) -> Dict[str, int] where:
category_edgesdescribes parent-to-child category
Unlock Full Details
Create a free account to unlock this interview experience report.