Solution - Interview Questions and Answers for 'Emc' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Solution - Interview Questions and Answers for 'Emc' - 2 question(s) found - Order By Newest

Very frequently asked. Favorite question in Walk in Drive of many Indian service companies.
  Q1. What is the difference between ArrayList and LinkedList ?Core Java
Ans. Underlying data structure for ArrayList is Array whereas LinkedList is the linked list and hence have following differences -

1. ArrayList needs continuous memory locations and hence need to be moved to a bigger space if new elements are to be added to a filled array which is not required for LinkedList.

2. Removal and Insertion at specific place in ArrayList requires moving all elements and hence leads to O(n) insertions and removal whereas its constant O(1) for LinkedList.

3. Random access using index in ArrayList is faster than LinkedList which requires traversing the complete list through references.

4. Though Linear Search takes Similar Time for both, Binary Search using LinkedList requires creating new Model called Binary Search Tree which is slower but offers constant time insertion and deletion.

5. For a set of integers you want to sort using quicksort, it's probably faster to use an array; for a set of large structures you want to sort using selection sort, a linked list will be faster.

  Sample Code for ArrayList

  Sample Code for LinkedList

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     collections   java   data structures   arraylist   linkedlist   arraylist vs linkedlist     Asked in 61 Companies      Basic        frequent

Try 1 Question(s) Test


Related Questions

 If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ?
  Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ?
 In a Linked list with sorted numbers, insert a new numbers while maintaining the sort order.
 Collections.sort can only be performed on ..

a. Set
b. List
c. Map
d. Any Collection implementation
 Is this a valid initialization ? Explain.

Collection<Collection> collection = new LinkedList<LinkedList>();
  What is the difference between List, Set and Map ?

or

What are the different Java Collections Interfaces ?
  Difference between Vector and ArrayList ?
  Overridden methods must have the same ...
  Which of the following doesn't extend Collection interface ?


Advanced level question frequently asked in US based companies. Recently asked in EMC and Intuit.
  Q2. Can you provide some implementation of a Dictionary having large number of words ? Solution
Ans. Simplest implementation we can have is a List wherein we can place ordered words and hence can perform Binary Search.

Other implementation with better search performance is to use HashMap with key as first character of the word and value as a LinkedList.

Further level up, we can have linked Hashmaps like ,

hashmap {
a ( key ) -> hashmap (key-aa , value (hashmap(key-aaa,value)
b ( key ) -> hashmap (key-ba , value (hashmap(key-baa,value)
....................................................................................
z( key ) -> hashmap (key-za , value (hashmap(key-zaa,value)
}

upto n levels ( where n is the average size of the word in dictionary.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   hashmap   binary search   search algorithm   advanced   architecture   data structure     Asked in 6 Companies        frequent

Try 1 Question(s) Test


Related Questions

 Which AWS services would you use if you have find a cheapest solution for an analytics application ?
 If a company comes to you with a problem statement, how would you help provide a solution for it ?
 While working on a web application, you are informed that there is no new data in Database for last few hours ? How would you go about debugging this problem ?
 How would you test a Twitter application ?
 Can we keep application configuration at different places and what could be the consideration for choosing multiple places for doing so ?
 Give an example wherein you recommended some solution that fixed the problem in a much easier way ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: