Design a Go music player with playlists

Quick Overview

This question evaluates object-oriented system design, API and data-structure modeling, state and concurrency management, persistence considerations, and algorithmic time/space complexity within a Go-based music player domain.

Design a Go music player with playlists

Company: Paramount Commerce

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design and implement an object-oriented music management player in Go. Requirements: represent Song, Playlist, and Player types; support adding/removing songs, reordering, and optional deduplication; support merging two playlists while preserving order and handling duplicates according to a policy you define; support playing a playlist with play, pause, next, previous, shuffle, and repeat; expose clear APIs and data structures and discuss their time/space complexity; consider concurrency for simultaneous edits and playback, thread safety, and persistence; and outline unit tests for core behaviors.

Overview: This question evaluates object-oriented system design, API and data-structure modeling, state and concurrency management, persistence considerations, and algorithmic time/space complexity within a Go-based music player domain.

|Home/System Design/Paramount Commerce
Paramount Commerce logo
Paramount Commerce
Sep 6, 2025
hardSoftware EngineerTechnical ScreenSystem Design
12
0

Design and Implement an Object-Oriented Music Player in Go

You are asked to design and implement a small, object-oriented music management and playback system in Go.

Requirements

  1. Core domain types:
    • Song
    • Playlist
    • Player
  2. Playlist features:
    • Add/remove songs
    • Reorder/move songs
    • Optional deduplication toggle (prevent duplicate songs by ID)
  3. Merging playlists:
    • Merge two playlists while preserving the relative order of songs from each source
    • Define and implement a duplicate-handling policy (e.g., keep-first, keep-last, keep-both)
  4. Player controls and behavior:
    • Play, pause, next, previous
    • Shuffle
    • Repeat modes (off, one, all)
  5. Engineering aspects:
    • Expose clear APIs and data structures
    • Discuss time and space complexity of core operations
    • Consider concurrency for simultaneous edits and playback; design for thread safety
    • Consider persistence (saving/loading playlists)
    • Outline unit tests for core behaviors

Assume a console-based player (no actual audio) where playback means managing state and current song position.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...