CRISIL interview question

Based on Java and SQL