ArrayList is a dynamic array under the hood. It stores elements in a contiguous block of memory, automatically resizing when it runs out of space. It's the most commonly used collection in Java. Fast at reading by index, slower at inserting or deleting in the middle because everything has to shift. Think of it like a numbered list of seats in a row — finding seat 5 is instant, but inserting a new seat in the middle means everyone shifts over.
Under the hood — what interviewers want to hear:
Default initial capacity is 10
When full it creates a new array at 1.5x the size and copies everything over
That copy operation is expensive — if you know your size upfront, initialize with it: new ArrayList<>(100)
Connection to your work: Any time you returned a list of tournaments, users, or transactions in your Spring Boot REST APIs you were almost certainly using ArrayList under the hood.
Likely interview questions:
"What's the difference between ArrayList and an array?"
"When would ArrayList be a bad choice?"
"What happens internally when ArrayList runs out of space?"
Quick answers:
ArrayList is dynamic and resizes automatically, arrays are fixed size
Bad choice when you're doing lots of insertions/deletions in the middle — use LinkedList instead
Creates a new array at 1.5x capacity and copies all elements over
LinkedList stores elements as individual nodes, where each node holds its value and a pointer to the next (and previous) node. There's no contiguous memory block like ArrayList — elements are scattered in memory, connected by references. Fast at inserting and deleting anywhere, slow at accessing by index because you have to walk the chain from the start. Think of it like a treasure hunt — each clue points to the next location, so finding clue #50 means following all 49 clues before it.
In My Work: If your Tournament App had a waiting queue for players joining a tournament, LinkedList would be the right call — constantly adding to the back and removing from the front is exactly what LinkedList excels at.
Likely interview questions:
"When would you use LinkedList over ArrayList?"
"What is a doubly linked list?"
"What data structures can LinkedList act as?"
Quick answers:
Use LinkedList when doing frequent insertions/deletions, especially at the ends. Use ArrayList when you need fast random access
Doubly linked means each node points to both the next AND previous node
LinkedList can act as a Queue (FIFO), Stack (LIFO), or Deque (both ends)
Summary: Polymorphism means one interface, many forms. The same method call behaves differently depending on which object is actually running it. There are two types — compile-time (method overloading) and runtime (method overriding). Runtime polymorphism is the more important one for interviews. Think of it like a universal remote — same button, different behavior depending on which device you're controlling.
In an interview context: polymorphism lets you write flexible code that works with a parent type but executes child-specific behavior automatically at runtime.
Overloading is when you use the same function name.
Summary: Abstraction means hiding complex implementation details and only showing what's necessary. You define WHAT something should do, without specifying HOW it does it. Java achieves this through abstract classes and interfaces. Think of it like driving a car — you know the steering wheel turns the car, you don't need to know how the steering column mechanically works underneath.
In an interview context: abstraction reduces complexity, enforces a contract that implementing classes must follow, and lets you swap implementations without breaking anything.
Abstraction is basically seeing functions and process ordered without seeing the internal logic. You could have a class object that stores all the information and then you as a programmer call the various methods. DAO's are absolutely a great example.