Backend Engineer Interview Questions

14,357 backend engineer 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 571 - 580 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 14,357 interview questions and reports from Backend engineer interviews. Prepare for your interview. Get hired. Love your job.