Uber Interview Experience Round 1 – Coding

uber logo
uber
· SDE 2· India· 4y exp· Ongoing
March 29, 2026 · 6 reads

Summary

I had a coding round interview at Uber where I successfully solved a problem involving reordering elements based on their squares and its follow-up to find the k-th element, demonstrating a two-pointer approach and optimization ideas.

Full Experience

I recently had my first coding round interview at Uber. The interviewer was a Senior SDE. We started with a brief 5-minute introduction.For the main problem, I was asked to reorder elements of a given sorted array based on the sorted order of their squares. I first discussed a brute force approach (square all elements then sort) but didn't code it. Instead, I proposed and successfully implemented a two-pointer / merge-style approach, leveraging the fact that the input array was already sorted.The interviewer then presented a follow-up question: return the k-th element from the square-sorted order obtained from the previous problem. I extended my earlier logic to find the k-th element. Further optimization was requested, for which I proposed a binary search-based idea. Overall, I felt good about my performance in this round.

Interview Questions (2)

1.

Reorder Sorted Array by Sorted Squares

Data Structures & Algorithms·Medium

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.

Find K-th Element in Square-Sorted Order

Data Structures & Algorithms·Medium

Given a sorted array and an integer 'k', return the k-th element from the array reordered based on the sorted order of their squares. 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!