Find Pairs with the Smallest Difference
Given an array of integers, find and print all pairs of numbers that have the smallest difference between them, returning the results in increasing order of their values.
Asked at:
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late May, 2026
Microsoft
Mid-level
Given an array of integers, print the pairs of numbers that have the smallest difference between them in increasing order of their values.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.