Backend Developer Interview Questions

9,176 backend developer interview questions shared by candidates

Consider the following series of binary numbers: 11, 101, 110, 1001, 1010, 1100,... All of these numbers have the same count of 1s. Your job is to write a function that will accept the count of 1s, say k, and another number N and return the binary string of Nth number with k 1s in it. For example for k = 2 and N= 5, this function should return 1010. Your function signature should be similar to: String getNthBinaryNumberWithKOnes(int k, int N)
avatar

Backend Developer

Interviewed at Ekanek Networks

2.5
Nov 9, 2020

Consider the following series of binary numbers: 11, 101, 110, 1001, 1010, 1100,... All of these numbers have the same count of 1s. Your job is to write a function that will accept the count of 1s, say k, and another number N and return the binary string of Nth number with k 1s in it. For example for k = 2 and N= 5, this function should return 1010. Your function signature should be similar to: String getNthBinaryNumberWithKOnes(int k, int N)

Viewing 381 - 390 interview questions

Glassdoor has 9,176 interview questions and reports from Backend developer interviews. Prepare for your interview. Get hired. Love your job.