Two Sum with Smallest-Indices Tiebreak
Asked at Walmart Labs · Coding Questions · Difficulty: Medium · Last asked Mar 3, 2026
Given an unsorted array and a target sum, return the indices `(i, j)` of any two elements summing to the target. If multiple pairs exist, return the one with the smallest `i`; on ties, the smallest `j`. A verbal follow-up extends the problem to 3-sum with duplicate removal.
Loading the problem…
More Walmart Labs interview questions
- Design State-Wide Temperature Sensor Ingestion
- Design Walmart Plus Membership System
- Design Multi-Carrier Package Delivery Routing System
- Refactor a Scheduling Function into a Production REST Service
- Design Ticketmaster - Event Booking and Seat Reservation
- ML System Design - Predict Item Category