THN Interview Prep

Math & Geometry

Math and geometry problems reward careful modeling more than heavy formulas. State the representation first: digits, sign and overflow, modular exponentiation, points and slopes, or cycle behavior.

Mental Model

  • Digit simulation: build or inspect one digit at a time.
  • Overflow boundaries: compare before multiplying or adding.
  • Modulo arithmetic: reduce repeated exponentiation or large products.
  • Geometry normalization: canonicalize slopes, coordinates, and duplicates.
  • Cycle detection: repeated numeric states imply loops.

Diagram

Loading diagram…

Problem List

Start with 007. Reverse Integer, 050. Pow(x, n), 202. Happy Number, 149. Max Points on a Line, and 043. Multiply Strings.

Mark this page when you finish learning it.

Last updated on

Spotted something unclear or wrong on this page?

On this page