Junior Java Developer Interview Questions

3,830 junior java developer interview questions shared by candidates

You are given a string with Alphabet set B,D,U and H. This string will be considered steady if each of letter occurs only n/4 times. For Example HBDU and BBHUHDDU both are steady strings. Now your job is to make a string steady if not by replacing substring of input string and replace it with any string of the same length. It can be a empty string also. Return the length of the minimum length substring that can be replaced to make string stable EXAMPLE: Input: HBBBUBBB Output: 5 Explanation: One optimal solution is to replace BBBUB with UUDDH resulting in HUUDDHBB
avatar

Junior Java Developer

Interviewed at Bounteous x Accolite

3.4
Feb 21, 2024

You are given a string with Alphabet set B,D,U and H. This string will be considered steady if each of letter occurs only n/4 times. For Example HBDU and BBHUHDDU both are steady strings. Now your job is to make a string steady if not by replacing substring of input string and replace it with any string of the same length. It can be a empty string also. Return the length of the minimum length substring that can be replaced to make string stable EXAMPLE: Input: HBBBUBBB Output: 5 Explanation: One optimal solution is to replace BBBUB with UUDDH resulting in HUUDDHBB

Viewing 1191 - 1200 interview questions

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