Uber | SDE2
- Posted
- 2 Mar 2026
Summary
I applied via LinkedIn referral and had a coding round where I solved a problem to reorder elements based on the sorted order of their squares and partially solved a follow-up to find the k-th element.
How it went
Uber Interview Experience (Feb 2026)
Applied via LinkedIn referral. Recruiter reached out on 16th Feb and scheduled first round on 27th Feb.
Round 1 – Coding
The interviewer was Senior SDE.
5 minutes intro
Problem:
Given a sorted array, reorder the original elements based on the sorted order of their squares.
Input: [-3, -2, -1, 0, 1, 2, 3, 4]
Output: [0, -1, 1, -2, 2, -3, 3, 4]
Approach:
- Discussed brute force (square + sort) — didn’t code.
- Then used a two-pointer / merge-style approach leveraging sorted input.
- Implemented successfully.
Follow-up:
Return the k-th element from the above square-sorted order.
Input: [-3, -2, -1, 0, 1, 2, 3, 4], k = 3
Output: 1
- Extended earlier logic to return k-th element.
- Then asked to optimize further.
- Proposed a binary search-based idea.
- Implemented it, but it failed for some edge cases. Couldn't complete.
5 minute outro, que-answer
Questions asked (2)
- 01
Reorder Sorted Array by Squares
Data Structures & Algorithms
Given a sorted array, reorder the original elements based on the sorted order of their squares.
Input: [-3, -2, -1, 0, 1, 2, 3, 4] Output: [0, -1, 1, -2, 2, -3, 3, 4] - 02
K-th Element in Square-Sorted Array
Data Structures & Algorithms
Return the k-th element from the above square-sorted order.
Input: [-3, -2, -1, 0, 1, 2, 3, 4], k = 3 Output: 1