Grid Dynamics Interview Question

Two coding questions on hashmap and linked list and theory on java 8