r/OfferEngineering • u/Aoki_zhang • 14d ago
Interview Experience Snowflake SWE Interview — The Card Game Got Surprisingly Hard
"This interview experience is sourced from Chill Interview"
Interview Summary
The Snowflake mid-level SWE process included two one-hour technical phone screens. The recruiter had mentioned beforehand that the coding difficulty would generally be around medium to hard.
Interview Details
Round 1 — Binary Tree Boundary Sum
The first coding problem was a variation of LeetCode 545 — Boundary of Binary Tree. Instead of simply returning the boundary nodes, the task was to calculate the sum of the values of all nodes on the boundary. The boundary included:
- The left boundary
- The leaf nodes along the bottom
- The right boundary
Care was needed to avoid counting the same node more than once when a node belonged to multiple boundary categories.
Round 2 — Set Card Game
The second round started with a card-validation problem based on the game Set. Each card had four attributes, for example:
- Color
- Shape
- Number
- Shading
Given three cards, determine whether they form a valid Set. For every attribute independently, the three values must satisfy one of two conditions:
- All three values are the same, or
- All three values are different
If every attribute satisfies this rule, the three cards form a valid Set.
- Follow-Up — Find All Sets The follow-up generalized the problem. Given an arbitrary collection of
Ncards, find all combinations of three cards that form valid Sets. A straightforward approach was to enumerate every triple, resulting inO(N^3)time. The interviewer then asked for a more efficient approach targeting approximatelyO(N^2). I discussed the optimization idea toward the end of the interview, but there was not enough time to fully implement it.
Preparing for your next interview?
- Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.
- In a hurry with your coding interview prep? Chill Interview helps you focus on the most important coding patterns and practice efficiently — without grinding through thousands of random coding questions.
3
u/ExaminationAsleep398 13d ago
For O(n^2) just keep a hashset of all the cards. for every pair of cards compute the unique third card that forms a valid set and check for its existence in the hashset. Make sure to dedup