Amazon | OA | January 2026 HackerRank Off-Campus

Amazon · Question · Posted Jun 2026

Problem 1 - Subsequence Medians Problem Statement You are given an array values of size n and an integer k. Find the maximum median and the minimum median across all subsequences of length k. Return both values as an array: [max_median, min_median] The median of a subsequence of length k is the element at index floor((k - 1) / 2) after sorting the subsequence (0-indexed). This is the lower median convention. Constraints Constraint Value Array Size 1 <= n <= ...

The full answer & interview discussion are available to premium members.

Log in Create a free account