InterviewLegend

Locks & Thread-Safe Structures

Alex Chen60 min readUpdated 202 real interview reports

These Rubrik concurrency prompts all start from one shared structure. Several threads read and change it at once, and you decide what needs a lock. Sometimes the interviewer then asks you to do it with no lock at all.

The most common one splits its callers into groups with different rules about who can run together. Others ask for a structure with no lock at all, or one lock over two structures that change together, and two smaller builds round it out.

The approach is the same each time. Build the plain version first and make it pass. Then name the state that changes together, like two structures that point into each other. One lock over that state is a fine first answer. Explain why before you split it into finer locks or swap it for a compare-and-swap loop, because interviewers want to hear the reason for each step.

RubrikPremium lesson · Coding round

The 5 Rubrik problems are below.

  1. A Premium questionCoding · Medium · Frequently asked
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

+ 2 more in this lesson

Each with hints, the follow-up and a tested solution.

Get the Rubrik questions

$49 a year · all 100 companies · cancel anytime

From 202 Rubrik reports, forum threads behind logins and write-ups in Chinese.

Had your Rubrik interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Rubrik interview guide

Know what Rubrik asks before you walk in.

32 coding · 3 system design · 15 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.