FIS Interview Question

Java related and DSA and coding problem