By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Complete the code challenge below. Read the instructions carefully and use the integrated editor on the right to write and run your solution.
A tiny version of what an LLM gateway does: protect the budget first, then spend wisely on hard requests only.
Order of the if-statements matters: a request with needs_reasoning=True and no money must still be blocked.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.