Taro Logo

Senior Java Developer Interview Experience - Gurgaon, Haryana

April 1, 2025
Negative ExperienceGot Offer

Process

  1. Programming Pre-assessment:

Code-pen based coding problem. 2 problems. Moderate to high difficulty level. Dynamic programming and sliding window-based problems.

  1. Technical Interviews:

A. Coding round (dynamic programming and sorting based).

B. System design: How would you store files in a system where millions of photos are uploading? Basically, design a high-performance file storage system.

Questions

Given a list of houses, each painted with one of three colors, you want to minimize the cost of painting all the houses such that no two adjacent houses have the same color. You are provided with a 2D array where each element represents the cost of painting a house with a specific color. How can you implement a Java program to calculate the minimum cost to paint all houses while adhering to the color restriction?

You are given an array of words (strings) and an integer k. Your task is to write a function that returns the k longest words from the array. If there are fewer than 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 (1 ≤ k ≤ 100).

Output:

An array of the k longest words, sorted by length (and alphabetically if lengths are equal).

Example:

Input: 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 elements.
  • You may assume that the input will always have at least one word.

Was this helpful?

Interview Statistics

The following metrics were computed from 1 interview experience for the Apple Senior Java Developer role in Gurgaon, Haryana.

Success Rate

0%
Pass Rate

Apple's interview process for their Senior Java Developer roles in Gurgaon, Haryana is extremely selective, failing the vast majority of engineers.

Experience Rating

Positive0%
Neutral0%
Negative100%

Candidates reported having very negative feelings for Apple's Senior Java Developer interview process in Gurgaon, Haryana.

Apple Work Experiences