Amazon, Recent Online Assessment(OA) Questions | Max Stock Increase & Median Subsequences | 28th Feb 2026 | Hackerrank

Amazon · Question · Posted Mar 2026

Question 1: Max and Min Median of Subsequences Problem Statement: Given an array values of size n and an integer k, find the maximum and minimum possible medians among all possible subsequences of length k. Return an array of two integers containing the maximum median followed by the minimum median. (Note: Since we are evaluating subsequences, the order of elements picked from the original array does not matter, which means we can optimize our selection by sorting the array first.) ...

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

Log in Create a free account