PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/System Design/Chime

Design multi-tab browser history and trade-offs

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competence in system design, data-structure selection, API specification, concurrency control, and eviction/semantic strategies for a multi-tab browser-history manager, testing skills in reasoning about per-tab state, operation complexity, and memory trade-offs.

  • medium
  • Chime
  • System Design
  • Software Engineer

Design multi-tab browser history and trade-offs

Company: Chime

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Technical Screen

Extend the single-tab history to support multiple tabs. APIs to support (design the interface): - int openTab(string homepage): Create a new tab and return its identifier. - void closeTab(int tabId): Close the tab and free its history. - void switchTab(int tabId): Make tabId the active tab. - void visit(string url), string back(int steps), string forward(int steps): Apply to the active tab. - Optional: bool haveVisited(string url): Define per-tab and/or global semantics. Requirements and discussion: - Choose data structures to manage tabs and their histories (e.g., map from tabId to per-tab history, list/array to track tab order). Compare trade-offs (map vs list), memory footprint, and operation complexity. - Consider thread-safety if multiple tabs can act concurrently; outline locking or immutability strategies. - Discuss history capping/eviction policies and their effect on haveVisited semantics. - Specify complexity targets for each operation and justify your design decisions.

Quick Answer: This question evaluates a candidate's competence in system design, data-structure selection, API specification, concurrency control, and eviction/semantic strategies for a multi-tab browser-history manager, testing skills in reasoning about per-tab state, operation complexity, and memory trade-offs.

Related Interview Questions

  • Design load balancing, caching, and idempotent APIs - Chime (easy)
  • Design mobile check deposit system - Chime (hard)
Chime logo
Chime
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
17
0

Design: Multi-Tab Browser History

Context: Extend a single-tab browser-history component into a multi-tab manager that supports opening/closing tabs, switching the active tab, and performing visit/back/forward on the active tab.

APIs to Design

  1. int openTab(string homepage)
  2. void closeTab(int tabId)
  3. void switchTab(int tabId)
  4. void visit(string url)
  5. string back(int steps)
  6. string forward(int steps)
  7. Optional: bool haveVisited(string url) — define per-tab and/or global semantics

Functional Requirements

  • Each tab maintains its own navigational history (back/current/forward).
  • visit(url) clears the forward history of the active tab and navigates to url.
  • back(steps) and forward(steps) move within the active tab, clamped by available steps, and return the current URL.
  • openTab returns a stable, unique tab identifier; switchTab changes which tab is considered active.
  • closeTab disposes of the tab’s history.

Design Discussion Requirements

  • Data structures for:
    • Per-tab history.
    • Registry of open tabs and (optionally) their order (e.g., MRU).
  • Compare trade-offs (e.g., map vs. list) including memory footprint and operation complexity.
  • Complexity targets and justification per operation.
  • Thread-safety if multiple tabs can act concurrently: propose locking/immutability.
  • History capping/eviction policies and how they affect haveVisited semantics (per-tab and/or global).

Assumptions (refine as needed)

  • Up to N tabs (e.g., 1e5). Each tab’s history can be capped at H entries.
  • Active tab is maintained per Browser instance/session.
  • URLs are arbitrary strings.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Chime•More Software Engineer•Chime Software Engineer•Chime System Design•Software Engineer System Design
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.