Lead java developer Interview Questions

112

Lead Java Developer interview questions shared by candidates

Top Interview Questions

Sort: Relevance|Popular|Date
EPAM
Lead Java Developer was asked...22 May 2017

Coding test: 1. Given a string, find out if there's repeat characters in it. 2. SQL. Given a Customer table and a Payment table (with Customer ID as primary and foreign key), write a query to output a list of customers who have not paid their bills in the last 3 months.

15 Answers

Did well on the first Java coding test. Solution using Hashset. Not so well on the SQL query. Able to give a query, but a few errors in it I am sure. Also there was a second questions regarding the SQL query, which we didn't have time to get to. So that was another bad thing. I am pretty sure I did not pass. But good learning experience. Less

import java.util.*; public class test { public static void main(String[] args) { String str = "abdc"; char[] arr = str.toCharArray(); HashSet set = new HashSet(); for (char i : arr ) { set.add(i); } if((set.size()) == (arr.length)) System.out.println("unique character"); else System.out.println("repetition"); } } Less

No

Show More Responses
Applied Materials

Input is a string like "AAAAABBCCAA" and it should print "5A2B2C2A". 5 being the continuous number of occurance for character 'A'. Same is with other characters also.

3 Answers

let string:String = "AAAAABBBVVVCVCAA" let characters = Array(string) var counter:Int = 1 var newArray:[String] = [String]() let lastCount = characters.count - 1 for count in 0...(characters.count - 2) { if characters[count] == characters[count + 1] { counter = counter + 1; }else { newArray.append("\(counter)\(characters[count])") counter = 1 } if lastCount == count + 1 { newArray.append("\(counter)\(characters[count])") } } print(newArray) Less

public static void main(String[] args) { String s = "AAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBCC"; Set set = new HashSet(); char b = 0; int count = 1; String newString = ""; for (int i = 0; i 0) { b = s.charAt(i - 1); } char c = s.charAt(i); if (!set.add(c)) { count++; } else { if (b != 0) { newString = newString + b + count; count = 1; } } } newString = newString + b + count; System.out.println(newString); } Less

public static void main(String[] args) { String s = "AAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBCC"; Set set = new HashSet(); char b = 0; int count = 1; String newString = ""; for (int i = 0; i 0) { b = s.charAt(i - 1); } char c = s.charAt(i); if (!set.add(c)) { count++; } else { if (b != 0) { newString = newString + b + count; count = 1; } } } newString = newString + b + count; System.out.println(newString); } Less

J.P. Morgan

Did you work on any caching technologies

2 Answers

Infinispan.

Yes. Mentioned that ehCache. Didn't go into detail.

J.P. Morgan

Tell me about Java 8 features. After I mentioned in lambda expressions etc, he asked me, what is new with interfaces in Java-8.

2 Answers

I started saying that 'default' keyword is introduced. Now a method can be declared with keyword 'default'. He interrupted me and said there is no keyword called 'default' Less

forEach() method in Iterable interface default and static methods in Interfaces Functional Interfaces and Lambda Expressions Java Stream API for Bulk Data Operations on Collections Java Time API Collection API improvements Concurrency API improvements Java IO improvements Miscellaneous Core API improvements Less

Telenor

I didn't get unexpected questions. All question were related to my technical skills and to my previous working experience

2 Answers

yes

Ok

EPAM

What if we insert with key null to a HashMap?

2 Answers

Didn't know, however, it's a very edge case, you can insert and the hashcode will be 0, so it's identifying the '0' bucket. Less

HashMap allows null as both key and value, as well. So you can associate a value to null key. However, TreeMap throws a NullPointerException if you try to put a key with null value. Less

J.P. Morgan

What is new in Java 9?

2 Answers

1. Java Platform Module System 2. Jshell: The Java Shell (Read-Eval-Print Loop) 3. Deprecate applet API 4. Updated process API 5. CompactStrings Less

I said don't know. (Interviewer was very intimidating and Java-9 specs are already out. You don't know about those). Less

Intercontinental Exchange

finally face to face. this is 6 hour long and they will decide very quick the result. First is a Java test. expect to write long java programs with pen and paper. should write code accurately no psudo code java code. some of the questions were insert node in tree, find the bug in single linked list which is looping. Heavy multi threading concurrency questions. thread contention, java 5+ concurrency API lots of multi threading in depth questions. somof the questions ae when java does context switching explain what happens in CPU level1,level2,level3 cache. how do you optmize hit miss on cpu cache with java threading. questions about DB partition sharding, network topology in cassandra, clearly Big 0 questions. java concurrency concurrency collections framework questions I was asked to write on white board function in java to recursively delete files and then in a directory tree. Java code with semi colons command and perfect syntax was expected. boundary conditions need to be handled. unit tests were asked to be written.

2 Answers

did not get it. did poorly in white boarding and other tests

Can you give more insight into 90 min test they conduct

DocASAP

Find the units of snow can be trapped in the given array of building of various heights. It is like 'Trapping Rain Water' problem in Leetcode

2 Answers

I was not able to code for it.

Check Leetcode problem - 42

J.P. Morgan

I mentioned in resume about Spring-XD. Asked what is it.

1 Answers

Explained to him, what it does. This is an open source ETL tool (much more ) from pivotal Less

Viewing 1 - 10 of 112 Interview Questions

See Interview Questions for Similar Jobs