New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Tesla
Coding Question
AI Insights
Quick Summary
Identify all pairs in an integer array that share the smallest absolute difference.
Each pair must be formatted as [smaller, larger] and the final result sorted by the first element.
The algorithm must handle arrays up to 10^5 efficiently without using a brute-force O(N^2) approach.
What This Tests
Array sorting and ordering properties
Time complexity optimization over naive pairwise checks
Adjacent element traversal and comparison
Output formatting and constraint handling
Common Patterns
Sorting
Collapse
Hint
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected