Persistent Systems Interview Question

Mostly about DSA. Told me to write a code.