Medium
Canva

Design a Power Plant Electricity Allocator Object-Oriented Design Interview

Design a class-level system modeling a power plant that distributes electricity to multiple neighborhoods, each with a stated demand, subject to the plant's total capacity.

1. Problem Statement

Design a system that models a power plant with a fixed electricity capacity distributing power to a set of neighborhoods, each with a stated demand. The plant may not have enough capacity to fully satisfy all demands simultaneously. How would you design this?

2. Live Coding Format

Work in the provided coding workspace while explaining your decisions to the live interviewer. Validation may use inline tests, examples, comments, or a verbal walkthrough.

3. Key Focus Areas

  • 1
    PowerPlant / Neighborhood entity decomposition
  • 2
    Allocation policy clarification (proportional, priority, first-come, or capped)
  • 3
    Capacity tracking and over-demand handling
  • 4
    Add/update/remove neighborhood demand
  • 5
    Allocation query: actual delivered vs requested

4. What Strong Candidates Should Demonstrate

  • Model a constrained resource (total capacity) distributed across consumers (neighborhoods with demand).
  • Clarify and choose an allocation policy — rather than assuming one — and implement it consistently.
  • Separate plant-level capacity tracking from neighborhood-level demand representation.
  • Validate allocation correctness with concrete numeric handwritten examples.

Want interactive feedback?

Practice this problem in the live coding workspace while the interviewer probes your clarification, implementation, trade-offs, and validation.

Continue to Dashboard

Core Concepts

Object-Oriented DesignResource AllocationClass Modeling

Continue preparing

Build a complete software engineer mock interview plan

Related Object-Oriented Design

Design a Meeting Room Booking System

Design a class-level system for booking meeting rooms: register a room, book a meeting given a start time and duration, and cancel an existing meeting with correct conflict detection.

Related Object-Oriented Design

Design a Car Rental System

Design a car rental domain model covering vehicle categories and vehicles, branches, customers and drivers, a rental date range, rate-based quotes, reservations, pickup rental agreements, and return inspection with extra charges — preventing overlapping rentals of the same vehicle.

Related Object-Oriented Design

Design a Cricket Information Platform

Design a cricket scoring domain model covering teams and players, a match, innings, overs and deliveries, batting and bowling scorecards, extras and wickets, striker rotation, over completion, and match results for a configurable limited-overs format.

Related Object-Oriented Design

Design a Group Expense-Splitting Ledger

Design a system where users form groups, log shared expenses using pluggable splitting strategies (equal/exact/percentage), maintain pairwise balances, and settle debts.