# Sales Path

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3051/sales-path
Source observed: 2026-11-05T00:28:08.257Z
Last checked: 2026-11-05T00:28:08.257+00:00
Indexed: 2026-11-06T04:55:43.529+00:00

---

# Sales Path

We are Aced, formerly Exponent. This medium-difficulty **Data Structures & Algorithms** coding question asks you to find the cheapest root-to-leaf route in a distribution tree. It is marked as a coding question and as having been last asked in an interview 3 years ago.

## Problem

Honda’s distribution system is represented by a tree that is not necessarily binary:

- The root is Honda itself.
- Each node represents a car distributor that receives cars from its parent and ships them to its children.
- Leaf nodes are car dealerships that sell cars directly to consumers.
- Every node contains an integer representing the cost of shipping a car to that node.

![Sales path example tree](https://exponent-content.s3.amazonaws.com/sales_path.png_85acc36d8b.png)

A **Sales Path** is a path from Honda’s factory—the root—to a dealership—the leaf. Its cost is the sum of the costs of every node on that path. For example, the path `0→3→0→10` costs `13` (`0+3+0+10`).

Given a node `rootNode`, implement `getCheapestCost` to return the minimum Sales Path cost in the tree. Use the most efficient approach and analyze its time and space complexity.

## Example

For the root node in the diagram, the function returns `7`. Two Sales Paths have that minimum cost:

- `0→6→1`
- `0→3→2→1→1`

The page includes an editor for trying the solution. Running code requires signing up: [Sign up to run code](https://www.aced.io/signup?src=lesson).

## Access and related questions

Detailed company statistics are available through [Upgrade](https://www.aced.io/upgrade?src=questions). The page has no community-contributed answers.

Related questions:

- [Sales Report](https://www.aced.io/questions/3971/sales-report)
- [Simplify Path](https://www.aced.io/questions/6557/simplify-unix-file-path)

## Aced interview preparation

We provide interview courses and practice across product management, software engineering, system design, data science, machine learning, data engineering, and other interview disciplines. This question is part of our coding-question library.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3051%2Fsales-path&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3051%2Fsales-path). Opening a form does not execute a tool.