Appian Interview Question

DSA questions , some logical puzzles