Indeed interview question

Validate a program given validation rules