PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Snapchat

Implement a dictionary without built-in Dictionary

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of hash tables and low-level data-structure implementation, including hashing, collision resolution, resizing/rehashing, and performance guarantees for put/get/remove operations.

  • hard
  • Snapchat
  • Coding & Algorithms
  • Software Engineer

Implement a dictionary without built-in Dictionary

Company: Snapchat

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

Implement a key-value map type (a “dictionary” / hash map) **from scratch**, without using the language’s built-in dictionary/map as the underlying storage. ## Requirements - Support at least: - `put(key, value)` - `get(key) -> value | null` - `remove(key)` - Keys are hashable. - Handle hash collisions correctly. - Discuss or implement resizing/rehashing to keep operations efficient. ## Constraints / Goals - Aim for `O(1)` average time per operation. - You may use arrays/lists as the underlying storage, but not a built-in associative container. ## Follow-ups - Compare separate chaining vs open addressing. - How would you design this as a generic type (e.g., in Swift: `Key: Hashable`)?

Quick Answer: This question evaluates understanding of hash tables and low-level data-structure implementation, including hashing, collision resolution, resizing/rehashing, and performance guarantees for put/get/remove operations.

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
Jan 2, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
6
0
Loading...

Implement a key-value map type (a “dictionary” / hash map) from scratch, without using the language’s built-in dictionary/map as the underlying storage.

Requirements

  • Support at least:
    • put(key, value)
    • get(key) -> value | null
    • remove(key)
  • Keys are hashable.
  • Handle hash collisions correctly.
  • Discuss or implement resizing/rehashing to keep operations efficient.

Constraints / Goals

  • Aim for O(1) average time per operation.
  • You may use arrays/lists as the underlying storage, but not a built-in associative container.

Follow-ups

  • Compare separate chaining vs open addressing.
  • How would you design this as a generic type (e.g., in Swift: Key: Hashable )?

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.