Java algorithms used in coding interviews