Questions

47 questions
  • Design a pizza price calculatorOO designDesign a price calculator for a pizza shop. A pizza starts from a size and a crust, which set its base price, and each topping adds to the price, with topping prices that can…
    Last asked Nov 2026
  • +1
    Design a parking lotOO designDesign and implement the core of a parking lot in code. The lot has several floors, and each floor has numbered spots of three sizes: motorcycle, compact and large.
    Last asked Nov 2026
  • +1
    Design a chess gameOO designDesign a two-player chess game in code: the board, the pieces and how each one moves, turns, check, checkmate and stalemate, and the special moves (castling, en passant…
    Last asked Nov 2026
  • Checkout price engine with pluggable discountsOO designDesign the price engine for an e-commerce checkout and write the code for its core parts. A cart holds line items, each with a product id, a unit price and a quantity.
    Last asked Sep 2026
  • Concurrent restaurant waitlist and seatingOO designDesign and code the waitlist and seating for a restaurant. Parties join the list with a size and a phone number, tables free up, and the system decides who sits where and texts…
    Last asked Jul 2026
  • +1
    Design a hotel booking system (object-oriented)OO designDesign the object model for a hotel booking system: hotels with room types and rooms, guests, bookings and payments. Guests search for availability for a date range, book, and…
    Last asked Jun 2026
  • Design a snake gameOO designDesign the snake game in object-oriented code. The snake moves on a grid, grows when it eats food, and the game ends when it hits a wall or its own body.
    Last asked Jun 2026
  • Design a library management systemOO designDesign the object model for a library: books and their physical copies, members, loans, holds and fines. Members search the catalog, borrow and return copies, place holds on…
    Last asked Jun 2026
  • +1
    Design a voting systemOO designDesign the object model for a polling or voting system. A poll has a question and options, a set of eligible voters, and an open and close time. Each voter casts one vote, can…
    Last asked May 2026
  • Extensible cinema ticket pricing engineOO designDesign the pricing engine for a cinema's tickets. A movie format (2D, 3D, IMAX…) sets a base price; the showtime (matinee, evening…) and the seat tier (standard, premium…) each…
    Last asked May 2026
  • +2
    Design an elevator control systemOO designDesign the object model for the elevators of a multi-floor building with several elevator cars. People press Up or Down on a floor, passengers choose a destination inside a car…
    Last asked Apr 2026
  • In-memory pub/sub with prioritiesOO designDesign and code a publish/subscribe system that runs in one process. Publishers send messages to named topics; subscribers subscribe to and unsubscribe from topics; every current…
    Last asked Apr 2026
  • Deck of cards with shuffle, draw and sortOO designDesign an in-memory model of a standard 52-card deck. Client code builds a fresh deck, shuffles it, draws cards one at a time until the deck is empty, and can put the remaining…
    Last asked Mar 2026
  • Assign dorm rooms by student preferenceOO designDesign the object model for a dormitory room-assignment system. You get a set of students and a set of rooms. Each room is either a two-person room or a four-person room, with…
    Last asked Feb 2026
  • Extensible employee cost calculatorOO designDesign the object model and calculation API for what an employee costs the company. The total has four parts: base salary from the employee record; tax as a fixed percentage of…
    Last asked Feb 2026
  • Cart and pricing engine for a food delivery orderOO designDesign the core classes of a cart and pricing engine for a food delivery marketplace. The final checkout price is rarely just the sum of the menu items. It depends on item…
    Last asked Jan 2026
  • Design a poker gameOO designDesign the object model for a poker game, for example Texas Hold'em: cards and a deck, players and their chips, the betting rounds, and deciding the winner at showdown. Name the…
    Last asked Jan 2026
  • Design Amazon Locker (object-oriented)OO designDesign the object model for a self-service package locker. A courier drops a package into a free compartment that fits it, and the system issues a one-time pickup code valid for a…
    Last asked Jan 2026
  • Design Amazon Kindle (object-oriented)OO designDesign the object model behind an e-reader service: users buy books, download them to their devices, read them in several formats, and pick up on any device where they left off…
    Last asked Jan 2026
  • Design a basic credit card systemOO designDesign the classes of a basic credit card system. A customer has an account with a credit limit and one or more cards. Cards make purchases, which are authorized against the…
    Last asked Oct 2025
  • Design a wallet with holds and payoutsOO designDesign and implement, in code that runs, a wallet for a rental platform. Guests and hosts have balances. A booking puts the guest's money on hold; the hold is later captured (paid…
    Last asked Sep 2025
  • Memory usage switcher with configurable thresholdsOO designDesign and code an in-memory switcher that watches the process's memory usage and switches between ENABLED and DISABLED when usage crosses thresholds the caller configures. For…
    Last asked Sep 2025
  • Keyboard and mouse input systemOO designDesign an input system that records what a user does with the keyboard and the mouse and can tell, at any time, exactly what text the user entered. It must handle several input…
    Last asked Sep 2025
  • Configuration store with subscriber notificationsOO designDesign a configuration service: a system sets configuration values, and applications subscribe to the keys or namespaces they care about. When a value changes, every subscriber of…
    Last asked Sep 2025
  • Extensible event ticketing systemOO designDesign an EventTicketSystem that sells tickets for different kinds of events (concerts, movies, sports games). Adding a new kind of event or ticket later, with its own pricing…
    Last asked Sep 2025
  • Design a traffic light control systemOO designDesign the control software for one road intersection's traffic lights. The lights cycle through phases with set timings, pedestrians can press a button to request a crossing, and…
    Last asked Sep 2025
  • Design a restaurant reservation serviceOO designDesign the object model for a restaurant reservation service. Restaurants have tables of different sizes and open hours divided into time slots. Guests search for availability by…
    Last asked Sep 2025
  • Design Unix file searchOO designDesign a find-like file search over a directory tree. A search starts at a directory and returns the files that match a set of filters: name pattern, minimum or maximum size, file…
    Last asked Aug 2025
  • Thread-safe document and tag classesOO designDesign the classes for a system that stores documents and the tags on them, and make every operation safe when many threads call it at once. Write the core classes and methods in…
    Last asked Aug 2025
  • Task and worker assignment modelOO designDesign and implement Task and Worker classes and a small manager that drives them, then use it to print the system's state. One operator makes calls one after another in a single…
    Last asked Sep 2022
  • Component templates and instance overridesOO designA template defines a reusable component, such as a button with a label, a color and a corner radius. Users create instances of it and override some fields, for example the label…
    Last asked Oct 2021
  • Design a vending machineOO designDesign a vending machine in code. It holds products in slots, accepts coins and notes, lets the customer select a product, takes payment, gives change and handles sold-out items…
  • Design a food delivery system (object-oriented)OO designDesign the object model for a food delivery app: restaurants and their menus, customers placing orders, couriers delivering them, and the states an order moves through. Include…
  • Design a coffee makerOO designDesign the software for a coffee machine. It has containers for ingredients (water, coffee beans, milk, sugar, chocolate), a set of drink recipes, and the steps to brew each one…
  • Design a blackjack gameOO designDesign the object model for a blackjack table: one dealer, several players, a shoe made of several decks, bets, and payouts. Players can hit, stand, double down and split; the…