# BST Successor Search

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/3053/bst-successor-search
Source observed: 2026-11-05T00:11:34.601Z
Last checked: 2026-11-05T00:11:34.601+00:00
Indexed: 2026-11-06T20:26:20.574+00:00

---

# BST Successor Search

**Difficulty:** Hard  
**Category:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms) · [Coding](https://www.aced.io/questions?type=coding)  
**Roles:** [Software Engineer](https://www.aced.io/questions?role=swe)  
**Companies associated with interview reports:** [Stripe](https://www.aced.io/questions?company=stripe), [Expedia](https://www.aced.io/questions?company=expedia)

## Problem

In a Binary Search Tree (BST), an **inorder successor** of a node is the node with the smallest key greater than the input node's key.

Given a node `inputNode` in a BST, write `findInOrderSuccessor` to return its inorder successor. If `inputNode` has no inorder successor, return `null`. Explain the solution and analyze its time and space complexities.

![BST diagram illustrating inorder successors](https://exponent-content.s3.amazonaws.com/img_02_d3b6bf500a.png)

In the diagram, the inorder successor of **9** is **11**, and the inorder successor of **14** is **20**.

### Example

For an `inputNode` whose `key = 11`, return the inorder successor node whose `key = 12`.

## Practice interface

We provide **Question**, **Solution**, and **Community** tabs, along with expandable **Hint 1**, **Hint 2**, and **Challenge 1** sections. The coding workspace includes an editor, output and test-results tabs, and a console. [Sign up to run code](https://www.aced.io/signup?src=lesson).

Detailed company statistics and the solution are available through [Upgrade](https://www.aced.io/upgrade?src=questions). No community answers had been contributed in the supplied content.

## Interview experiences

Two shared experiences accompany this question:

- **[Stripe · 6 months ago](https://www.aced.io/experiences/stripe-senior-software-engineer-interview-af32ea)** — Software Engineer, Senior / L5. The contributor described a structured process with practical technical discussions, opportunities to explain thought processes, and interaction with people from different parts of the team. They valued the technical depth and broader problem-solving coverage; scheduling and communication about stages, timelines, and next steps could have been clearer.
- **[Expedia · 2 years ago](https://www.aced.io/experiences/expedia-senior-software-engineer-interview-111992)** — Software Engineer, Senior / L5. The contributor described a basic recruiter screen focused on experience and expectations, two coding problems—one LeetCode easy and one easier LeetCode medium—and a system-design discussion similar to early problems in YouTube preparation videos.

## Related courses

### [Software Engineering Interview Prep](https://www.aced.io/courses/software-engineering)

![Software Engineering Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/4VkuYewBHUFIVUS5oJDW5h/02e833439b1289f25f38f13f81cbdca3/adobe_stock_optimized.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for software engineering roles at Google, Amazon, Microsoft, Meta, Apple, and other companies through mock interviews, frameworks, advice from senior candidates, and practice in data structures, algorithms, system design, people management, behavioral interviews, and more.

### [System Design Interviews](https://www.aced.io/courses/system-design-interviews)

![System Design Interviews](https://images.ctfassets.net/x78yjrjc11pq/78x7miFZFjBCrM5GqftrMJ/2f6d26e632c4e7265c49f6a180227edb/system_design_track_compressed_26ac98a46e__281_29_5be2280f31.jpeg?w=800&h=800&fm=webp&q=75)

We teach approaches to current system-design questions across product, infrastructure, and AI domains with in-depth video examples, written breakdowns, reference patterns, and mock-interview videos featuring senior engineers and managers.

## About Aced

We are **Aced (formerly Exponent)**, an interview-preparation platform offering courses, practice questions, interview experiences, coaching, and related career resources.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3053%2Fbst-successor-search&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%2F3053%2Fbst-successor-search). Opening a form does not execute a tool.