Desarrollador De Ui De Java Interview Questions

26,932 desarrollador de ui de java interview questions shared by candidates

You are given an array of words (strings) and an integer k k k. Your task is to write a function that returns the k k k longest words from the array. If there are fewer than k k k words in the array, return all the words sorted by length in descending order. If there are ties in length, return the words in alphabetical order. Input: An array of strings words[] where each string consists of lowercase and uppercase letters only. An integer k k k (1 ≤ k k k ≤ 100). Output: An array of the k k k longest words, sorted by length (and alphabetically if lengths are equal). Example: plaintextInput: words = ["apple", "banana", "kiwi", "grape", "watermelon"], k = 3 Output: ["watermelon", "banana", "apple"] Input: words = ["cat", "bat", "rat"], k = 5 Output: ["bat", "cat", "rat"] Constraints: The output array should not exceed k k k elements. You may assume that the input will always have at least one word.
avatar

Senior Java Developer

Interviewed at Apple

4.1
Apr 18, 2025

You are given an array of words (strings) and an integer k k k. Your task is to write a function that returns the k k k longest words from the array. If there are fewer than k k k words in the array, return all the words sorted by length in descending order. If there are ties in length, return the words in alphabetical order. Input: An array of strings words[] where each string consists of lowercase and uppercase letters only. An integer k k k (1 ≤ k k k ≤ 100). Output: An array of the k k k longest words, sorted by length (and alphabetically if lengths are equal). Example: plaintextInput: words = ["apple", "banana", "kiwi", "grape", "watermelon"], k = 3 Output: ["watermelon", "banana", "apple"] Input: words = ["cat", "bat", "rat"], k = 5 Output: ["bat", "cat", "rat"] Constraints: The output array should not exceed k k k elements. You may assume that the input will always have at least one word.

7.can muliple inheritan e possible in java using abstract class 8.what is o/p of below code interface a{ int i=10} interface b{ int i=5} class c a,b{ sop(i) } o/p:? 9.write code for jdbc connection in java 10.how Hashmap internally work 11.write code to retrieve elements from hashtable 12.diff between vector and arraylist 13.what is synchronization 14.what ibm websphere?is it application server or web server?why you use it? 15.diff between application server and web server 16.what is o/p of below code class a { int i=10} class b { int i=5} public class c extends a,b{ psvm{ sop(i) } }
avatar

Java Developer

Interviewed at Deloitte

3.8
Feb 8, 2016

7.can muliple inheritan e possible in java using abstract class 8.what is o/p of below code interface a{ int i=10} interface b{ int i=5} class c a,b{ sop(i) } o/p:? 9.write code for jdbc connection in java 10.how Hashmap internally work 11.write code to retrieve elements from hashtable 12.diff between vector and arraylist 13.what is synchronization 14.what ibm websphere?is it application server or web server?why you use it? 15.diff between application server and web server 16.what is o/p of below code class a { int i=10} class b { int i=5} public class c extends a,b{ psvm{ sop(i) } }

Viewing 2201 - 2210 interview questions

Glassdoor has 26,932 interview questions and reports from Desarrollador de ui de java interviews. Prepare for your interview. Get hired. Love your job.