IntegraFEC interview question

Analyze a case and code whatever language you prefer