by Andre Gloukhmantchouk
specially for RS#5
How would you design an autocomplete on google search page? You need to design it from ui to database.
I have a dirty secret - if Google stopped paying me tomorrow, I'd still come to work
by Paul Tyma
CTO & Co-Founder at Refresh, Inc.
Why are you leaving your current job? Simple - because this new job is a better opportunity.
A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction.
function isPalindrome(word) {
var _isPalindrome = false;
// Magic goes here
return _isPalindrome;
}
function isPalindrome(word) {
var _isPalindrome = false;
// Magic goes here
var _reverseWord = word.split('').reverse().join('');
// End of magic
_isPalindrome = _reverseWord == word;
return _isPalindrome;
}
Designation | Description | Defenition |
---|---|---|
f is bound from the top by g asymptotically | ||
f is bound from the bottom by g asymptotically | ||
f is bound from the bottom and the bottom by g asymptotically |
1m OpS
[
{ name: "Homer Simpson", age: 37 },
{ name: "Bart Simpson", age: 10 },
{ name: "Marge Simpson", age: 35 },
..]
var sorted = {
..
10: ["Bart Simpson",.. ],
..
35: ["Marge Simpson",.. ],
..
37: ["Homer Simpson",.. ],
..
}
(1,2), (5,3), (2,5), (6,1), (5,5) -> [1,2,5,3,2,5,6,1,5,5]
var dominoesSets = [];
function addSet(dominoes/*[1,2,5,3,2,5,6,1,5,5]*/) {
var isNew = true;
// Magic goes here
return isNew;
}
var dominoesSets = [];
var dominoesHash = {};
function getHash(dominoes) {
// Magic goes here
// Handle here next cases:
// a. [1,2,5,3,2,5,6,1,5,5] and [5,3,1,2,2,5,6,1,5,5]
// b. [1,2,5,3,2,5,6,1,5,5] and [2,1,5,3,2,5,6,1,5,5]
}
function addSet(dominoes/*[1,2,5,3,2,5,6,1,5,5]*/) {
var isNew = true, hash = getHash(dominoes);
if (!dominoesHash[hash]) {
dominoesHash[hash] = dominoes;
dominoesSets.push(dominoes);
} else {
isNew = false;
}
return isNew;
}
However...
Stay away from Design Patterns; master Value, Principles and Basics Skills first
by Naresh Jain
Co-Founder at Advanced Search for Facebook
Values (or Best Practices)
Principles
Read more: