aQb Solutions interview question

Basic to medium level questions