PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Snowflake

Implement crawler and bracket validator

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competencies in web crawling and string validation, covering graph traversal and cycle avoidance with domain filtering for crawl discovery, and delimiter matching with error indexing for multi-type bracket validation.

  • Medium
  • Snowflake
  • Coding & Algorithms
  • Software Engineer

Implement crawler and bracket validator

Company: Snowflake

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Implement two tasks: ( 1) Write a function crawl(start_urls, fetch, max_depth, domain_filter) that visits pages starting from the given seed URLs using the provided fetch(url) -> (content, outgoing_links) API. Requirements: avoid revisiting URLs (handle cycles), support breadth-first traversal limited by max_depth, enforce domain_filter, and return the set of discovered URLs. Analyze time and space complexity. ( 2) Design an algorithm to validate whether a string of parentheses is well-formed. Extend it to support three bracket types '()', '[]', and '{}', and return the index of the first error if invalid. Discuss complexity and edge cases (e.g., empty string, odd length, early closing).

Quick Answer: This question evaluates competencies in web crawling and string validation, covering graph traversal and cycle avoidance with domain filtering for crawl discovery, and delimiter matching with error indexing for multi-type bracket validation.

Related Interview Questions

  • Implement a JSON Parser - Snowflake (hard)
  • Solve Matrix and Array Distance Problems - Snowflake (medium)
  • Solve Array Distance and Wiki Navigation - Snowflake (medium)
  • Implement Document Predicate APIs - Snowflake (medium)
  • Find Shortest Wiki Click Path - Snowflake (medium)
Snowflake logo
Snowflake
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
5
0

Implement two tasks: (

  1. Write a function crawl(start_urls, fetch, max_depth, domain_filter) that visits pages starting from the given seed URLs using the provided fetch(url) -> (content, outgoing_links) API. Requirements: avoid revisiting URLs (handle cycles), support breadth-first traversal limited by max_depth, enforce domain_filter, and return the set of discovered URLs. Analyze time and space complexity. (
  2. Design an algorithm to validate whether a string of parentheses is well-formed. Extend it to support three bracket types '()', '[]', and '{}', and return the index of the first error if invalid. Discuss complexity and edge cases (e.g., empty string, odd length, early closing).

Submit Your Answer to Earn 20XP

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 8,000+ 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.