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 dataset with a missing question or an empty source list will fail silently — a metric returns a number, the number is meaningless, and nobody notices for a month. Write the validator that runs in CI before any evaluation starts.
Implement validate_row(row) where row is a dictionary. Check in exactly this order and return the first problem found:
question key, or it is an empty string → "MISSING_QUESTION""SHORT_QUESTION"answer key, or it is an empty string → "MISSING_ANSWER"sources key, or the list is empty → "NO_SOURCES""OK"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.