Compute capacities after site closures
Company: Meta
Role: Data Engineer
Category: Coding & Algorithms
Difficulty: Medium
Interview Round: Technical Screen
Quick Answer: This question evaluates a candidate's ability to manipulate nested dictionary data structures and perform aggregate capacity computations, assessing data transformation, mapping, and set-based reasoning skills relevant to a Data Engineer within the Coding & Algorithms domain.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ({'A':{'A':100,'B':10}, 'B':{'A':5,'B':110}}, [])
Expected Output: {'A': 100, 'B': 110}
Explanation: No closures returns baselines.
Input: ({'A':{'A':100,'B':10}, 'B':{'A':5,'B':110}}, ['A'])
Expected Output: {'B': 120}
Explanation: A closure adds to B.
Input: ({'A':{'A':1}, 'B':{'B':2}}, ['A','B'])
Expected Output: {}
Explanation: All sites closed.
Hints
- Model object-style prompts as arrays or operation streams when needed.
- Handle empty and boundary cases before the main logic.