Rubrik OA Guide 2026 | SDE Intern Online Assessment

1,401 Views
No Comment

I recently made a set Rubrik SDE Intern Online Assessment. The overall style is more engineering logic. It is not a particularly brain-burning algorithm question, but it requires high clarity of thinking and implementation details. Let’s organize the two questions in paragraph form.

Rubrik OA

Question 1: Capable Models

The question gives you n machine learning models. Each model has a cost[i] and a binary string featureAvailability[i] of length 2 and it is used to indicate which features this model supports.

If the string is "00", it means that neither A nor B is supported;
“01” means only feature A is supported;
“10” means only feature B is supported;
"11" means both A and B are supported.

The question defines a set as k-capable if and only if at least k models in the set support feature A, and at least k models support feature B.

It is required that for each k (from 1 to n), a set that meets the conditions is calculated to minimize the total cost. If a certain k fails to satisfy the condition, -1 is returned.

The key to this question is to understand that models such as "11" can contribute both A and B, so they have dual value when selecting. The core approach is to divide the models into three categories: onlyA, onlyB and both, sorted by cost in ascending order. For a fixed k, you can enumerate and select as many both as you need, and then fill in the remaining required onlyA and onlyB numbers. Use the prefix sum to quickly calculate the cost and take the minimum value.

Question 2: String Subsequences

This question is given two strings s1 and s2, where the length of s1 is fixed to 3 and the length of s2 is variable.

It is required to count how many times s1 appears in s2 as a subsequence. The subsequence here requires the characters to be in the same order, but may not be consecutive.

For example:

S1 = "ABC"
S2 = "ABCBABC"

The output is 5.

That is, there are 5 different ways to select A, B, and C in order in s2.

This question is essentially a subsequence counting problem. Because the length of s1 is fixed at 3, rolling statistics can be calculated using three variables: the number of matches for the first character, the number of matches for the first two characters, and the number of matches for the complete three characters. When traversing s2, just update the corresponding count according to the current character. The time complexity is O(n) and the space is O(1).

References

ProgramHelp focuses on providing full-process job search assistance support, including OA online assistance , technical/VO real-time assists, and special simulation training for high-intensity positions to help you stabilize your rhythm in key links and improve your pass rate.

Whether it is online written tests such as HackerRank and CodeSignal, or subsequent preparations for technical aspects, system design, and behavioral aspects, we can customize training programs according to the target company and conduct intensive dismantling of high-frequency question types to help you explain your ideas clearly, write code stably, and display your true skills in interviews.

author avatar
Alex Ma Staff Software Engineer
Currently working at Google, with more than 10 years of development experience, currently serving as Senior Solution Architect. He has a bachelor's degree in computer science from Peking University and is good at various algorithms, Java, C++ and other programming languages. While in school, he participated in many competitions such as ACM and Tianchi Big Data, and owned a number of top papers and patents.
END
 0
Comment(No Comment)