I don't think I ever frustrated a teacher more in high school than I did in AP Calculus my senior year. I was never good at math in high school, mainly because I never truly mastered basic algebra. However, I managed to shuck and jive my way through all my other math coursework, on track for calc senior year, where the wheels finally came off. Fortunately, the class had a rather forgiving grading policy. Perfect attendance + all homework turned in + an attempt at the actual AP test = a grade of A, never mind anything else (like actual knowledge of calc). So I did the first two and then on the third managed the miserable grade of 2 (no, sadly not out of 3) on the AP test. Ugliest A I ever "earned."
I suspect Varian Johnson does not have a similar story (at least I hope not, for the sakes of the people who drive over the bridges he designs). His book, My Life as a Rhombus, was noted by Booklist, along with luminaries like John Green's An Abundance of Katherines, as one of the few books that features (and features brilliantly) mathematics in YA literature. As they say, "math is everywhere, so it’s surprising that it appears so rarely in fiction for young readers."