We consider the medical student scheduling (MSS) problem, which consists of assigning medical students to internships of different disciplines in various hospitals during the academic year to fulfill their educational and clinical training. The MSS problem takes into account, among other constraints and objectives, precedences between disciplines, student preferences, waiting periods, and hospital changes. We developed a local search technique, based on a combination of two different neighborhood relations and guided by a simulated annealing procedure. Our search method has been able to find the optimal solution for all instances of the dataset proposed by Akbarzadeh and Maenhout (Comput Oper Res 129: 105209, 2021b), in a much shorter runtime than their technique. In addition, we propose a novel dataset in order to test our technique on a more challenging ground. For this new dataset, which is publicly available along with our source code for inspection and future comparisons, we report the experimental results and a sensitivity analysis.