Rubrik·Software Engineer·Technical Phone Screen
Jun 2026
Rubrik SWE interview with a camera-on coding round. One problem, pretty involved, and I'm still not 100% sure I nailed the edge cases. The constraint about every suffix having balanced character frequencies is the kind of thing that sounds manageable until you actually try to build a valid arrangement.
- Given a string S and an integer K, determine whether you can rearrange the characters of S such that for every suffix of the rearranged string, the frequency difference between any two distinct characters in S is at most K. If a valid rearrangement exists, return the lexicographically smallest one; otherwise return -1.
“The suffix constraint is what makes this nasty.” The rest of the author's notes on Software Engineer interview at Rubrik, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post