This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A few simple question I like to ask during initial telephone screen | |
interviews, over a codesharing website (e.g. codeshare.io, codebunk.com) | |
The aim is to get an idea of how they approach and solve problems, | |
and if they have a good grasp of the language. So... | |
- it's collaborative. they can ask for help at any time. | |
- ask the candidate to explain their thought processes as | |
they code, if possible | |
- it's not important that the code is perfect (i.e. it wont be tested) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// createPollingAction() returns a thunk which continually polls, once invoked. | |
// subsequent invocations will cancel the previous poll queue. | |
const createPoller = (interval, initialDelay) => { | |
let timeoutId = null; | |
let poller = () => {}; | |
return fn => { | |
window.clearTimeout(timeoutId); | |
poller = () => { | |
timeoutId = window.setTimeout(poller, interval); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function searchBinaryTree(tree, targetValue){ | |
if(tree === null){ | |
return null; | |
} | |
if(tree.value === targetValue){ | |
return tree; | |
} | |
if(targetValue < tree.value){ | |
return searchBinaryTree(tree.left, targetValue); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function quickSort(arr = []) { | |
if (arr.length <= 1) { | |
return arr; | |
} | |
let left = [], right = [], same = []; | |
let mid = arr[Math.floor((arr.length - 1) / 2)]; | |
for (let value of arr) { | |
if (value === mid) { | |
same.push(value); | |
} else if (value < mid) { |