X interview question

SQL, Dynamic Programming