KIRK: You're bothered by your performance on the Kobayashi Maru.
SAAVIK: I failed to resolve the situation.
KIRK: There is no correct resolution. It's a test of character.
The Kobayashi Maru Test is one of the central themes of Star Trek II: The Wrath of Khan. In the movie, it represents the inevitability of defeat, and teaches the lesson that how we face it - with dignity, with acceptance, with strength - is at least as important, if not more so, than how we deal with victory (to paraphrase Kirk early in the movie). As Picard would say in "Peak Performance": "It is possible to commit no mistakes and still lose. That is not a weakness. That is life."
And yet, the Test is often misunderstood, especially in terms of what it's actually for, in an in-universe setting. In one interpretation, it plays the same role in a cadet's development as it does thematically in the movie: to show the cadet that there will come a time where a no-win scenario will present itself, and teach the cadet how to deal with it. But then it's not really a test, in that sense, but a lesson.
In another interpretation, the Test is to see how the cadet faces defeat, that is to say, their response to defeat. While I agree that this is certainly an important part of the test, it focuses solely on the aftermath of it and therefore makes the cadet's responses during the test itself irrelevant.
One other interpretation, as seen in the 2009 Star Trek movie, is that the Test is supposed to make a cadet face fear. I've argued before that it seems illogical that Spock would design such a test for the simple reason that fear is an emotion, and at this stage in his life Spock does not (consciously at least) find any value in emotional responses. But this again is not a test, but an experience, an extended hazing exercise with no discernable purpose on the face of it.
The Test may allow for all of these things, but that's not the actual purpose of it. The point is not whether you win or lose, or face defeat or face fear. The fact that it's a command-level exercise tells us that it's supposed to tell the instructors something about the cadet's command performance. It's not just whether a person is fit for command; there's a whole different battery of tests and exams along the way in Command School to find that out. It's about what kind of command they're fit for. While undoubtedly the Test brings in all that the cadet has learned during the course of their Academy training in a simulation, ultimately, it's the cadet's response to the Test during the course of the simulation - not after it, not because of it - that does that.
Do they go in guns blazing? Do they sacrifice their crew against overwhelming odds? Do they try diplomacy? Do they abandon the Kobayashi Maru to its fate? Do they keep trying to win, never giving up, beating their head against a brick wall to the point of insanity? Do they refuse to accept a no-win situation? Do they cheat?
I suspect most cadets would react like most people do - like Saavik did - resent the hell out of the Test and throw themselves into the gauntlet again and again trying to figure out how to beat it, not realizing that said more about them than the Test itself. And so did Kirk, for a time, until he realized that the game was rigged, that the instructors, under normal circumstances, would never allow a victory.
It's likely that the simulation adapts to whatever the cadet does and makes it more difficult on the fly. Try to eject the warp core? The ejectors are frozen due to battle damage. Challenge the Klingon captain to single combat? He refuses because you are undeserving of honor. Defeat the first wave somehow? They just keep coming. Try to run? They catch up. You get the idea. So the only real way to "win" is to reprogram the simulation so it can't adapt to whatever you throw at it.
In that sense, Kirk also missed the point of the no-win scenario, because he wanted to win. At the same time, he was philosophically opposed to the concept of a no-win scenario. So he cheated - changed the conditions just enough so it was possible to rescue the ship and win.
(As a side note, Kirk was a bit hard on himself when he said he'd never faced a no-win scenario: I'd argue that he faced it in "The City on the Edge of Forever" when he had to decide between Edith Keeler and the universe, and he passed that test admirably at great personal cost.)
But Kirk did not frustrate the intentions of the Test, nor did he provide a "wrong" response, because there really is no “correct” resolution. That was why Kirk was never sanctioned for it and in fact got the commendation for pulling off the feat in the first place. Kirk didn't seem to realize that the commendation wasn't a reward for beating the Test - it was for thinking laterally in general by going outside the simulation. The Test had already gotten what it wanted out of Kirk.
In Kirk's response, the instructors recognized a few things: a person who knew when to follow rules, to critically assess them so he knew when to question them and more importantly, when to break or circumvent them, throwing the book away and creating a new one. In his refusal to accept a no-win scenario, they also saw someone that would do whatever was necessary to push ahead in the face of overwhelming odds to search for a solution where seemingly there was none.
And in the wild final frontier of what was then 23rd Century space, which tested and claimed the lives and souls of so many of his peers - Decker, Tracy, et al., he was absolutely the kind of captain that was needed.