← Infosys questions
CodingReported in a candidate post, Apr 2022

Maximum element in sliding window and LCA in BST

Filed under Infosys

Given an array of integers and an integer k, find the maximum element in each sliding window of size k. Additionally, given a Binary Search Tree (BST) and two nodes, find their Lowest Common Ancestor…

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 Infosys questions

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