uber logo
Uber· SDE-2/SDE-3

Uber Online Assessment SDE2/SDE3

Posted
25 Mar 2026
289 reads

Summary

I completed Uber's Online Assessment for an SDE-2/SDE-3 role and was able to solve both problems.

How it went

Today, I completed the Uber Online Assessment for an SDE-2/SDE-3 role.

The assessment was conducted on HackerRank under strict proctoring (camera monitored) and consisted of 2 problems to be solved in 90 minutes.

Problem 1: Given a permutation of size n, we needed to construct a binary string of length n. For each k (1 ≤ k ≤ n), determine whether k is “balanced”.

A value k is considered balanced if there exists a subarray [l, r] such that the elements in that subarray form a permutation of numbers from 1 to k.

Constraints: 1 ≤ n ≤ 2 × 10^5

Examples: Input: [1, 3, 2, 4] Output: "1011"

Input: [3, 1, 2, 4] Output: "1111"


Problem 2: We are given n plates placed on a 2D plane with coordinates defined by arrays x and y.

Two plates can be collected together if:

  • They lie in the same row (same x) or same column (same y), and
  • Their distance is ≤ d

The goal is to determine the minimum time required to collect all plates, where collecting one plate allows collecting all plates connected to it under these rules.

Constraints: 1 ≤ n ≤ 10^5 0 ≤ d ≤ 10^9 0 ≤ x[i], y[i] ≤ 10^9

Example: n = 3, d = 1 x = [0, 2, 1] y = [0, 1, 2] Output: 3


Overall, the assessment focused heavily on efficient data structures and problem-solving under constraints (O(n log n) / O(n) solutions).

It was a great experience working through these problems.

I am able to solve both problems.

Questions asked (2)

  1. 01

    Balanced Subarray Permutation

    Data Structures & Algorithms

    Given a permutation of size n, construct a binary string of length n where for each k (1 ≤ k ≤ n) the k-th character is '1' if k is balanced and '0' otherwise.

    A value k is considered balanced if there exists a subarray [l, r] such that the elements in that subarray form a permutation of numbers from 1 to k.

    Constraints

    • 1 ≤ n ≤ 2 × 10^5

    Examples

    • Input: [1, 3, 2, 4] Output: "1011"
    • Input: [3, 1, 2, 4] Output: "1111"
  2. 02

    Collect Plates with Distance Constraint

    Data Structures & Algorithms

    You are given n plates placed on a 2D plane with coordinates given by arrays x and y.

    Two plates can be collected together if:

    • They lie in the same row (same x) or the same column (same y), and
    • Their Manhattan distance is ≤ d.

    Collecting one plate allows you to collect all plates that are connected to it through these rules. Determine the minimum time required to collect all plates.

    Constraints

    • 1 ≤ n ≤ 10^5
    • 0 ≤ d ≤ 10^9
    • 0 ≤ x[i], y[i] ≤ 10^9

    Example

    • n = 3, d = 1
    • x = [0, 2, 1]
    • y = [0, 1, 2]
    • Output: 3

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Uber recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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