DSA Master › Topic 18

Advanced Data Structures & Design

Design problems ask you to build a class that meets specific time bounds per operation. Usually that means combining two structures: a hash map for O(1) lookup, plus a linked list, heap or TreeMap for ordering.

Concepts

How to recognise it

Common pitfalls

Problems

  1. LRU Cache (Medium)
  2. LFU Cache (Hard)
  3. Implement Stack using Queues (Easy)
  4. Time Based Key-Value Store (Medium)
  5. Design Twitter (Medium)
  6. Random Pick with Weight (Medium)
  7. Insert Delete GetRandom O(1) – Duplicates Allowed (Hard)
  8. Design Circular Queue (Medium)
  9. Maximum Frequency Stack (Hard)
  10. Design a Food Rating System (Medium)