She knew the material backwards and forwards, acing the exam.
He knew the city inside and out, every street and alleyway.
He knew the hiking trail like the back of his hand, never getting lost.
After studying for hours, she knew the math problem upside down.