Resample and Interpolate Gappy Hourly Data Center Power Readings

Last updated: November 29, 2026

Quick Overview

Power meters in Meta data centers report readings (region, ts, kw) irregularly and sometimes drop out. Resample each region to hourly means, linearly interpolate gaps of at most 3 hours, leave longer gaps as missing, and report hours of missing data per region.

Meta
Data Manipulation (SQL/Python)
Data Engineer
Meta
November 29, 2026
Data Engineer
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Power meters in Meta data centers report readings (region, ts, kw) irregularly and sometimes drop out. Resample each region to hourly means, linearly interpolate gaps of at most 3 hours, leave longer gaps as missing, and report hours of missing data per region.

Infrastructure capacity teams at Meta rely on clean time series of power and utilization, and short sensor gaps are common. The interviewer checks resample with groupby, interpolation limits that do not paper over long outages, and visibility into how much data was imputed.

What the Interviewer Expects
  • Set a datetime index and resample per region to hourly
  • Interpolate only gaps up to the limit, not partial fills of long gaps
  • Mark which values were imputed
  • Report remaining missing hours per region
  • Avoid interpolating across region boundaries
Key Topics to Cover
resample
interpolate
time series
missing data
infrastructure metrics
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • Why might time-weighted interpolation differ from linear here?
  • How would you detect a stuck meter that reports the same value for hours?
  • How would you handle daylight saving time if timestamps were local?
Sharpen Your Skills on Codemia

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

Practice SQL Problems
Sample Answer
Clarify the Data

readings(region, ts, kw) in UTC, several per hour or none. A gap means consecutive missing hours after hourly resampling. Gaps of 1 to 3 hours are filled; a gap of 4 or more stays entirely NaN (not ...

Approach

Per region, set_index('ts').kw.resample('h').mean() produces hourly bins with NaN for empty hours. pandas' interpolate(limit=3) would partially fill longer gaps, which is misleading, so I compute ...


Submit Your Answer
Markdown supported