Problem database last updated: June 20, 2025

RRubrik logo

Rubrik Coding Interview Questions

31 problems · 2 Easy, 17 Medium, 12 Hard · Ranked #64 of 458

Difficulty breakdown

2 Easy

6% · avg 23%

17 Medium

55% · avg 59%

12 Hard

39% · avg 18%

Top topics

array
58.1%
math
29%2.3x
hash-table
29%
string
25.8%
design
22.6%3.9x
dynamic-programming
22.6%

Interview profile

Based on 31 reported problems, Rubrik interviews are significantly harder than average - 39% Hard vs 18% across all companies. The majority (55%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Rubrik puts unusual emphasis on combinatorics (9.7% of problems, 17x the industry average), enumeration (9.7% of problems, 11.8x the industry average), segment-tree (6.5% of problems, 10.6x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (58.1%), math (29%), hash-table (29%), string (25.8%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 31 problems

Maximum Points After Enemy Battles

Solve

You are given an integer array enemyEnergies denoting the energy values of various enemies.

MediumVery Likely
arraygreedy

Stamping the Grid

Solve

You are given an m x n binary matrix grid where each cell is either 0 (empty) or 1 (occupied).

HardLikely
arraygreedymatrix

Alice and Bob Playing Flower Game

Solve

Alice and Bob are playing a turn-based game on a field, with two lanes of flowers between them. There are x flowers in the first lane between Alice and Bob, and...

MediumLikely
math

LRU Cache

Solve

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

MediumLikely
hash-tablelinked-listdesign

Random Pick with Weight

Solve

You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.

MediumLikely
arraymathbinary-search

Count Lattice Points Inside a Circle

Solve

Given a 2D integer array circles where circles[i] = [xi, yi, ri] represents the center (xi, yi) and radius ri of the ith circle drawn on a grid, return the numb...

MediumLikely
arrayhash-tablemath

Find the Sum of Subsequence Powers

Solve

You are given an integer array nums of length n, and a positive integer k.

HardLikely
arraydynamic-programmingsorting

Existence of a Substring in a String and Its Reverse

Solve

Given a string s, find any substring of length 2 which is also present in the reverse of s.

EasyLikely
hash-tablestring

Maximize Subarray Sum After Removing All Occurrences Of One Element

Solve

You are given an integer array nums. You can perform at most one operation: choose any integer x such that nums remains non-empty after removing all occurrences...

HardLikely
segment-treearraydynamic-programming

Find X Value of Array II

Solve

You are given an array of positive integers nums and a positive integer k. You are also given a 2D array queries, where queries[i] = [indexi, valuei, starti, xi...

HardLikely
arraymathsegment-tree

Manhattan Distances Of All Arrangements Of Pieces

Solve

You are given three integers m, n, and k. There is a rectangular grid of size m × n containing k identical pieces. Return the sum of Manhattan distances between...

HardLikely
mathcombinatorics

Distribute Candies Among Children II

Solve

You are given two positive integers n and limit.

MediumLikely
mathcombinatoricsenumeration

Distribute Candies Among Children I

Solve

You are given two positive integers n and limit.

EasyLikely
mathcombinatoricsenumeration

Find X Value of Array I

Solve

You are given an array of positive integers nums, and a positive integer k.

MediumLikely
arraymathdynamic-programming

Find Longest Special Substring That Occurs Thrice II

Solve

You are given a string s that consists of lowercase English letters.

MediumLikely
hash-tablestringbinary-search

Insert Delete GetRandom O(1)

Solve

Implement the RandomizedSet class:

MediumLikely
arrayhash-tablemath

Next Permutation

Solve

A permutation of an array of integers is an arrangement of its members into a sequence or linear order.

MediumSometimes
arraytwo-pointers

Snapshot Array

Solve

Implement a SnapshotArray that supports the following interface:

MediumSometimes
arrayhash-tablebinary-search

Scramble String

Solve

We can scramble a string s to get a string t using the following algorithm:

HardSometimes
stringdynamic-programming

Design Add and Search Words Data Structure

Solve

Design a data structure that supports adding new words and finding if a string matches any previously added string.

MediumSometimes
stringdepth-first-searchdesign

Task Scheduler

Solve

You are given an array of CPU tasks, each labeled with a letter from A to Z, and a number n. Each CPU interval can be idle or allow the completion of one task....

MediumSometimes
arrayhash-tablegreedy

Sliding Window Maximum

Solve

You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see...

HardSometimes
arrayqueuesliding-window

Edit Distance

Solve

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

MediumSometimes
stringdynamic-programming

Design a Text Editor

Solve

Design a text editor with a cursor that can do the following:

HardSometimes
linked-liststringstack

Prefix and Suffix Search

Solve

Design a special dictionary that searches the words in it by a prefix and a suffix.

HardSometimes
arrayhash-tablestring

4Sum

Solve

Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:

MediumSometimes
arraytwo-pointerssorting

Design Memory Allocator

Solve

You are given an integer n representing the size of a 0-indexed memory array. All memory units are initially free.

MediumSometimes
arrayhash-tabledesign

Minimum Number of Refueling Stops

Solve

A car travels from a starting position to a destination which is target miles east of the starting position.

HardSometimes
arraydynamic-programminggreedy

Remove Invalid Parentheses

Solve

Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid.

HardSometimes
stringbacktrackingbreadth-first-search

Cherry Pickup II

Solve

You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the (i, j)...

HardSometimes
arraydynamic-programmingmatrix

Building H2O

Solve

There are two kinds of threads: oxygen and hydrogen. Your goal is to group these threads to form water molecules.

MediumSometimes
concurrency

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Rubrik interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Rubrik coding interview

Rubrik interviews focus heavily on array, math, hash-table problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Rubrik interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Rubrik ask in interviews?add

Rubrik has been reported to ask 31 distinct coding problems. The most common topics are array, math, hash-table. 2 are Easy difficulty, 17 are Medium, and 12 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Rubrik coding interviews?add

Based on 31 reported problems, Rubrik interviews are significantly harder than average - 39% Hard vs 18% across all companies. 55% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Rubrik coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, math, hash-table. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Rubrik interview?

Simulate a real Rubrik coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Rubrik interview with AIarrow_forward