Fidelity Investments interview question

2 easy Java coding questions