Java Interview Questions
- 0of 0 votes
AnswersWhy use inner classes?
- JobSeeker October 20, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersDifference between final & finally
- The Hercules September 01, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersDifferent ways to pass parameters to a function (by value, by reference, by pointer). for the following cases.
- The Hercules September 01, 2008
6.1 Basic data type (int, char etc)
6.2 Array of integers
6.3 an object of Structure
6.4 an object of a class
Discussed about possiblities of passing constant argument values (by reference, by pointer etc) & their syntax| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is the effect by keeping a constructor private? (in terms of inheritance)
- The Hercules September 01, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersSay you are using a map in your program, how would you count the number of times the program use put() and the get() function? How would you do that if its using multiple maps in the program? How would you do that if the map is sent as a parameter in a method? How would you do it if the multiple maps are passed into the methods (as parameters), and are use differently? (it went on forever....)
- g.usask August 25, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Terminology & Trivia - 0of 0 votes
AnswersWhat is the difference between Final, Finally, and Finalize?
- g.usask August 25, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Terminology & Trivia - 0of 0 votes
AnswersWhat does the "Static" keyword do? Do you know any other similar keywords? What are they?
- g.usask August 25, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersWhat do you know about Java generics
- Jackie August 08, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
Answerswhat is object reflection in Java
- Anonymous August 04, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Terminology & Trivia - 0of 0 votes
AnswersHow does Java achieve synchronization? Given an class with Synchronized method A and B, a normal method C, there are 2 threads, one instance, can these two threads call A at the same time? call A and B at the same time? A & C at the same time?
- Anonymous August 04, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Terminology & Trivia - 0of 0 votes
AnswersDifference between int and Integer in Java.
- hipy16 July 22, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Terminology & Trivia - 0of 0 votes
AnswersWhat are the interfaces in Collection classes that you worked with?
- hipy16 July 22, 2008
(Collection, Set, Map, List, Queue)| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Experience - 5of 5 votes
AnswersHad my first and second phone interview with Amazon. I was dropped. This site has been a great help towards my preparation and most questions are based on what you find here.
- S July 01, 2008
Posting my Questions is a small way of saying Thanks!
Interview 1:
1. What is polymorphism.
2. Design an OO parking lot. What classes and functions will it have. It should say, full, empty and also be able to find spot for Valet parking. The lot has 3 different types of parking: regular, handicapped and compact.
3. Coding: I have an integer array where every number appears even number of times and only one appears odd times. Find the number.
(I said hashtable and he asked me to write code with Hashtable)
4. What data structure would you use to look up phone numbers for customer names.
(I said Hashtable. Asked why hashtable, why not a tree. I said HT has O(1). Asked is order always 1, when more than O(1) in HT.
Second Interview:
1. Starter: Describe your college projects.
2. OO Design: Design a deck of cards. What classes, data structures will you use? How will you shuffle the cards? How will you divide (deck) among players. What class/function do you need to denote players and where will you add them? What class/function do you need to deck? What if I need to add 2 jokers to the deck of 52 cards.
3. Data Structures: How will you use a hashtable to find data in a tree. (Then he rephrased) suppose I have a hashtable, I want to store the data in a tree instead of a bucket. How will I do it. What complexity to find an element.
4. Bits & Bytes: Find if a binary representation of a number is palindrome. The function should work irrespective of number of bytes for an integer. Suppose if our machine is 4 bytes for an int, how will you use the program for 8 byte machine.
5. Unix: Suppose I have 100's of html files in many directories. I want to find the files having phone numbers.
b) Suppose I have 2 files having phone numbers, find the repeating phone numbers. (I said sort and grep). Then he asked what if the lines cannot be sorted.
All the best guys. I think the second interview was challenging since the interviewer was prodding until he heard a leave me alone. So it means that though they are based on questions in cc, be prepared for extensions. I think this site is all you need to prepare for Amazon interview.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Data Structures Object Oriented Design Coding - 0of 0 votes
AnswersWhat is the flaw in the design of Java.lang.Stack class of Java
- Alok Kesharwani June 15, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
Answerswhat is the difference between template in C++ and generics in java
- Alok Kesharwani June 15, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersHow Java is plateform independent
- Alok Kesharwani June 15, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersHow to implement your own HashMap in java
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
Answersgive the algorithm for checking anagram
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersWhy should you not make your Sinleton claas as Serializable and Clonable.
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is the difference between sleep and yield method
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is the limitation of singleton pattern
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersTell the situation where we can use nested classes.
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Fair Issac Software Engineer / Developer Java - 0of 0 votes
AnswersWhat was the problem in implementing double checked locking before java 1.5.
- Alok Kesharwani May 31, 2008| Report Duplicate | Flag | PURGE
Fair Issac Software Engineer / Developer Java - 0of 0 votes
AnswersWhat are the various ways in singleton pattern can be made to fail and how to avoid them ?
- helper May 09, 2008| Report Duplicate | Flag | PURGE
Fair Issac Financial Software Developer Java - 0of 0 votes
AnswersI: Interviewer M: Myself
- Vinme February 08, 2008
I: What is singleton pattern?
M: Explained about singleton pattern and constructor to be private and there will be a method (Static) which will return the object.
I: How can i achieve Thread safe in this implementation?
M: In Java we need to use "synchronized" keyword in order to make that method thread safe.
I: If there are Million threads accessing this method, as you used synchronized all the other threads has to wait, which makes the application to run slower. So how can you achieve thread safe with out using synchronization?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswerIn my 1st Phone interview:
- dpan5 February 03, 2008
What is Linked List?
Interface and abstract class
Write java code for prime no:
Threads
Garbage collector
Vector and Arraylist
HashMap and HashTable
Externalizable interface| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is difference between String and StringBuffer classes.
- perllove January 19, 2008| Report Duplicate | Flag | PURGE
Amazon Development Support Engineer Java