Katkat

Explain How You Would Test a System

Shield AiSoftware Engineer · Technical Screen

Last updated

This question evaluates your ability to design a comprehensive testing strategy for a distributed system, focusing on reliability, observability, and failure modes.

The Scenario

You are a Software Engineer building an autonomous drone mission-planning service. The system receives flight path requests from a fleet, calculates optimal trajectories, and pushes the data to individual drone controllers. Given that this is a mission-critical system where bugs could result in hardware loss or safety hazards, design a multi-layered testing strategy.

The Task

Explain how you would approach verifying the reliability of this system. In your response, address the following:

  1. Foundations: How do you define the system contract and establish invariants (e.g., "no two paths can intersect in 3D space at the same timestamp")?
  2. Testing Layers: Describe how you would implement the following categories of tests, explaining the purpose of each in this specific context:
    • Unit tests and property-based testing
    • Contract testing
    • Integration and End-to-End (E2E) tests
    • Fault injection and chaos testing
  3. Post-Deployment: How do you ensure safety once the code is in production? Discuss canary releases, monitoring, and automated rollback triggers.

Your answer should focus on the 'why' behind each layer and how you prioritize testing efforts given the high stakes of autonomous vehicle operation.

Hints

Hint 1

Consider using property-based testing to verify invariants, such as ensuring that the trajectory generator never returns a path that violates flight altitude constraints.

Hint 2

Think about how contract testing can prevent breaking changes between the mission-planning service and the downstream drone control firmware.

Hint 3

When discussing post-deployment, prioritize observability metrics that indicate a failure in real-time, such as path-computation latency or deviations from safety protocols.

Follow-up questions

  • How would you conduct 'negative testing' or fault injection for a drone that suddenly loses GPS connectivity during a flight?
  • If your E2E tests are consistently flaky due to environmental non-determinism, what steps would you take to improve their reliability?
  • How would you integrate these testing requirements into a CI/CD pipeline to ensure that safety-critical checks are never bypassed?