Barty Crouch Jr. was about 19 when he was thrown into Azkaban. According to this answer, he spent 11 years and 10 months under the control of his father's Imperius Curse--over a third of his life. Toward the end of that time, Barty began to break free of the Curse to some extent, but he had no access to a wand until he stole Harry's wand during the Quidditch World Cup. How, then, could he be an effective teacher and perform the magic required to Confund the Triwizard Cup and later turn it into a Portkey? In Barty's own words,
It would have taken an exceptionally strong Confundus Charm to bamboozle that goblet into forgetting that only three schools compete in the tournament.
Yet Barty spent a longer time unable to use magic than he did studying at Hogwarts. Most people--Muggles, anyway--would see an ability they neglected "grow rusty" after a while. But Barty is able to perform complicated magic as soon as he regains his freedom. How could someone who was barely an adult at the time of his arrest, and who spent the next eleven years Imperiused to his father's will, have such an exceptional knowledge of advanced magic, as well as the ability to use it?