Fruits Collection |
Most of IT units in financial industry do highlights 'Threading Concept' as the crux of Java language but as per current trend it seems interviewers are being more pragmatic that educative.
Writing programs without touching java.util.* seems very uncommon unless we are up to printing 'hello world' :)
Following are some very basic but conceptually very strong features originating from Collection Framework. This article is targeted to provide just a pointer to the areas where we developers need to brush up ourselves before our interviews. I am not (as of now) listing answers here as they could be easily find out on web.
- What is hashing in Java?
- Why does one need to consider overriding hashcode() & equals() for keys used in HashMap? Is it mandatory to override these methods to allow the object getting used as keys? What will happen if we do not implement them?
- Wrapper (Immutable) classes (Integer, String etc) are considered as right candidates for HashMap keys. Why?
- When get() is invoked on a HashMap(), what are the steps followed by Java to get the associated value back?
- What is the underlying data structure used by HashMap to store its value?
- What is the underlying data structure for ConcurrentHashMap? How does it differ from HashMap and HashTable?
- Java memory model has been revised and tuned with 'Tiger' version of java 5. What are the associated updates?
- How Java 5 overcomes infamous 'Double-Checked Locking' paradigm?
- What happens when a map has to be resized to accommodate more items? What will happen if another thread calls get() when resizing is underway?
- How is the memory in use gets affected by choosing between ArrayList and LinkedList?
- Can program execution go different by choosing between Enhanced for loop and old fashioned index based loop for a collection?
- Can we iterate over a List and call remove if a certain condition matches? *Interviewer generally tries to understand whether candidate is clear about fast-fail feature, ConcurrentModificationException and use of Iterator.
Did you know
1. Comparator and Comparable though gets referred mostly together but they belong to different java libraries ?
2. Java 5 Enums could be used to provide Singleton implementation?
Would appreciate the feedback and if someone is willing to add answers against these queries then most welcome.
No comments:
Post a Comment