US | OA | MS+ SWE

US Masters SWE Role
You may see this as "Staff Software Engineer", but in levels.fyi, this corresponds to a midlevel SWE role at other tech companies. Don't get your hopes up because the title is almost misleading

OA
OA was 3 questions, you get 75 minutes. Split into two sections:

  • Section 1: Basic problem solving (15 minutes one problem)
  • Section 2: Intermediate problem solving (60 minutes one problem)

Basic Problem Solving

  • Given watch history (video title, categories, relevance) and a catalog (category and video title), curate a recommendation using this ordering
  1. Videos are grouped by category

  2. Categories the user has watched appear first, sorted by decreasing relevance

  3. Categories the user has not watched appear after, sorted alphabetically by category name

  4. Within each category, videos are sorted alphabetically by title

Not too bad, just follow directions and you'll pass the test cases easily

Intermediate Problem Solving #1
There are n servers in the network arranged in ascending order of their capacity. In the array capacity, the capacity of the ith server is capacity[i], where 0 < i < n.The distance between two servers, i and j, is defined as the absolute difference in their capacities: |capacity[i]| - |capacity[j]|. For each server i, the closest server j is the one with the smallest distance to i, and this closest server is unique. To manage the network, the following operations can be done to server:

  1. Connect to any server y at a cost of |capacity[x]| - |capacity[y]| units.
  2. Connect to the closest server of x for a fixed cost of one unit.

Given m queries, each defined by two integers fromServer[i] and toServer[i], find the minimum cost required to connect from fromServer[i] to toServer[i] for each query. The connection can be either direct or routed through a server z. Note:The values in the capacity array are distinct.

This one is a bit tricky, but the problem has a neat framing that you can use to your advantage

Intermediate Problem Solving #2
You have an array of n binary signals, where each signal initially has a value of 0. There are
n
different pings made to these signals, changing their value from 0 to 1. The ith ping affects the signal at index ping[i].

After each ping, the processor sorts the array by performing sweeps from left to right, swapping adjacent elements where signal[i] = 1 and signal[i+1] = 0. The processor stops when no swaps are made in a sweep.

Determine the number of sweeps required after each ping to sort the array.

This one is not too bad. You should be able to recognize the algorithm quickly and use basic math for this one. No fancy knowledge required

Comments (0)