Cognizant interview question

How would you implement a stack using array lists? How does a hashmap work? What you have to do in order to deteriorate an hashmap's running time?