← Microsoft questions
CodingMediumReported in a candidate post, Jul 2025

Find two incorrectly placed nodes in a BST

Filed under Microsoft

Two nodes of a binary search tree (BST) have been swapped by mistake, so the tree no longer satisfies the BST property. Given the root of the tree, find the two incorrectly placed nodes (return their…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.