Kirstie Alley was 30 when she played Lt. Saavick. So, it would make more sense for Kirk to be in his late-twenties at least when he takes the KM test. Also, McCoy may very well have been a practicing M.D. when he joined the service (as others have said). IMO, it makes perfect sense for McCoy, Kirk, Uhura, Sulu and Chekov to be at the academy at the same time. Uhura and Sulu would be senior cadets (22ish in age?), Chekov would be a junior cadet(18ish), Kirk would be a full Lt. (at least) who is back at the academy for his command training (aged 26-30?), and McCoy would be a doctor in his mid-thirties who has joined the fleet as an officer and is completing his required training.