← Snowflake Interview Insights

Snowflake·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Snowflake software engineer screen, pretty much one meaty coding question that took up most of the time. The Unicode follow-up at the end was the part I didn't see coming.

Questions Asked (1)

Q1

Given a string, find the length of the longest substring with no repeated characters. Walk through an O(n) solution using a sliding window and hash map or set, and discuss the time and space complexity. How would you handle Unicode characters correctly?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Classic question but the Unicode piece is where I fumbled.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem (e.g., substring vs. subsequence, character set) and then present the sliding window technique with a hash map to track the last seen index of each character. Walk through the algorithm step-by-step, emphasizing how the window expands and contracts to maintain uniqueness, and then analyze time and space complexity. Finally, discuss Unicode handling by considering code points and using appropriate data structures.

Pro tip: Mention that the hash map stores the last index of each character to avoid shrinking the window one step at a time, making the solution truly O(n). Also, proactively bring up Unicode normalization and grapheme clusters to show depth beyond the typical ASCII assumption.

1. Clarify requirements and edge cases

Ask whether the string can be empty, what character set to assume (ASCII vs. Unicode), and confirm that we need the length of the longest substring without repeating characters. Discuss edge cases like empty string, all unique characters, and all same characters.

2. Explain the sliding window approach

Describe maintaining a window [left, right) that contains no duplicate characters. Use a hash map to store the last seen index of each character. When a duplicate is found, move left to max(left, last_seen[char] + 1) to skip past the previous occurrence.

3. Walk through an example

Trace the algorithm on a sample string like 'abcabcbb' to demonstrate how the window and max length update. Show how the hash map is updated and how left jumps efficiently.

4. Analyze time and space complexity

State that each character is visited at most twice (once by right, once by left), so time is O(n). Space is O(min(n, m)) where m is the size of the character set (e.g., 128 for ASCII, 1,114,112 for Unicode code points).

5. Address Unicode handling

Explain that Unicode characters can be represented as code points (e.g., in Python, strings are sequences of code points). Use a hash map keyed by code point. Mention that grapheme clusters (e.g., emoji with modifiers) may require more advanced handling, but for this problem, code points are typically sufficient.

Key Points to Mention

  • Sliding window technique with two pointers (left and right) to maintain a window of unique characters.
  • Hash map (or array for fixed character sets) to store the last index of each character for O(1) lookups.
  • Time complexity O(n) because each character is processed at most twice.
  • Space complexity O(min(n, m)) where m is the number of distinct characters in the string.
  • Unicode: treat characters as code points; use a hash map keyed by code point; be aware of grapheme clusters for full correctness.
  • Edge cases: empty string, string with all unique characters, string with all repeating characters.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.