Caraval by Stephanie Garber

Steph says:
An engaging fantasy that will keep you guessing right up until the very end. Reminiscent of Morgenstern’s The Night Circus, maybe even better.