Design a menu manager with enums

Quick Overview

This question evaluates data modeling with enums, efficient data structure selection to meet specified time complexities, API design for CRUD operations, and practical implementation skills including a command-line interface and unit testing.

Design a menu manager with enums

Company: CloudKitchens

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Design and implement a console-based restaurant menu management program. Requirements: ( 1) There are exactly three fixed item categories represented by an enum (e.g., APPETIZER, MAIN, DESSERT). ( 2) Support addItem(name, price, category), updatePrice(name, newPrice), removeItem(name), listAll(), and listByCategory(category). ( 3) Print items using each object's toString() rather than accessing fields via getters; list output grouped by category and sorted alphabetically within each category. ( 4) Choose data structures to achieve O( 1) add/update/remove by name and O(k log k) listing within a category (k = number of items in that category). ( 5) Provide a simple CLI that reads commands from stdin and executes them, plus basic unit tests.

Overview: This question evaluates data modeling with enums, efficient data structure selection to meet specified time complexities, API design for CRUD operations, and practical implementation skills including a command-line interface and unit testing.

|Home/Coding & Algorithms/CloudKitchens
CloudKitchens logo
CloudKitchens
Sep 6, 2025
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
10
0

Design and implement a console-based restaurant menu management program. Requirements: (

  1. There are exactly three fixed item categories represented by an enum (e.g., APPETIZER, MAIN, DESSERT). (
  2. Support addItem(name, price, category), updatePrice(name, newPrice), removeItem(name), listAll(), and listByCategory(category). (
  3. Print items using each object's toString() rather than accessing fields via getters; list output grouped by category and sorted alphabetically within each category. (
  4. Choose data structures to achieve O(
  5. add/update/remove by name and O(k log k) listing within a category (k = number of items in that category). (
  6. Provide a simple CLI that reads commands from stdin and executes them, plus basic unit tests.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...