Questions d'entretiens - Lead java developer
129
Questions d'entretien pour Lead Java Developer partagées par les candidatsPrincipales questions d'entretien

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 réponses↳
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. Moins
↳
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"); } } Moins
↳
No

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 réponses↳
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) Moins
↳
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); } Moins
↳
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); } Moins

Did you work on any caching technologies
2 réponses↳
Infinispan.
↳
Yes. Mentioned that ehCache. Didn't go into detail.

I didn't get unexpected questions. All question were related to my technical skills and to my previous working experience
2 réponses↳
yes
↳
Ok

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 réponses↳
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' Moins
↳
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 Moins

What if we insert with key null to a HashMap?
2 réponses↳
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. Moins
↳
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. Moins

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 réponses↳
I was not able to code for it.
↳
Check Leetcode problem - 42

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 réponses↳
did not get it. did poorly in white boarding and other tests
↳
Can you give more insight into 90 min test they conduct

What is new in Java 9?
2 réponses
first round hireview is basics java, concurrency, collections, basic OO, basic sql questions. this is a recorded session so all candidates will get same questions.
1 réponses↳
I did very well next round was phone screen round