Sanjaay Gowda T S
PetroChina Company Limited practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Aggregate gas-quality readings using compatible weights

SQL & data engineeringHardConcept

Original practice scenario: A hypothetical energy report combines gas streams with different measured volumes and energy-content readings. Explain why a simple average can misstate the combined result.

Written for independent practice using company context; this is not a verified question from a company interview.

A REASONED APPROACH

Model answer.

Choose a consistent physical basis and weight each valid measurement by the associated flow over its supported interval. An unweighted mean gives a tiny stream the same influence as a large one.

Work through it

  1. Retain stream identity, measurement interval, flow unit, reference conditions and quality status, aligning intervals before combining observations.
  2. Convert compatible measures under an approved rule and compute weighted contributions from valid overlapping coverage, preserving unavailable readings as missing evidence.
  3. Report total supported flow and the combined measure with coverage, reconciling contributions to the original streams and separating intervals with insufficient quality data.

Tradeoffs to discuss

  • Time alignment improves interpretability but may require resampling assumptions; coarse aggregation uses fewer assumptions while hiding short-lived variation.

Common pitfalls

  • Do not mix volumes measured at incompatible reference conditions without an explicit conversion.
  • A missing quality reading cannot safely contribute a zero value to a weighted average.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub