Mid
From PDF
GoF Patterns
Gang of Four Patterns
Encapsulation of Collection Structure:?
Short answer: The Iterator Pattern allows the collection’s internal structure to be hidden from the client. The client interacts only with the iterator, which means that changes to the underlying collection (e.g., changing it from a list to a linked list) do not affect the client code.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png