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
Junior Java Engineer Interview Questions
3,950 junior java engineer interview questions shared by candidates
What is the most complicated usage of Java that you know?
What is maven? NoSql Database
What is rest api? diff btn @controller & @rest controller what is @autoconfigure @controller java 8 features stream api
Can the main method of the main class be final?
1. train questions 2. time distance 3. blood relation 4. profit loss
1. What is the importance of oop's? 2. What is the use of protected? 3. Difference between ArrayList and LinkedList? 4. For a given singly LinkedList with CRUD operations describe the approach for unit tests? 5. Difference between git merge and git rebase?
what is the features of java
All about java and oops concepts
About current role and project responsibilities
Viewing 371 - 380 interview questions
See Interview Questions for Similar Jobs
Jr Java DeveloperJunior Java DeveloperJunior Java Software EngineerSoftware Java EngineerSenior Java EngineerJunior Java Developer Software EngineerJava EngineerJunior JavaJava Support AnalystDeveloper Java BackendJava Backend DeveloperProgrammer Analyst Java DeveloperSenior Java ProgrammerSoftware Engineer Java DeveloperJunior Java Web DeveloperBackend Java DeveloperJava SupportJava Application Support