PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Snapchat

Solve Three Coding Problems

Last updated: Apr 2, 2026

Quick Overview

This set of problems evaluates competencies in streaming data handling and incremental aggregation, time-dependent grid traversal and reachability under dynamic hazards, and planar path existence with geometric obstacles, touching on data structures, graph algorithms, and computational geometry within the Coding & Algorithms domain.

  • Snapchat
  • Coding & Algorithms
  • Software Engineer

Solve Three Coding Problems

Company: Snapchat

Role: Software Engineer

Category: Coding & Algorithms

Interview Round: Onsite

The interview included three coding problems: 1. **Streaming top-k class.** Design a class for an integer stream with a fixed parameter `k`. It should support `add(x)` to ingest a new value and `getTopK()` to return the `k` largest values seen so far in descending order. If fewer than `k` values have appeared, return all of them. Aim for efficient incremental updates. 2. **Maximum safe delay in a burning grid.** You are given an `m x n` grid containing empty cells, walls, and initial fire sources. Fire spreads every minute to the four neighboring non-wall cells. A person starts at the top-left cell and wants to reach the bottom-right cell. Before moving, the person may wait for `t` minutes at the start, then moves one step per minute through non-wall cells. The person may never enter a cell after the fire has arrived there; arriving at the destination at the same minute as the fire is allowed. Return the maximum `t` that still allows escape, return `-1` if escape is impossible even with no waiting, and return `1000000000` if escape is possible for arbitrarily large `t`. 3. **Reachability in a rectangle with circular blockers.** You are given a rectangle with corners `(0, 0)` and `(X, Y)`, along with several closed circles inside or touching the rectangle. Determine whether there exists a continuous path from `(0, 0)` to `(X, Y)` that stays within the rectangle and never touches or enters any circle. The path may move in any direction.

Quick Answer: This set of problems evaluates competencies in streaming data handling and incremental aggregation, time-dependent grid traversal and reachability under dynamic hazards, and planar path existence with geometric obstacles, touching on data structures, graph algorithms, and computational geometry within the Coding & Algorithms domain.

Related Interview Questions

  • Determine Whether Courses Can Be Completed - Snapchat (medium)
  • Solve Decimal Coin Change - Snapchat (medium)
  • Find Maximum Island Perimeter - Snapchat (medium)
  • Solve Three Algorithmic Tasks - Snapchat (hard)
  • Implement a Timestamped Counter - Snapchat (medium)
Snapchat logo
Snapchat
Feb 8, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
0
0
Loading...

The interview included three coding problems:

  1. Streaming top-k class. Design a class for an integer stream with a fixed parameter k . It should support add(x) to ingest a new value and getTopK() to return the k largest values seen so far in descending order. If fewer than k values have appeared, return all of them. Aim for efficient incremental updates.
  2. Maximum safe delay in a burning grid. You are given an m x n grid containing empty cells, walls, and initial fire sources. Fire spreads every minute to the four neighboring non-wall cells. A person starts at the top-left cell and wants to reach the bottom-right cell. Before moving, the person may wait for t minutes at the start, then moves one step per minute through non-wall cells. The person may never enter a cell after the fire has arrived there; arriving at the destination at the same minute as the fire is allowed. Return the maximum t that still allows escape, return -1 if escape is impossible even with no waiting, and return 1000000000 if escape is possible for arbitrarily large t .
  3. Reachability in a rectangle with circular blockers. You are given a rectangle with corners (0, 0) and (X, Y) , along with several closed circles inside or touching the rectangle. Determine whether there exists a continuous path from (0, 0) to (X, Y) that stays within the rectangle and never touches or enters any circle. The path may move in any direction.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Snapchat•More Software Engineer•Snapchat Software Engineer•Snapchat Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.