Most of the time the interviewer is determining how you think, whether they can interact with you easily, how you react to uncertainty, how you react to feedback, how you react to a superior saying “I don’t know”, your resilience in the face of incomplete information, your calmness under stress, and then finally, your final solution given the time constraints and pressure you are under.
The goal is not really to get an A+++ on the final product (although that’s nice) but the goal is to communicate that you work well under non-ideal conditions and you’re not a total F*ing nightmare. So take a big breath and engage that lovely neocortex and let your intellect be driven purely by curiosity, a desire to do good, and kindness, and you will get far.