DEV Community

Cover image for Building "The Dumpster Fire" Simulator
Harish Kotra (he/him)
Harish Kotra (he/him)

Posted on

Building "The Dumpster Fire" Simulator

Introduction: Why Simulate Outages?

Software engineering isn't just about writing code; it's about maintaining systems. Yet, most interviews focus on LeetCode puzzles. We wanted to build something that tests the "Day 2" skills: How do you react when the site is down, the CEO is angry, and the logs are screaming?

Enter The Dumpster Fire.

The Architecture: Simulating a Terminal in React

The core of the app is a state-driven terminal. Instead of a simple input/output loop, we built a Command Dispatcher that updates a global "Simulated Time" and "System State."

The State Machine

We use a gameState variable to manage the flow:

  • auth: The entry gate.
  • playing: The active simulation.
  • won/lost: The end-game states.
  • admin: The reporting dashboard.

Command Handling Logic

Every command typed by the user is parsed and matched against a set of "Simulated Truths." Here’s a snippet of how we handle the kubectl logs command:

else if (lowerCmd.includes('kubectl logs') && lowerCmd.includes('api-gateway')) {
  setDiagnosticLogic(prev => Math.min(10, prev + 3));
  addLog(`[ERROR]: ConnectionAcquisitionTimeoutError: Timeout acquiring connection from pool.`);
  setRootCauseFound(true);
}
Enter fullscreen mode Exit fullscreen mode

Injecting Chaos: The Social Engineering Aspect

A real outage isn't just a technical problem; it's a social one. We implemented a Chaos Injectorβ€”a simple useEffect or turn-based trigger that sends Slack messages from Sam (the Junior Dev) and Alex (the CEO).

Sam provides "Red Herrings" (like blaming Redis), while Alex provides "Pressure" (asking for ETAs). This tests the candidate's ability to filter noise and manage stakeholders.

Data Persistence & Admin Oversight

To make this useful for hiring managers, we needed a way to review performance. Every command history is captured in a Report object:

type Report = {
  candidateName: string;
  timeToResolve: number;
  commands: string[];
  status: 'won' | 'lost';
  // ... metrics
};
Enter fullscreen mode Exit fullscreen mode

Currently, these are stored in LocalStorage, but the architecture is ready for a Firebase migration to allow real-time tracking across devices.

"The Dumpster Fire" proves that you don't need a complex backend to create a high-stakes technical assessment. By combining a simple command parser with a rich narrative and social pressure, we've created a tool that reveals more about a candidate's senior-level intuition than any whiteboard ever could.

Example Output 1

Example Output 2

Example Output 3

Github Repo: https://github.com/harishkotra/dumpster-fire

Top comments (0)