Check Whether Every EV Session Can Finish Under A Site Cap

Last updated: November 29, 2026

Quick Overview

A depot has EV charging sessions, each with an arrival slot, departure slot, energy needed and per-vehicle max charge rate, and the site has a power cap per hourly slot. Decide whether every session can be fully charged and, if so, produce a schedule.

Schneider Electric
Coding & Algorithms
Software Engineer
Schneider Electric
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


A depot has EV charging sessions, each with an arrival slot, departure slot, energy needed and per-vehicle max charge rate, and the site has a power cap per hourly slot. Decide whether every session can be fully charged and, if so, produce a schedule.

Load management for EVlink chargers and EcoStruxure EV Charging Expert has to fit fleet charging under a building's feeder limit. This hard onsite problem checks whether you can recognize a flow formulation behind a scheduling story, implement max flow correctly, and explain why simple greedy rules can fail.

What the Interviewer Expects
  • Recognizes the bipartite sessions to slots structure
  • Builds source, session, slot and sink capacities correctly
  • Implements a correct max flow (Dinic or Edmonds-Karp)
  • Recovers the per-slot schedule from the flow
  • Explains why a greedy earliest-deadline rule is not always optimal with per-vehicle rate limits
Key Topics to Cover
max flow
Dinic's algorithm
scheduling
bipartite modeling
EV load management
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • If it is infeasible, how do you minimize total unmet energy or maximize the minimum fraction delivered?
  • Electricity price varies by slot. How do you also minimize cost?
  • Sessions arrive online and you do not know future arrivals. What policy would you run?
  • How would you handle a three-phase site where each phase has its own cap?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Slots are one hour, so kW in a slot equals kWh delivered. Session i can charge in slots [arrive, depart) at most max_kw per slot and needs energy total. Slot t can deliver at most site_cap[t] ...

High-Level Design

Build a flow network: source to each session with capacity energy; session to each slot it is present in with capacity max_kw; slot to sink with capacity site_cap[t]. Any feasible schedule is a ...


Submit Your Answer
Markdown supported

Related Questions