KreditBee Interview Question

Basic questions from testing java and puzzle