Uber | SDE2

uber logo
uber
· SDE II
March 2, 2026 · 3 reads

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.

Full Experience

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

Interview Questions (2)

1.

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]
2.

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

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!