Java Collections Interview Questions and Answers




1.       What are Collection related features in Java 8?
2.       What is Java Collections Framework? List out some benefits of Collections framework?
3.       What is the benefit of Generics in Collections Framework?
4.       What are the basic interfaces of Java Collections Framework?
5.       Why Collection doesn’t extend Cloneable and Serializable interfaces?
6.       Why Map interface doesn’t extend Collection interface?
7.       What is an Iterator?
8.       What is difference between Enumeration and Iterator interface?
9.       Why there is not method like Iterator.add() to add elements to the collection?
10.   Why Iterator don’t have a method to get next element directly without moving the cursor?
11.   What is different between Iterator and ListIterator?
12.   What are different ways to iterate over a list?
13.   What do you understand by iterator fail-fast property?
14.   What is difference between fail-fast and fail-safe?
15.   How to avoid ConcurrentModificationException while iterating a collection?
16.   Why there are no concrete implementations of Iterator interface?
17.   What is UnsupportedOperationException?
18.   How HashMap works in Java?
19.   What is the importance of hashCode() and equals() methods?
20.   Can we use any class as Map key?
21.   What are different Collection views provided by Map interface?
22.   What is difference between HashMap and Hashtable?
23.   How to decide between HashMap and TreeMap?
24.   What are similarities and difference between ArrayList and Vector?
25.   What is difference between Array and ArrayList? When will you use Array over ArrayList?
26.   What is difference between ArrayList and LinkedList?
27.   Which collection classes provide random access of it’s elements?
28.   What is EnumSet?
29.   Which collection classes are thread-safe?
30.   What are concurrent Collection Classes?
31.   What is BlockingQueue?
32.   What is Queue and Stack, list their differences?
33.   What is Collections Class?
34.   What is Comparable and Comparator interface?
35.   What is difference between Comparable and Comparator interface?
36.   How can we sort a list of Objects?
37.   While passing a Collection as argument to a function, how can we make sure the function will not be able to modify it?
38.   How can we create a synchronized collection from given collection?
39.   What are common algorithms implemented in Collections Framework?
40.   What is Big-O notation? Give some examples?
41.   What are best practices related to Java Collections Framework?
42.   What is Java Priority Queue?
43.   Why can’t we write code as List numbers = new ArrayList();?
44.   Why can’t we create generic array? or write code as List[] array = new ArrayList[10];

What does partial trust mean the Web Part developer?

If an assembly is installed into the BIN directory, the code must be ensured that provides error
handling in the event that required permissions are not available. Otherwise, unhandled ecurity exceptions may cause the Web Part to fail and may affect page rendering on the page where the Web Part appears.

Does a SharePoint Web site include search functionality?

Yes. SharePoint Team Services provides a powerful text-based search feature that helps you find documents and information fast.

What are the features of the new Content management in Office SharePoint 2007?

The new and enhanced content management features in Office SharePoint Server 2007 fall within three areas:
* Document management
* Records management
* Web content management

Office SharePoint Server 2007 builds on the core document management functionality provided by Windows SharePoint Services 3.0, including check in and check out, versioning, metadata, and role-based granular access controls. Organizations can use this functionality to deliver enhanced authoring, business document processing, Web content management and publishing, records management, policy management, and support for multilingual publishing.

What are the advanced features of MOSS 2007?

* User Interface (UI) and navigation enhancements
* Document management enhancements
* The new Workflow engine
* Office 2007 Integration
* New Web Parts
* New Site-type templates
* Enhancements to List technology
* Web Content Management
* Business Data Catalog
* Search enhancements
* Report Center
* Records Management
* Business Intelligence and Excel Server
* Forms Server and InfoPath
* The “Features” feature
* Alternate authentication providers and Forms-based authentication