Questions d'entretiens - Java developer | Glassdoor.ca

Questions d'entretiens - Java developer

412

Questions d'entretien de java developer partagées par les candidats

Le top des questions d'entretien

Trier: PertinencePopulaires Date

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].

3 réponses

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 the white space character in the regular expressions in Java?

2 réponses

What is a singleton?

2 réponses

What are you top 3 weaknesses and your top strength?

2 réponses

Are you willing to travel?

2 réponses

Questions about core java, multithreading, collection, GC, j2ee, spring, hibernate, JMS, webservice,SQL and so on. Broad, but not to deep since its first round.

2 réponses

Programming question about Stack.

2 réponses

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

2 réponses

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

1 réponse

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

1 réponse
110 de 412 Questions d'entretien d'embauche