  We reverse engineer dynamics of financial contagion to find the scenario of
smallest exogenous shock that, should it occur, would lead to a given final
systemic loss. This reverse stress test can be used to identify the potential
triggers of systemic events, and it removes the arbitrariness in the selection
of shock scenarios in stress testing. We consider in particular the case of
distress propagation in an interbank market, and we study a network of 44
European banks, which we reconstruct using data collected from Bloomberg. By
looking at the distribution across banks of the size of smallest exogenous
shocks we rank banks in terms of their systemic importance, and we show the
effectiveness of a policy with capital requirements based on this ranking. We
also study the properties of smallest exogenous shocks as a function of the
largest eigenvalue $\lambda_{\rm max}$ of the matrix of interbank leverages,
which determines the endogenous amplification of shocks. We find that the size
of smallest exogenous shocks reduces and that the distribution across banks
becomes more localized as $\lambda_{\rm max}$ increases.
