How to Solve a JS Binary Search Tree Problem

When you have no idea what Binary Search Trees are

Rachel Lum
The Startup

--

Binary Search Tree Example

This week I tried out Pramp to practice technical coding interviews with other software engineering interviewees. If you are not familiar with Pramp, you are matched up with someone and each take turns being interviewer and interviewee. I was paired up with a kind fellow who prompted me with the Binary Search Tree (BST) Inorder Successor problem.

I had seen BST problems once or twice before on Leetcode.com, but I never attempted them because I had not any experience with binary search trees in JavaScript. In fact, I had the vaguest understanding of what they were.

My interviewer offered to switch to a different problem, but I decided against it. In a real technical interview, it is very possible that I would have to attempt something with which I was not yet familiar. The best way to learn something is to dive right in, so this was my cannonball.

I asked a lot of questions and mayb — definitely tested my interviewer’s patience. But, with his generous support, I eventually I was able to somewhat understand binary search trees and come to a solution! In this blog post, I want to share with you my approach as well as some tips for approaching problems that you have not tried before.

--

--

Rachel Lum
The Startup

Full stack web developer with passions for dance, fitness, health, math, communication, and technology.