Question: Is it so that we have to exhaust all our negative karma before we can become liberated?
Answer: No. This can be clearly known by looking at the case of Maudgalyāyana (Moggallāna). Although he has already attained self-liberation as an Arhat, he still experienced the fruition of past heavy negative karma when he was killed by bandits. If all his negative karma had already been exhausted before he became an Arhat, this would not had happen.
While his case might seem ‘disturbing’, it is actually more consoling in nature, for these three reasons —  Even though his body was subject to pain, his mind was already liberated before being killed. Thus, he did not truly suffer. The very key value of attaining liberation is to be liberated from suffering. This does not require departure from life first, with it attainable when well and alive.
 His case reminds us that even with potentially heavy negative karma looming, it is still possible to cultivate diligently, to be liberated before it ripens. Thus, negative karma need not always threaten our spiritual well-being if we are already practising well enough. This also reminds us to practise with a sense of urgency, before negative karma that obstructs practice might ripen, sooner than expected.
 Of course, with good practice, past negative karma’s potential effects will be mitigated. However, with immeasurable past lives’ much accumulated negative karma, to exhaust all of it, while not creating any fresh negative karma at all will take immeasurable time and effort, making it immeasurably difficult to attain liberation — if it does require exhaustion of all negative karma. Thankfully, this is not so.
Must Payback Of Karmic Debts Be Complete For Enlightenment?
How Karmic Power Overpowers Supernormal Powers
How To Help The Deceased With The Triple Gem