Junior Java Engineer Interview Questions

3,951 junior java engineer interview questions shared by candidates

01. You are given a function, int Distance(int Ax, int Ay, int Bx, int By); The function accepts the coordinates of truck A(Ax, Ay) and the coordinates of truck B(Bx, By), as input. The office is at location (0, 0). Implement the function to determine which truck is closer to the office by comparing the square of their distances. Return the square of the distance of the truck which is closer to the office. Square of distance between two points having coordinates (x, y) and (0, 0): (Distance) [x²+ y²] = 82645-3997956 02. 03. Note: D •No need to compute the square root of the distances of trucks A and B from the office. • If both trucks are at equal distance, return square of distance of either truck. Example: Input: 12 5 12 9 Output: 169 Explanation: (Distance of truck A)² = (Ax² + Ay²] = [12²+52) = (144 +25) = 169 (Distance of truck B)2= [Bx²+ By2] = [122+92] = (144 +81) = 225 Since, (169225), hence the output is 169. Sample input 6 8 3 4 sample output 25
avatar

Junior Java Developer

Interviewed at Payoda

4.6
May 2, 2023

01. You are given a function, int Distance(int Ax, int Ay, int Bx, int By); The function accepts the coordinates of truck A(Ax, Ay) and the coordinates of truck B(Bx, By), as input. The office is at location (0, 0). Implement the function to determine which truck is closer to the office by comparing the square of their distances. Return the square of the distance of the truck which is closer to the office. Square of distance between two points having coordinates (x, y) and (0, 0): (Distance) [x²+ y²] = 82645-3997956 02. 03. Note: D •No need to compute the square root of the distances of trucks A and B from the office. • If both trucks are at equal distance, return square of distance of either truck. Example: Input: 12 5 12 9 Output: 169 Explanation: (Distance of truck A)² = (Ax² + Ay²] = [12²+52) = (144 +25) = 169 (Distance of truck B)2= [Bx²+ By2] = [122+92] = (144 +81) = 225 Since, (169225), hence the output is 169. Sample input 6 8 3 4 sample output 25

"We're looking to implement a 3D traversable plane system interface. One that could demonstrate and display individual parts, with specific attention to detail on damage or expiration dates. How would you implement this service in broad terms?"

Junior Java Developer

Interviewed at CommSoft

4.2
Feb 5, 2019

"We're looking to implement a 3D traversable plane system interface. One that could demonstrate and display individual parts, with specific attention to detail on damage or expiration dates. How would you implement this service in broad terms?"

The home work ask to write 3 different implementation to a Data Structure supporting only push and PopMax. The first implementation is for one that will be called push most frequently and popMax very rare, The second is for one that will be called this method in equal frequency, And the third is an opposite to the first. The main demand is that if one method call more frequent that the other than it must be faster (and vice reverse)
avatar

Junior Java Developer

Interviewed at Softimize

3.7
Aug 1, 2019

The home work ask to write 3 different implementation to a Data Structure supporting only push and PopMax. The first implementation is for one that will be called push most frequently and popMax very rare, The second is for one that will be called this method in equal frequency, And the third is an opposite to the first. The main demand is that if one method call more frequent that the other than it must be faster (and vice reverse)

Viewing 381 - 390 interview questions

Glassdoor has 3,951 interview questions and reports from Junior java engineer interviews. Prepare for your interview. Get hired. Love your job.