Sanjaay Gowda T S
CNOOC Limited practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Summarize irregular sensor readings

Data scienceHardConcept

Original practice scenario inspired by CNOOC Limited's public business context; this is not a reported interview question or a description of its internal systems. A fictional offshore operations dataset records a measurement whenever its value changes, with periodic heartbeats. Explain why an ordinary average may mislead and how to estimate a time-weighted daily mean.

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

A REASONED APPROACH

Model answer.

Event-triggered samples overrepresent periods when values change frequently. A time-weighted mean asks how long each value represented the process, subject to a defensible interpolation and staleness rule.

Work through it

  1. Sort and deduplicate sensor events, normalize timestamps, and define whether values remain constant until the next reading or require another interpolation method.
  2. Intersect each valid interval with the reporting day, multiply value by covered duration, and divide by total valid covered time. Split intervals at day boundaries.
  3. Publish coverage and exclude intervals beyond the allowed heartbeat gap. Test midnight crossings, duplicate timestamps, missing days, and a long stale period.

Tradeoffs to discuss

  • A step-function estimate is transparent but may be wrong for rapidly varying processes. More sophisticated interpolation needs domain evidence and still cannot recover unobserved events exactly.

Common pitfalls

  • A simple row average depends on sampling behavior.
  • Filling an entire outage with the last value can create a precise-looking daily mean from almost no valid coverage.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub