uber logo
Uber· Software Development Engineer 2 (Frontend)

UBER Interview Experience (SDE 2 FE) L4 #uber #interview

Posted
10 Apr 2026
333 reads

Summary

I interviewed for a Software Development Engineer 2 (Frontend) position at Uber. The first round consisted of a medium‑level DSA problem about counting distinct infection sequences.

How it went

Round 1

The first round involved a medium-level DSA problem. The interviewer was friendly and made the discussion comfortable.

Problem Statement:

You are given an integer n representing the number of houses in a line, and an array initial_infected indicating the houses infected on day 0.

Each day, an infected house spreads the infection to its immediate neighbors (i-1 and i+1, if valid).

Return the number of distinct sequences in which all houses become infected.

Example

n = 8
initial_infected = [2, 7]

Output: 48

Explanation: Infection spreads outward from initially infected houses, forming segments of uninfected houses. Each segment can be infected in different valid orders. Edge segments (like [1] and [8]) have only one way. The middle segment [3,4,5,6] can be infected from both sides (2 and 7), so the infection order can interleave in multiple ways. Counting all valid interleavings gives the total number of sequences = 48.

Questions asked (1)

  1. 01

    Count Distinct Infection Sequences

    Data Structures & Algorithms · Medium

    You are given an integer n representing the number of houses in a line, and an array initial_infected indicating the houses infected on day 0.

    Each day, an infected house spreads the infection to its immediate neighbors (i-1 and i+1, if valid).

    Return the number of distinct sequences in which all houses become infected.

    Example

    n = 8
    initial_infected = [2, 7]

    Output: 48

    Explanation: Infection spreads outward from initially infected houses, forming segments of uninfected houses. Edge segments have only one possible infection order, while middle segments can be infected from both sides, leading to multiple interleavings. The total number of valid interleavings is 48.

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!