Menu Trees: Find, Price & Parse
- Price a menu tree where an unpriced node sums its children
- Find an item in nested groups with BFS and return its path
- Inherit a missing price from the nearest priced group or menu
- Parse an indented text menu into a tree with a stack
- Weight item prices by depth, then flip the weights
Toast builds software for restaurants, and its coding rounds borrow the domain. Toast's own technical interview page says you'll work through "a series of technical exercises with different Toasters based on problems in our restaurant domain", and graph traversal sits first on its list of topics to brush up. A menu is the most natural tree in a restaurant. A lunch menu holds groups, groups hold more groups, and somewhere at the bottom sit the items people order.
That tree has come up in more Toast reports than any other coding problem, from a December 2022 Android loop to a November 2026 question-bank entry. This lesson works five versions of it, current ones first. You'll price a menu where unpriced groups add up their children, then find an item hiding several groups deep. The older section covers a price inherited from above, a menu parser and a depth-weighted sum.
How Toast asks menu tree questions
The rounds tend to hand you classes that already exist. A Principal candidate in July 2025 posted the Java starter from their getPrice round, and it's a good picture of what you walk into. There are three node types, every price is a nullable Double, and a static block builds a Lunch menu and a Drinks menu for you to test against. Stripped down, it looks something like this:
static class Menu { String name; List<MenuGroup> groups; Double price; // nullable}static class MenuGroup { String name; List<MenuGroup> groups; List<MenuItem> items; Double price; // nullable}static class MenuItem { String name; Double price; // nullable}static Double getPrice(Collection<Menu> menus, MenuItem item) { ... }So the round is half reading. A September 2024 phone-screen candidate found the problem itself easy and the classes hard, with a hierarchy that went too deep. They made a few edge-case slips and didn't move forward. Spend the first minutes on the classes. Ask which fields can be null, whether names repeat, and whether a menu can hold items directly.
All five are one walk over the same tree, and they differ in which way the information moves. A price that sums its children travels up from the leaves. An inherited price travels down from the menu. A search carries the path down and stops at the first match, and a depth weight is a counter that each child gets one higher than its parent.
Current problems (2026)
Two menu problems have 2026 dates. The pricing problem is the newest, though it comes from a question bank and not from a candidate's own account, so it's secondhand. The search problem has the most reports behind it: an April 2026 Senior loop, an early 2025 technical interview and a 2022 Android round.
Price a menu where unpriced nodes sum their children (November 2026). A question bank's Toast list added something like this in November 2026, marked easy and tagged software engineer. Menus, groups and items are nodes, and a node without its own price is worth the sum of its children. The entry builds the tree through a handful of add methods, the shape below.
Find an item in a nested menu (April 2026). A Senior candidate in Bengaluru listed "Menu traversal (DFS)" among their April 2026 questions, next to a restaurant system design and a code review. An early 2025 technical interview gave a menu with groups inside groups, something like Salads holding Vegetarian Salads holding Vegan Salads, and asked for the logic to fetch a requested item. A December 2022 Senior Android candidate was told the topic ahead of time and got a breadth-first search over a restaurant menu.
None of the three reports says what comes back or what happens when two items share a name. The version below returns the path to the item and, on a tie, the copy nearest the top. That tie is the one place where BFS and DFS give different answers.
Older problems (2024-2025)
Three more versions come from 2024 and 2025, and each rests on a single report. They're worth the time because they reuse the same tree with a different twist. One price flows down instead of up, the parser has to build the tree from text, and the depth sum counts levels on the way down.
Inherit a missing price from the nearest group (July 2025). The third round of a Principal loop was to write getPrice on the classes shown earlier. An item with a null price takes the price of the closest enclosing group that has one, and failing that, the menu's. The posted Lunch and Drinks menus are the data below, converted to cents, with one item name shortened.
Lunch 1150├── Appetizers 500 Wings (null), Fries 350└── Entrees (null) Burger (null) ├── Salads 750 Garden Salad (null), Cobb Salad 900 └── Toast 650 Avocado (null), PB&J (null) Drinks 500├── Coffees (null)│ ├── Iced 500 Iced Latte 650, Decaf Iced Coffee (null)│ └── Hot 300 Americano (null), Cup of Joe (null)└── Sodas 250 Coke, Sprite, Ginger Ale (all null)Parse and store a restaurant menu (November 2025). A Senior candidate in Bengaluru, who got an offer, described a "design round" where they had to write code that parses and stores restaurant menus. They rated it medium, and a high-level design round on their own past projects came after it. The report gives no input format, so the indented text below is one plausible shape. Ask what format you'll get before you write a parser.
Depth-weighted menu sum (September 2024). A phone screen asked a variation of LeetCode's nested list weight sum, set in a restaurant menu. The candidate shared little beyond that, apart from the deep class hierarchy and a few missed edge cases. The menu framing below is one reading of it, where each item's price is weighted by how deep it sits.
What gets you through the round
The five problems share one tree, and the reports that went badly share a cause. In the 2024 phone screen, a working idea slipped on edge cases in a deep hierarchy. At the September 2026 final round, running tests was the minimum, and the candidate's code couldn't run any. Neither failure came from the algorithm.
Common questions
What coding questions does Toast ask?
Mostly practical problems set in a restaurant. The menu tree on this page is the most repeated, as pricing, search, inherited prices, parsing and a depth sum. Other rounds have asked for labor clock-in endpoints, top restaurants by order value in a partly built system, and a code review of an existing API. What Toast Tests in Coding maps the rounds.
Does Toast ask LeetCode questions?
Sometimes, though most problems carry restaurant dressing. The 2024 phone screen here was a menu version of nested list weight sum, and a stock-profit variant came up in two 2025 coding rounds. Expect a LeetCode shape under restaurant names more often than a problem copied straight from the site.
Which language should I use in a Toast coding interview?
Toast's technical interview page lists JavaScript, Java, Python and Kotlin, and says to ask ahead of time for anything else. The posted menu starter was Java, so if you pick Python, be ready to read Java classes and mirror them. Toast also asks you not to use real-time AI tools during interviews unless told otherwise.
How should I practice these menu problems?
Write each one from a blank file with your own test menu, and time it at about 30 minutes. Then do the follow-ups out loud: a cache with setPrice, every match instead of the first, one pass that prices every item. If you're told the topic ahead of time, as a 2022 Android candidate was, drill that walk twice.
Key Takeaways
- ✓Toast's most repeated coding problem is a restaurant menu tree, asked as pricing, search, inherited prices or parsing.
- ✓Summed prices flow up from the leaves and inherited prices flow down, so pick the walk direction first.
- ✓Keep money in integer cents and test for null explicitly, because a price of 0 is real.
- ✓Read the given classes, ask about nulls and repeated names, and leave code with tests that run.
Toast interview guideKnow what Toast asks before you walk in.
24 coding · 3 system design · 17 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.