# Java developer Interview Questions

java developer interview questions shared by candidates

## Top Interview Questions

Given an array of pairs of numbers, simplify the numbers. The pairs represent ranges, and the result is a simplified version of these pairs. So [1,5],[3,7] should result in [1,7]. Sort the pairs by the left number, and loop through combining if they overlap. Make sure to check the results, as multiple pairs can combine together to form a big range. var x = [[6,5],[3,7],[6,2],[3,20]]//array of pair of numbers; //Function returns smaller of two values var smaller = function(n){ if (n[0] n[1]) { return n[0] } else {return n[1]} } //functions to sort array in ascending order var sort = function (a,b){ return a - b; } function simplifyRange(x,smaller,bigger){ var finalarray = []; var minarray = x.map(function(n){ return smaller(n); }); var maxarray = x.map(function(n){ return bigger(n); }); minarray = minarray.sort(sort); maxarray = maxarray.sort(sort); finalarray.push(minarray[0],maxarray[maxarray.length-1]) return finalarray } console.log(simplifyRange(x,smaller,bigger)); var x = [[6,5],[3,7],[6,2],[3,20]]//array of pair of numbers; //Function returns smaller of two values var smaller = function(n){ if (n[0] n[1]) { return n[0] } else {return n[1]} } //functions to sort array in ascending order var sort = function (a,b){ return a - b; } function simplifyRange(x,smaller,bigger){ var finalarray = []; var minarray = x.map(function(n){ return smaller(n); }); var maxarray = x.map(function(n){ return bigger(n); }); minarray = minarray.sort(sort); maxarray = maxarray.sort(sort); finalarray.push(minarray[0],maxarray[maxarray.length-1]) return finalarray } console.log(simplifyRange(x,smaller,bigger)); |

What is a singleton? |

What are you top 3 weaknesses and your top strength? |

Are you willing to travel? |

Typical Java technical questions. Like how to generate a deck of cards and then shuffle them. |

Programming question about Stack. |

-Tell me about a project that you are proud of. What challenges did you face while you were dealing with the project? |

The interview question was about implementing a game: 4-connected disks game! |

Is Java pass-by-reference or pass-by-value? |

Heap meaning, some patterns, class path definition, if I face a situation with a complicated colleague, very basic questions, not challenging at all. |

**1**–

**10**of

**407**Interview Questions