Find Loads That Lose Power When A Breaker Opens

Last updated: November 29, 2026

Quick Overview

Model an electrical one-line diagram as buses connected by breakers with open or closed states, plus utility and generator sources. Given a breaker to trip, return the loads that were energized before and are de-energized after.

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

0

0

0 solved


Model an electrical one-line diagram as buses connected by breakers with open or closed states, plus utility and generator sources. Given a breaker to trip, return the loads that were energized before and are de-energized after.

Tools like EcoStruxure Power and ETAP reason about one-line diagrams constantly, for example to show an operator what a switching action will affect. The interviewer checks graph modeling, reachability from multiple sources, and awareness of real switching topology such as tie breakers and backfeed from generators.

What the Interviewer Expects
  • Models buses as nodes and breakers as undirected edges with state
  • Runs multi-source BFS from all live sources
  • Compares before and after sets instead of only after
  • Handles open tie breakers and alternate sources correctly
  • Discusses how to answer many what-if queries efficiently
Key Topics to Cover
graph traversal
multi-source BFS
one-line diagram
what-if analysis
bridges
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
  • How would you answer 'which single breakers, if tripped, de-energize the PUMP load' for every load at once?
  • How do you incorporate automatic transfer switches that close a tie when a bus goes dead?
  • The diagram has 100,000 nodes and operators ask many queries. How do you speed this up?
  • How would you check that two sources are never paralleled through a closed tie?
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

Edges: (breaker_id, bus_a, bus_b, closed). Sources: list of source nodes (utility, generators, UPS). Loads: list of nodes. Query: trip one breaker. Output: sorted loads that lose power. Power flows ...

High-Level Design

Energized = reachable from any source over closed breakers. Compute that set twice: once with the current state and once with the tripped breaker removed. The answer is before - after, restricted to...


Submit Your Answer
Markdown supported

Related Questions