Java Interview Questions | Glassdoor

Java Interview Questions

6,004

interview questions shared by candidates

Java Interview Questions

Sort: RelevancePopular Date

Verify that a binary search tree is indeed a binary search tree.

15 Answers

Implement division without using multiplication or division. It should work most efficient and fast.

11 Answers

Write a function Brackets(int n) that prints all combinations of well-formed brackets. For Brackets(3) the output would be ((())) (()()) (())() ()(()) ()()()

11 Answers

Write a function to get maximum consecutive sum of integers from an array.

12 Answers

List all anagrams in a file. Assumptions: case-insensitive, a-z characters only, one word per line. For example, if the file contains dog, cat, ddd, goo, act, god -- output dog, god, act, cat

10 Answers

Improve this piece of code, loop tracing, very basic printing problem

10 Answers

Two people are each stuck on their own island, connected by a ferryman with a lockable box. Each person has their own lock and key, but can't send the key along with the box. One person wants to send the other a diamond, but it must be placed into the box and locked or it will be stolen by the ferryman. How do you send the diamond without the ferryman stealing it?

10 Answers

Given a string like "I'm being interviewed by Amazon" implement a method that reverses the given string so that it looks like "Amazon by interviewed being I'm".

10 Answers

1. Take an integer input and output the number of 1's in it's binary representation. 2. Implement a mergesort. 3. Explain your level of understanding of data structures (trees, etc.) 4. What makes java different than other languages?

9 Answers

Get numeric number out of a roman string, linear time Given: mapping I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000 Input/Output: II = 2, III = 3, IV = 4 VI, VII, VIII IX = 9 XL = 40, XLIX = 49

9 Answers
2130 of 6,004 Interview Questions