Consider a critical application and I have to make two external calls to do a transaction, the second call depends on the status of the first call. If I have to make this method atomic, ie, I want to make sure either the entire transaction happens or nothing happens. How do I handle if the system fails in between the calls?
How am I supposed to answer this if I get this question in an interview?