PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Snowflake

Filter hierarchical paths after deletions

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in hierarchical string processing, prefix-based filtering, edge-case handling (duplicates, trailing slashes, empty inputs), data-structure selection, and algorithmic time/space complexity analysis within the Coding & Algorithms domain, emphasizing practical implementation over purely conceptual reasoning.

  • Medium
  • Snowflake
  • Coding & Algorithms
  • Software Engineer

Filter hierarchical paths after deletions

Company: Snowflake

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Given two arrays: ( 1) paths — slash-delimited hierarchical strings such as "California", "California/San Francisco", "California/San Francisco/7th Street"; and ( 2) deletes — paths to remove such as "California/San Francisco". Remove every path that is equal to or a descendant of any path in deletes, and return the remaining paths (order your choice). Design an efficient solution (e.g., Trie or sorting plus prefix-skipping), handle edge cases (duplicates, overlapping deletes, trailing slashes, empty arrays), and analyze time and space complexity. Implement the core function.

Quick Answer: This question evaluates proficiency in hierarchical string processing, prefix-based filtering, edge-case handling (duplicates, trailing slashes, empty inputs), data-structure selection, and algorithmic time/space complexity analysis within the Coding & Algorithms domain, emphasizing practical implementation over purely conceptual reasoning.

Related Interview Questions

  • Solve Array Distance and Wiki Navigation - Snowflake (medium)
  • Implement Document Predicate APIs - Snowflake (medium)
  • Find Shortest Wiki Click Path - Snowflake (medium)
  • Schedule prerequisite classes with retakes - Snowflake (easy)
  • Solve three coding rounds - Snowflake (medium)
Snowflake logo
Snowflake
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
6
0

Given two arrays: (

  1. paths — slash-delimited hierarchical strings such as "California", "California/San Francisco", "California/San Francisco/7th Street"; and (
  2. deletes — paths to remove such as "California/San Francisco". Remove every path that is equal to or a descendant of any path in deletes, and return the remaining paths (order your choice). Design an efficient solution (e.g., Trie or sorting plus prefix-skipping), handle edge cases (duplicates, overlapping deletes, trailing slashes, empty arrays), and analyze time and space complexity. Implement the core function.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Snowflake•More Software Engineer•Snowflake Software Engineer•Snowflake 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.