DEV Community

Cover image for Snowflake OA Experience | Two Classic HackerRank Questions (2026)
interviewshow-cs
interviewshow-cs

Posted on

Snowflake OA Experience | Two Classic HackerRank Questions (2026)

If you're applying to Snowflake, don't skip this. Their OA is honestly one of the most recognizable among North American tech companies. There are only two coding questions, but neither feels like a standard LeetCode template. The good news? The question pool has an incredibly high repeat rate.

I got lucky and ended up with two problems that had already been discussed countless times on LeetCode forums, Reddit, and interview communities. It almost felt like typing from memory. Here's a quick breakdown while it's still fresh.

OA Format

  • Platform: HackerRank
  • Two coding questions
  • Difficulty: Medium to Hard

One thing to keep in mind: both problems use input sizes around 2 × 105. Any brute-force solution will immediately time out, so you need to identify the correct algorithm before writing code.

Question 1 — Minimum Height

You are given a rooted tree and can perform at most max_operations. Each operation allows you to cut a subtree and reconnect it directly to the root. The objective is to minimize the final height of the tree.

The key observation is that this is a classic "minimize the maximum" problem, which naturally suggests binary search on the answer.

For each candidate height H, run a greedy validation from the bottom of the tree upward. Whenever a subtree would exceed the allowed height, cut it and reconnect it to the root. Cutting deeper nodes is always the better choice.

Two common pitfalls:

  • The detached subtree must also satisfy the height constraint. Its own height cannot exceed H - 1.
  • With n = 2 × 105, recursive DFS in Python is likely to exceed the recursion limit. An iterative traversal is much safer.

The expected solution runs in O(n log n).

Question 2 — Pod Autoscaler

This problem wears a Kubernetes autoscaling theme, but underneath it's really an array optimization problem.

There are two types of operations:

  • Set a single service to value x.
  • Set the minimum value of every service to x.

After processing all operations, return the final value of every service.

A direct simulation takes O(n × m), which becomes completely infeasible for the given constraints.

The trick is realizing that the final value of each service depends on only two things:

  • The last individual assignment made to that service.
  • The maximum global minimum operation that occurred afterward.

The implementation is straightforward once you see the pattern:

  1. Record the last update time and value for every service.
  2. Build a suffix maximum array for all global update operations.
  3. For each service, compute the final answer using the maximum of those two values.

The entire solution runs in O(n + m). Once the idea clicks, the implementation is only a few lines long. Without that observation, it's easy to get stuck trying to optimize a brute-force simulation.

Final Thoughts

Snowflake's OA isn't really about writing complicated code. It's about recognizing the right algorithmic pattern within the first few minutes of reading the problem.

The encouraging part is that Snowflake doesn't refresh its OA question pool very often. Many classic problems continue to reappear, so reviewing recent interview reports before taking the assessment can significantly increase your chances of seeing familiar questions.

For preparation, I used the InterviewShow North American OA question bank. Both of these problems were included with detailed solution ideas and algorithm explanations. They also provide OA preparation resources and interview support if you're looking for additional practice.

Good luck to everyone taking the Snowflake OA. Hopefully you'll recognize both questions immediately, finish in under 20 minutes, and leave plenty of time to review your solutions.

Top comments (0)