30
December

Here we go:
QUESTIONS:

1. You need to insert huge amount of objects and randomly delete them one by one. Which Collection data structure is best pet?
2. What goes wrong if the HashMap key has same hashCode value?
3. If hashCode() method is overridden but equals() is not, for the class ‘A’, then what may go wrong if you use this class as a key in HashMap?
4. How will you remove duplicate element from a List?
5. How will you synchronize a Collection class dynamically?

ANSWERS:

1. Obviously, LinkedList.
2. It leads to ‘Collision’ wherein all the values are stored in same bucket. Hence, the searching time increases quad radically.
3. Left to Readers.
4. Add the List elements to Set. Duplicates will be removed.
5. Use the utility method java.util.Collections.synchronizedCollection(Collection c)

Related posts:

  1. Java Interview Questions, Tricks and Tips. Oh no, this is not an yet another article posting...
  2. Java Threads Interview Questions Many people feel that Threads and Collection APIs are somewhat...
  3. Java, J2EE Performance Tuning Interview Questions And, I’m back with some performance related interview questions. The...
  4. JSP Servlet Interview questions Many people have requested to post JSP Servlets scenario based...
  5. Design Patterns Interview Questions Patterns are so important, if you are giving a software...

Related posts brought to you by Yet Another Related Posts Plugin.

Category : Java J2EE Interview Questions

Comments

Spartan December 30, 2008

Is this your blog Mani?

Nice thing to see you blogging on your own site…

–Spartan

Manivannan Palanichamy December 30, 2008

@Spartan: ya, it’s my blog :) nice to hear from you after long time.

Enlargement January 16, 2009

I am amazed with it. It is a good thing for my research. Thanks

Rajesh Reddy July 20, 2009

Hi Maini,,, excellent questions……i have been searching for these type of real time questions for some time now……definitely useful for me

Thanks,
Rajesh

Malaya kumar sahoo September 16, 2009

Thnx for ur selective realtime questions,that most of the IT people faced in the intreviews…
Regards,
Malay

Jagan Mohan Reddy January 20, 2010

Hi mani,thank u these questions are very useful to everyone ..
can u send these type of real time questions to my id…
once again thank u

das January 21, 2010

Hi Mani, Can you please email me interview question on Design Patterns, Webservices and EJB’s. Thanks in advance

Justin Madrid January 21, 2010

SEO

Do you wish you could increase your online leads?

Getting a GUARANTEED 1ST PAGE GOOGLE RANKING is easier and more cost-effective than you might think.
We have helped a lot of businesses thrive in this market and we can help you! Simply hit reply and I’ll share with you the cost and the benefits See you at the top!

Shubham January 30, 2010

These questions are really nice, I did face a client interview recently and these kind of questions were asked, I wish i would have seen this before :)

Ankit Jain January 31, 2010

Get leads and sales from your website

We are interested to get your website on first page of Google, Yahoo and Bing. Please get back to us for more details.

Felicia Sams March 22, 2010

We are interested to increase traffic to your website, please get back to us in order to discuss the possibility in further detail.

Jim Guthrie April 3, 2010

Search Engine Optimization

We would like to get your website on first page of Google.

All of our processes use the most ethical “white hat” Search Engine Optimization techniques that will not get your website banned or penalized.
Please reply and I would be happy to send you a proposal.

Nitin April 10, 2010

Can someone answer this for me?

If hashCode() method is overridden but equals() is not, for the class ‘A’, then what may go wrong if you use this class as a key in HashMap?

Dilip April 16, 2010

If ‘A’ does not override equals() then when you use it as key in map . you will not be able to find the value for which you have used this class’s object as key.

dadfdad June 5, 2010

may appear in the southeastern portion of Poya Jungle of AION kinah. Its unique drop is a LV40 blue necklace called Corby’s Necklace. It also has an increased rate for it to drop items of the same level range.

Jack Walcer June 23, 2010

Get Your Website on the 1st Page of Google, Yahoo and MSN

Hi Website Administrator,

We are purely organic search SEO Firm; we can get your website on the 1st page of Google, Yahoo and MSN (Bing.com). We can increase your sales at least 4 times. We do not use “link farms” or “black hat” methods that Google and the other search engines frown upon and can use to de-list or ban your site.

Our Guarantee : we are the only company who gives the 1st month trail services. We don’t charge single penny 1st month. within one month, we can show you the improvements in your rankings on search engines. And after one month, if you will see any improvements and if you satisfy with our services. Then only you can continue with us otherwise there is no obligation. Just try our services only for one month, and you can judge our work.

We don’t have any contract , we are working on monthly basis. And we guarantee you that once you start working with us, you will get the best quality work and services from us.

Please let me know , if you are interested in this. Please contact me at your convenience so we can start saving you some money.

Sincerely,
Jack Walcer
jackseomarketing@gmail.com
COMPLETE INTERNET MARKETING SOLUTION
SEO - Link Building - Copyrighting - Web Designing - PHP

Pragya August 20, 2010

For more java related queries, please refer http://pragyarawal.blogspot.com

Ricky Dempsey August 26, 2010

Do you want to grow your business? Do you have serious, defined sales goals?

Leave a comment

Spam protection by WP Captcha-Free