## Amazon Interview Question

Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````public bool BinaryPermutation(int k, string binaryStr){
List<string> combinations = new List<string>();
for(int i=0;i<Math.Pow(2,k);i++){
return false;
}
return true;``````

}

Comment hidden because of low score. Click to expand.
0
of 0 vote

JS Solution:

``````function getTopBooks(friends) {
const friends = {
2: [10,20,30,40,50,60],
3: [10,70,50],
4: [20, 10, 40, 50],
5: [20, 30]
};
const book_count = {};
Object.keys(friends).map(function(key) {
let bookList = friends[key];
bookList.forEach(bookElement => {
book_count[bookElement] = book_count[bookElement] ? book_count[bookElement] + 1 : 1;
});
});
let keysSorted = Object.keys(book_count).sort(function(a,b){return book_count[b] - book_count[a]});
return keysSorted.slice(0, 10)
}``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````function getTopBooks(friends) {
const friends = {
2: [10,20,30,40,50,60],
3: [10,70,50],
4: [20, 10, 40, 50],
5: [20, 30]
};
const book_count = {};
Object.keys(friends).map(function(key) {
let bookList = friends[key];
bookList.forEach(bookElement => {
book_count[bookElement] = book_count[bookElement] ? book_count[bookElement] + 1 : 1;
});
});
let keysSorted = Object.keys(book_count).sort(function(a,b){return book_count[b] - book_count[a]});
return keysSorted.slice(0, 10)
}``````

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.