Take a look at some real live interview questions on Java by companies sourced from Glassdoor.com

Barclays Investment:

Assume there is a method provided getNextperson() which gives Person objects which have comparable interface implemented, now read from a file records and sort it and give first 1000 records, write code on the paper

See answers on Glassdoor

Write code to return a sorted array of int, when passed in 2 sorted array of int to the method.

See answers on Glassdoor

Knight Capital:

Given an array of N integers, find the missing integer?

See answers on Glassdoor



Global Healthcare Exchange:

What is the difference between an abstract class and an interface?

See answers on Glassdoor



Goldman Sachs:

Fibonacci implementation



See answers on Glassdoor

why C++ deconstructor defined as virtual?

See answers on Glassdoor

how to find square root of integer?

See answers on Glassdoor Google:

Given two files that has list of words (one per line), write a program to show the intersection.

See answers on Glassdoor





Nextlabs:

Trees (binary and otherwise) form the basis of many common data structures. Please describe some of these data structures and when they might be used.



Delphix:

How to find the median number out of 4 byte integers?

See answers on Glassdoor

Amazon.com: Given the following list of integers, how would you sort it the most efficiently and weed out duplicates at the same time? See answers on Glassdoor Accenture:

Explain memory management differences between Java and C++.

See answers on Glassdoor

Given a C++ or Java type/expression give the other's equivalent (if it exists). Example: C++ has constants, Java has...?

See answers on Glassdoor

Give me an example of when you would want to create an interface?

See answers on Glassdoor Citi:

what methods would you overwrite in java.lang.object class?

See answers on Glassdoor





Microsoft:

write a program that'll find all combinations of a string and check if they are palindromes or not?

See answers on Glassdoor



RedMane Technology:

Technical Questions: 1. Three pillars of OOP with explanation of each 2. Final Keyword in Java 3. Abstract Class & Interface difference 4. JSP & Servlets difference 5. What is meant by immutability in Java? 6. Multi-threading - Sleep vs Yield? 7. What is a design pattern and name some. Explain Singleton Design Pattern? 8. protected keyword in access modifiers 9. Continue vs break statement 10. Describe MVC? 11. StringBuffer vs StringBuilder? 12. One logic/algo question: Inserting an element at proper position in a sorted array. They will focus on the very basic logic design like loops, function and their arguments.

See answers on Glassdoor



OPNET:

Explain the struts framework in a sentence?

See answers on Glassdoor





BlackBerry:

Does Hash Table allow null values?

See answers on Glassdoor





EverBank Financial:

What would cause a null pointer exception?

See answers on Glassdoor





TRUSTe:

Code an elevator simulator in java?

See answers on Glassdoor





Airline Tariff Publishing Company:

When you use Singleton instance in Spring, you will get only once instance. If I want to get multiple instances which is required for my application, how do you override or overcome the situation?

See answers on Glassdoor





Clearwire:

What command would you use to determine if any Tomcat instances are running on a machine?

See answers on Glassdoor

What is the minimum number of tables required to perform a SQL join?

See answers on Glassdoor UC Davis:

How do you pass variables between two JSP pages and how do you do it between a controller servlet and a JSP page?

See answers on Glassdoor





Deutsche Bank:

What differences can you tell me about a ArrayLists and LinkedLists, IE when would you use one over the other?

See answers on Glassdoor





Mindteck: