PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Apple

Find k Smallest Pair Sums

Last updated: Apr 22, 2026

Quick Overview

This question evaluates skills in algorithm design, working with sorted arrays, pairing and ordering elements, and analyzing time and space complexity within the Coding & Algorithms domain.

  • medium
  • Apple
  • Coding & Algorithms
  • Software Engineer

Find k Smallest Pair Sums

Company: Apple

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given two integer arrays `nums1` and `nums2`, both sorted in non-decreasing order, and an integer `k`, return the `k` pairs with the smallest sums, where each pair contains one element from `nums1` and one element from `nums2`. If there are fewer than `k` possible pairs, return all of them. The output should be ordered by increasing pair sum; if multiple pairs have the same sum, any order among those ties is acceptable. You should implement a solution more efficient than generating every possible pair. In the interview, you are also expected to write a few tests and run the code. Example: - `nums1 = [1, 7, 11]` - `nums2 = [2, 4, 6]` - `k = 3` - Output: `[[1, 2], [1, 4], [1, 6]]`

Quick Answer: This question evaluates skills in algorithm design, working with sorted arrays, pairing and ordering elements, and analyzing time and space complexity within the Coding & Algorithms domain.

Related Interview Questions

  • Minimum Cells to Bridge a Magic Grid - Apple (hard)
  • Find Common Prefix Across Strings - Apple (easy)
  • Find Minimum Processing Rate - Apple
  • Compute Earliest Bus Arrival - Apple (medium)
  • Find the Extra Edge - Apple (hard)
Apple logo
Apple
Dec 22, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
7
0
Loading...

Given two integer arrays nums1 and nums2, both sorted in non-decreasing order, and an integer k, return the k pairs with the smallest sums, where each pair contains one element from nums1 and one element from nums2.

If there are fewer than k possible pairs, return all of them. The output should be ordered by increasing pair sum; if multiple pairs have the same sum, any order among those ties is acceptable.

You should implement a solution more efficient than generating every possible pair. In the interview, you are also expected to write a few tests and run the code.

Example:

  • nums1 = [1, 7, 11]
  • nums2 = [2, 4, 6]
  • k = 3
  • Output: [[1, 2], [1, 4], [1, 6]]

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Apple•More Software Engineer•Apple Software Engineer•Apple Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.