PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Coinbase

Implement a versioned recipe management system

Last updated: Mar 29, 2026

Quick Overview

This question evaluates data-structure design and state-management competencies, covering CRUD, case-insensitive search/sort semantics, user management, and versioning/rollback for an in-memory Recipe Management System in the Coding & Algorithms domain.

  • medium
  • Coinbase
  • Coding & Algorithms
  • Software Engineer

Implement a versioned recipe management system

Company: Coinbase

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Take-home Project

You are asked to implement an in-memory **Recipe Management System** (similar in difficulty to a simple banking/in-memory DB exercise). The system supports incremental feature “levels”. Design the data structures and implement the required APIs. ## Data model Assume each **Recipe** has at least: - `recipeId` (unique string or integer) - `name` (string) - `size` (integer; used only for sorting) Assume each **User** has at least: - `userId` (unique) - `userName` No persistence is required (everything is in memory). --- ## Level 1: Basic CRUD for recipes Implement the following operations: - `addRecipe(recipe)`: add a new recipe (reject or overwrite if `recipeId` already exists—state your choice clearly). - `updateRecipe(recipeId, fields...)`: update an existing recipe. - `getRecipe(recipeId)`: return the recipe or “not found”. - `deleteRecipe(recipeId)`: delete an existing recipe. Define expected behavior for edge cases (e.g., updating/deleting a non-existent recipe). --- ## Level 2: Search and list Implement: - `searchRecipes(query)`: search recipes by **name**, **case-insensitive** (define whether it’s exact match or substring match; choose one and be consistent). - `listRecipes(sortBy)`: return all recipes sorted by either: - `name` (lexicographic, case-insensitive), or - `size` (numeric ascending) Specify tie-breaker behavior (e.g., tie-break by `recipeId`). --- ## Level 3: Add user Implement: - `addUser(user)`: add a user (keep it simple—no extra features unless needed). Define behavior on duplicate `userId`. --- ## Level 4: Version history and rollback Add **versioning** to support: - `versionHistory()`: return stored version metadata (at minimum, a monotonic `versionId` and what changed). - `rollback(versionId)`: restore the system state to exactly how it was at that `versionId`. Guidance: treat each mutating operation (e.g., add/update/delete recipe, add user) as producing a new version; maintain whatever additional structures you need (e.g., a `versionMap`). --- ## Constraints / expectations - Assume up to ~100k recipes/users. - Aim for clean APIs and reasonable time complexity. - You may implement this as a class/module with methods in your preferred language.

Quick Answer: This question evaluates data-structure design and state-management competencies, covering CRUD, case-insensitive search/sort semantics, user management, and versioning/rollback for an in-memory Recipe Management System in the Coding & Algorithms domain.

Related Interview Questions

  • Implement an In-Memory Database - Coinbase (hard)
  • Implement a Coin-Constrained Jump Strategy - Coinbase (hard)
  • Implement Game Physics and Block Mining - Coinbase (hard)
  • Compute Total Manual Distance - Coinbase (medium)
  • Implement a Flappy Bird Jump Agent - Coinbase
Coinbase logo
Coinbase
Nov 23, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
17
0

You are asked to implement an in-memory Recipe Management System (similar in difficulty to a simple banking/in-memory DB exercise). The system supports incremental feature “levels”. Design the data structures and implement the required APIs.

Data model

Assume each Recipe has at least:

  • recipeId (unique string or integer)
  • name (string)
  • size (integer; used only for sorting)

Assume each User has at least:

  • userId (unique)
  • userName

No persistence is required (everything is in memory).

Level 1: Basic CRUD for recipes

Implement the following operations:

  • addRecipe(recipe) : add a new recipe (reject or overwrite if recipeId already exists—state your choice clearly).
  • updateRecipe(recipeId, fields...) : update an existing recipe.
  • getRecipe(recipeId) : return the recipe or “not found”.
  • deleteRecipe(recipeId) : delete an existing recipe.

Define expected behavior for edge cases (e.g., updating/deleting a non-existent recipe).

Level 2: Search and list

Implement:

  • searchRecipes(query) : search recipes by name , case-insensitive (define whether it’s exact match or substring match; choose one and be consistent).
  • listRecipes(sortBy) : return all recipes sorted by either:
    • name (lexicographic, case-insensitive), or
    • size (numeric ascending)

Specify tie-breaker behavior (e.g., tie-break by recipeId).

Level 3: Add user

Implement:

  • addUser(user) : add a user (keep it simple—no extra features unless needed).

Define behavior on duplicate userId.

Level 4: Version history and rollback

Add versioning to support:

  • versionHistory() : return stored version metadata (at minimum, a monotonic versionId and what changed).
  • rollback(versionId) : restore the system state to exactly how it was at that versionId .

Guidance: treat each mutating operation (e.g., add/update/delete recipe, add user) as producing a new version; maintain whatever additional structures you need (e.g., a versionMap).

Constraints / expectations

  • Assume up to ~100k recipes/users.
  • Aim for clean APIs and reasonable time complexity.
  • You may implement this as a class/module with methods in your preferred language.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase 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.