Challenge 003 · Software Engineering
Decode the Telemetry
Write the limit check at the heart of a ground system. Implement a JavaScript function that picks out the telemetry readings outside their operating limits, then run it against test cases.
- Difficulty
- Easy
- Type
- Executable coding challenge
- Estimated time
- About 20 min
- Reputation
- Up to 50 REP
- Experience
- 50 XP on first completion
Mission briefing
Curlew-2 is a small Earth observation satellite. Every second it reports on its own health: the battery voltage, the battery temperature, how fast its reaction wheels are turning, the pressure in its propellant tank. During each pass over a ground station that housekeeping telemetry comes down to the ground system, which is where your code runs.
By the time a reading reaches you, the ground system has unpacked its packet, converted the raw counts to engineering units and looked up the limits for that sensor in the mission database. One step is missing: the check itself. You are the ground software engineer. Write the function that goes through a batch of readings and reports the ones outside their limits, so that the operators see them.
Implement findOutOfLimit(records) in the editor. Each record holds a timestamp, a sensorId, the measured value, a lowLimit and a highLimit. Return a list with one entry for every reading that is out of limits, in the order the readings were given. Each entry carries the reading's timestamp, sensorId and value, and a limit of "low" or "high" to say which limit was broken. The objectives below state the rules exactly, and the visible test cases in the workspace show them at work.
Background
ShowHide
Limit checking is the first line of spacecraft health monitoring. For every telemetry parameter the mission database records the range its engineers consider safe, and the ground system compares each incoming value with that range. A value outside it raises an alarm on the operators' displays, often well before anything has failed.
Operational systems refine the idea. Many parameters have two ranges: a yellow one that asks for attention and a red one that demands action. Limits can change with the spacecraft's mode, and a monitor usually waits for several consecutive samples before raising an alarm, so that one noisy reading does not wake the on-call engineer. This challenge keeps the core: one range for each reading, checked one sample at a time.
Telemetry does not always arrive in time order. A pass usually delivers live readings mixed with recorded ones played back from earlier in the orbit. A limit checker reports what it finds in the order it was given and leaves sorting to the displays.
Objectives
Report every reading whose value is below its lower limit or above its upper limit, with
limitset to"low"or"high"to say which.Treat a value exactly equal to a limit as within limits, and leave it out.
Keep the results in the order the readings were given, and report every out-of-limit reading, including repeats from one sensor and readings that share a timestamp.
Give each result exactly four properties:
timestamp,sensorIdandvalue, copied unchanged from the reading, andlimit.Return an empty list when the input is empty or every reading is within limits.
Treat the input as read-only. Do not change the list or the records in it; build new objects for the results.
Workspace
Practice attempts
Kept in this browser only, the latest few. Practice results are unverified and are not part of your training record.
Constraints
ShowHide
- Write JavaScript, and declare
findOutOfLimitas a function at the top level of your code, as the starter does. Helper functions are welcome. - Your code runs on its own. There are no imports, no network access, no files and no page to touch.
console.logworks, and what it prints is shown with the results. - All test cases together must finish within 2 seconds, and a solution may be at most 20,000 characters long.
- Run code checks the visible cases only, in an isolated sandbox in your browser. A ranked submission is judged on the Academy's server against the visible cases and 14 private ones, and every case must pass.
What this model leaves out
ShowHide
Every model simplifies. These are the simplifications this one makes.
- Every record has all five properties with the types shown in the starter code. Values and limits are finite numbers and can be negative, zero or fractional.
- A reading's lower limit is never greater than its upper limit. The two can be equal, and then only that exact value is within limits.
- Numbers are compared exactly as given, with no rounding and no tolerance. Operational monitors often add a deadband or wait for a reading to persist; this one does not.
- Each reading carries a single pair of limits. Yellow and red alarm levels, limits that depend on the spacecraft's mode and checks that compare one sensor with another are left out.
- Timestamps are ISO 8601 text in UTC. They are labels to copy; the function never needs to parse or compare them.
- A batch holds at most a few thousand readings.
Hints
There are 5 hints, from a nudge to a strong lead. Using them costs nothing.
Related lessons and guides
- Telemetry and Command StructuresLesson
- CCSDS Space Packets and Data HandlingLesson
- Ground Software ArchitectureLesson
- Failure Modes and Fault ProtectionLesson
- Telemetry, Commanding and Health MonitoringLesson
- What Is Telemetry, Tracking and Commanding (TT&C)?Guide
- Satellite Ground Systems FundamentalsGuide
Mission patches
A validated result on this challenge counts toward these patches.
Code Flight
Wrote code that decoded a spacecraft's telemetry.
First Mission
Completed a first challenge with a validated result.