Uber | SDE-2 | Reject

2190
Aug 01, 2025
Aug 20, 2025

Hi Folks,

YOE: 6
Currently SSE @ Walmart

OA:
Here are the questions:

#1: Odd Zero Counter
Given an array of integers, count how many elements in an array have an odd number of occurrences of the digit 0.
Input: [20, 11, 10, 10070, 7]
Output: 3

#2: Sensor Digit Frequency
You are given an array of integers representing sensor readings. Each reading is a non-negative integer. Your task is to determine which digit (from 0 to 9) appears most frequently across all the readings when they are written in decimal form.

If multiple digits have the same highest frequency, return the smallest digit among them.
Input: [123, 456, 789, 101]
Output: 1
Explanation:

Digits across all numbers: 123 → 1, 2, 3; 456 → 4, 5, 6; 789 → 7, 8, 9; 101 → 1, 0, 1

Frequency: 0 → 1 time 1 → 3 times ✅ 2 → 1 time 3 → 1 time 4 → 1 time 5 → 1 time 6 → 1 time 7 → 1 time 8 → 1 time 9 → 1 time → Digit 1 appears most frequently.

#3: Stepwise Structures

You are given an array of integers, where each integer represents the height of a structure. You are allowed to only increase the height of the structures (no decreases), and your goal is to transform the array so that the heights form either:

a strictly ascending "stepwise" sequence (each subsequent height is exactly 1 greater than the previous), or

a strictly descending "stepwise" sequence (each subsequent height is exactly 1 less than the previous)

More precisely:

For ascending: the final array should be of the form [x, x+1, x+2, ..., x+n-1] for some integer x.

For descending: the final array should be of the form [y, y-1, y-2, ..., y-n+1] for some integer y.

You may pick either ascending or descending, and you must choose the one requiring the minimal total height increase across all structures.

Task:
Calculate the minimal total sum of increments required to achieve either an ascending or descending stepwise array as described, using only increases to structure heights.

Input:
An array of integers structures of length n (n ≥ 1), representing the initial heights.

Output:
A single integer: the minimum total amount by which the structure heights must be increased to achieve a valid stepwise configuration (either ascending or descending).

Constraints:
Only increases to heights are allowed.
All numbers in the result must be at least as large as their original value.

Example 1:
Input: [4,4,3,2]
Output: 4

Example 2:
Input: [7,7,9,4,11]
Output: 9

Your task is to determine this minimal increment efficiently for any valid input array.

#4: Bubble Explosion Simulation
You're given a 2D grid representing bubbles of different colors. Each cell contains an integer representing the bubble's color, or 0 if it's empty.

Rules:

A bubble explodes if it has at least two adjacent bubbles (up, down, left, right) of the same color.

When a bubble explodes, it also causes its adjacent same-colored bubbles to explode.

After all explosions, bubbles fall down to fill empty spaces below them (gravity effect).

The process happens once in the current solution.

Goal: Simulate one round of explosions and gravity, and return the resulting grid.
Input:
[3, 1, 2, 4]
[1, 1, 1, 4]
[3, 1, 2, 2]
[3, 3, 3, 4]

Output:
[0, 0, 0, 4]
[0, 0, 0, 4]
[0, 0, 2, 2]
[3, 1, 2, 4]

Was reached out by the recruiter after 2 weeks.

Technical Phone Screen Round (Virtual):
First 15 min brief discussion on past projects.
Rest 30 min ->

  1. https://leetcode.com/problems/2-keys-keyboard/description/

#uber #oa #tps #sde2

Comments (3)