JPMorgan Chase SWE OA (2023) | Binary Search Partitioning and Optimized Array Processing

Question · Posted Jun 2026

Q1. Median of Two Sorted Arrays Problem Statement Given two sorted arrays: nums1 nums2 of sizes m and n respectively, return the median of the two sorted arrays. The overall runtime complexity must be: O(log(m + n)) Example 1 Input nums1 = [1,3] nums2 = [2] Output 2.0 Explanation Merged array: [1,2,3] Median: 2 Example 2 Input nums1 = [1,2] nums2 = [3,4] Output 2.5 Explanation Merged array: [1,2,3,4] Median: (2 + 3) / 2 = 2.5 Constraints 0 <= ...

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

Log in Create a free account