to know sth perfectly so that you can repeat it at any time without having to think about it
have / know sth off pat
to know sth perfectly so that you can repeat it at any time without having to think about it
He had all the answers off pat.
Definiciones del Oxford Advanced Learner's Dictionary, 9.ª edición