A tricky question you can expect in a technical interview is like this: Is it displayed on the screen? 😈
try
{
try
{
throw new InvalidOperationException("Something went wrong inside.");
}
catch (InvalidOperationException ex)
{
Console.WriteLine(ex.Message);
throw;
}
throw new Exception("Outer level failure.");
}
catch (Exception ex)
{
Console.WriteLine("Outer catch: " + ex.Message);
}