Airplane Crash Exception Handling

Par 10
Question 3expertSheet 1750822302

Deep Breath

An in-flight entertainment system must continue operating while the plane experiences catastrophic failure. Passengers demand Netflix access even as oxygen masks deploy and the aircraft enters uncontrolled descent. The system must balance emergency information with Karen from 12B insisting her movie doesn't pause during the apocalypse. Your task: Manage entertainment system exceptions during actual airplane exceptions while maintaining passenger sanity and your own will to live.

Why You're Doing This

This is priority queue management under extreme stress with competing demands from irrational users. You're building a system that must serve critical safety information while managing passengers who think turbulence is just an inconvenience. The goal is SHORTEST CODE that prioritizes emergency info while managing passenger psychology during literal aircraft failure.

Take the W

  • Prioritizes safety information over entertainment
  • Gracefully degrades service based on crisis severity
  • Manages passenger psychology during emergencies

Hard L

  • Continues showing movies during nosedive
  • Crashes system when oxygen masks deploy
  • Ignores emergency protocols completely

Edge Cases

  • Emergency level 11 (off the scale, system designer assumed competent pilots)
  • Passengers demanding refunds during nosedive (capitalism never dies)
  • Zero system power but emergency level 10 (backup systems failed catastrophically)
  • Negative passenger panic (sedatives working too well, check for unconsciousness)
  • Karen requests manager during evacuation (middle management crisis protocol)
Input Format:
handle_crisis(emergency_level, passenger_state, system_power)
Expected Output:
{'mode': str, 'allocation': dict, 'passenger_response': str}
Example:
handle_crisis(8, 'demanding_netflix', 0.4) → {'mode': 'emergency_only', 'allocation': {'safety': 1.0}, 'response': 'override'}
Hints
  • 💡 Emergency > 8 = full safety override
  • 💡 Passenger psychology matters as much as technical priorities
  • 💡 System crashes create more panic than entertainment loss