One way to approach questions like this is to change the prompt to something like "List characters in the word strawberry and then let me know the number of r's in this word". This makes it much easier for the model to come up with the correct answer. I tried this prompt a few times with GPT4o as well as Llama 3.1 8B and it yields the right answer consistently with both models. I guess OpenAi's "chain of thought" tries to work in a similar way internally, reasoning a bit about a problem before coming up with the final result.
You could use the access token for each request. The advantage is that it is a simpler approach, and does away with the 5-minutes restriction you refer to, as the logout/invalidation would be immediate and not in 0-X minutes where X is the access token life in minutes. The disadvantage is that serving each request will involve making a round-trip with the auth service. This means at the minimum a DB read for every request, but could also mean a call to a separate, (possibly a third-party) auth microservice, and with possible fraud-detection measures each request. Depending on your use-case, you can drastically reduce the number of calls made to the auth server/database by using JWTs (or any other "algorithmically verifiable" token). This improves performance and enables architectures where for example you have a single auth server globally but multiple "functional" edge servers close to your users to serve out requests as soon as possible.
> I’ve skimmed over the code and it was processing hardcoded index positions. I repeat the person who did that had no concept of a loop. Since the query was returning more than 250 results the remaining rows were being ignored.
Unrelated, but this reminds me of a time when I had to write some code in some proprietery programming language in some industrial automation project to program a PLC. The language was similar to Visual Basic but lacked support for basic things such as for loops. I spent some time creating a "meta-language" that would compile code down to this language with added support for loops and some other stuff. Then I would paste the compiled code in the proprietary software each time I had to change anything.
Besides companies, there are also solo web developers working on cross-platform apps. It opens up mobile/desktop app development to them. Learning new languages and platforms to create native apps might simply not be an option. And users benefit from more apps on the app store, more options for them.