Java developer Interview Questions in United States | Glassdoor.co.in

# Java developer Interview Questions in United States

2,239

java developer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

15 Jan 2010

28 Oct 2011

### Java Developer at Kroger was asked...

21 Jul 2017
 Explain what functional programming was, its benefits, downsides and why I thought it was useful or not.3 AnswersQuestion came up due to my mention of being a Scala developer as my main language. Started with the basics of FP being immutability and evaluating things as pieces to a larger algorithm just like math. Continued on with pros, use cases, personal opinion and some cons.What all programming questions did you get in that HackerRank test?You didn't ask what kind, but what all, therefore its seems like you're asking specifics. And if you have to ask specifics then you probably need to re-evaluate things

### Senior Java Developer at Wallet Hub was asked...

2 Nov 2017
 Given an array of numbers, create another array of numbers. Calculate each new array number by multiplying all input array numbers, except for the current number position in the new array.3 AnswersA O(2*N) = O(N) solution would include: 1. Get the product of all the numbers in the input array; 2. Set the ith number as the product, in step1, divided by the ith number in the input; Of course, the obvious solution would have complexity of O(n^2): get the new array ith number by getting the product of all the input numbers except for the ith position number.Solution with O(N) public long[] multipliedArray(int[] arr){ long result[] = new long[arr.length]; long allMultiplication=1; for(int i=0;ipublic static void main(String[] args) { int[] returnVal = multiplyArrayItems(new int[]{1,2,3,4,5}); System.out.println(String.join(",", Arrays.stream(returnVal).mapToObj(String::valueOf).toArray(String[]::new))); } static int[] multiplyArrayItemsSE(int[] arr){ int[] returnArr = new int[arr.length]; ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("js"); try { String[] sarr = Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new); int totalVal = (int) engine.eval[String.join("*", sarr)); for(int i = 0; i < arr.length; i++){ returnArr[i] = totalVal / arr[i]; } } catch (ScriptException e) { // TODO Auto-generated catch block e.printStackTrace(); } return returnArr; }

### Junior Java Software Engineer at Interactive Brokers was asked...

12 Nov 2016
 Some questions about Java basics, and some math problems and SQL3 AnswersCould you please post the questions or at least topics on which questions were asked?I have an onsite interview coming up. Could you recollect any questions and any tips would be appreciated.Teju, Will you please share your experience?

### Java Developer at Knight Capital was asked...

12 May 2010
 Given an array of N integers, find the missing integer.3 AnswersIterate through array, keeping a sum of the values. Subtract the final answer from n*(n-1)/2the answer is subtract the sum from n*(n+1)/2Is that a well-known algorithm? I don't know how you could ever have figured that out. I would have sorted the array and iterated until I got to the missing integer.

### Java Developer at Goldman Sachs was asked...

10 May 2011
 Fibonacci implementation3 AnswersI got the same f-ing question todayChetan Trikha is a no gooder vice president of Goldman, who has learnt fibonnaci in school and has never used it, and is asking candidates to implement it, whereas nobody can on the fly.//Fibonacci Sequence Generation using Recrusion Ex. /* Fib(0) is 0 [base case] * Fib(1) is 1 [base case] * For all integers n > 1: Fib(n) is (Fib(n-1) + Fib(n-2)) [Recursive definition] */ public int GenerateFibonacci(int count) { if (count <= 1) return 1; else return GenerateFibonacci(count - 1) + GenerateFibonacci(count - 2); }

### Junior Java Developer at Insight Global was asked...

15 Nov 2012
 Implement a method to determine whether a string is a palindrome.3 AnswersRecursive method; start from the ends and work your way in. Use indices if worried about memory.Take a string as function parameter. Copy this str value into a new var, then use .reverse() thereupon. Compare the reversed copy back against original string using turnery operator to set resVariable to "true" : "false". Return resVariable.(Using .split(""), as well as .join(""))

### Entry Level Java Developer at RedMane Technology was asked...

25 Mar 2015
 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.3 AnswersAlgo Approach: Use Binary Search to find the location where the element is to be inserted and store in a variable index. Call a function insert(a,index,newVal) where a is the sorted array. Run a for loop until index and copy elements into a new array. newArray[index] = newVal and continue copying elements from the given array into the new Array.You said that every one who is interviewed by CEO gets offer then how come you haven't received offer?!!I got the offer.

### Junior Java Developer at Interactive Brokers was asked...

21 Feb 2016
 some questions about hashCode, equals method regex question java concurrency: wait, notify, notifyAll() swing component rendering routine(without using UI-delegate)3 Answerscan I submit my screen shot????can you share it?How many days they will take to tell the status and after screening test what was the next round??
1120 of 2,239 Interview Questions