Hard data structure and algorithm practice puzzle.
Shor's algorithm breaks RSA by turning factoring into finding a period. Given a and n with no common factor, find the smallest r above 0 where a to the power r leaves remainder 1 when divided by n. If r is odd, give up and return an empty list. Otherwise let h be a to the power r / 2, modulo n. If h is n - 1, give up as well. Otherwise the two factors are gcd(h - 1, n) and gcd(h + 1, n). Return them, smaller first.
Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free to play, with no account.
Every line of the solution comes with a note explaining why it is there, and a step by step replay shows the code running. At level 3, where you type it yourself, you can ask for an AI mock interview on this problem that ends with a hiring manager's scorecard.
Then grow it into a real project with the Software Engineer button: this puzzle becomes the Shot Throughput Report, a pipeline you can run and download. See every Software Engineer project.