← Mithril Interview Insights

Mithril·Software Engineer·Onsite - Coding / Algorithms·Intermediate

IntermediatePrefer not to say
Jul 2026

Summary

Round 2 at Mithril was a coding round with a single problem, and it was more approachable than I expected for this kind of company. The problem had a clear structure once you saw it for what it was.

Questions Asked (1)

Q1

Given a system with a set of states and allowed operations, determine whether there exists a sequence of legal operations that leads to a safe state without ever passing through an unsafe one.

Algorithms & Data Structures
Author's notes

Basically a graph search problem dressed up in a bomb-defusing story.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the problem as a graph where states are nodes and legal operations are edges, then determine if a safe state is reachable from the initial state without visiting unsafe states. Use BFS or DFS to explore only safe states, or apply a reachability algorithm on the subgraph of safe states.

Pro tip: Clarify whether the state space is finite and if operations are reversible; this affects whether you can use bidirectional search or need to handle cycles. Also, mention that if the state space is large, you might need to use symbolic model checking or abstraction techniques.

1. Define the state space and operations

Identify all possible states and the legal operations that transition between them. Determine which states are considered safe and which are unsafe.

2. Model as a graph

Represent states as nodes and operations as directed edges. Mark unsafe states as forbidden nodes that cannot be visited.

3. Choose a search algorithm

Use BFS or DFS to explore the graph starting from the initial state, but only traverse through safe states. BFS is preferable for finding the shortest sequence if needed.

4. Check reachability of a safe state

During traversal, if a safe state is reached, return true. If the search exhausts all reachable safe states without finding one, return false.

5. Analyze complexity and optimizations

Discuss time and space complexity (O(V+E) for graph search). Mention potential optimizations like bidirectional search, memoization, or pruning if the state space is large.

Key Points to Mention

  • Graph representation: states as nodes, operations as edges
  • Safety constraints: avoid unsafe states during traversal
  • BFS vs DFS: BFS for shortest path, DFS for memory efficiency
  • Reachability analysis: determine if any safe state is reachable
  • Complexity: O(V+E) time, O(V) space for visited set
  • Handling cycles: use visited set to avoid infinite loops

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.