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.
You can revoke tokens before they expire by distributing a token revocation list to front-ends. This involves some extra work, but presumably, the list of unexpired but revoked tokens will normally be short.
> 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.
That's odd most of these PLC are programmable with IEC 61131-3 languages,e.g. Structured Text which has For-loops. That said i did my fair share of metaprogramming as these usually lack dynamic allocation.
Most PLCs these days support 1131! My whole career in industrial automation was on older PLCs that were produced before 1131 existed. (And long before they added the "6"!) Lots of them are still running factories today. Not one of them supported anything like a for loop. The only loop is the whole program scan loop.
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.