Skip to content

Instantly share code, notes, and snippets.

@jameslockwood
Last active June 10, 2018 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameslockwood/38982732a90df71dcd5841c231842a45 to your computer and use it in GitHub Desktop.
Save jameslockwood/38982732a90df71dcd5841c231842a45 to your computer and use it in GitHub Desktop.
telephone screen interview questions
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)
Each problem below (apart from the first example) is split into stages.
Initially they'll start of with a simple problem to solve, and depending on their
success, we progress them to the next stage which adds slightly
more complexity.
---------- Basic: MAX ALGO --------------
// create a function which returns the largest number in an array
// note: many ways to do this. but simplest way is const max = arr => Math.max(...arr)
---------- PEOPLE LIST -----------
------------
Step 1 (keys)
------------
{
'id1': { firstName: 'John', lastName: 'Doe', age: 30},
'id2': { firstName: 'John', lastName: 'Doe', age: 30},
...
}
// create a function which takes an object like above, and returns an array of individual items
------------
Step 2: (map)
------------
// update your code so that each item in the array has only the following properies
// - id
// - name (first and last name combine)
// - index (position in the array)
------------
Step 3: (filtering and closures)
------------
// create a *new* function that allows you stipulate the minimum the age of the people returned in the array
// - it takes a number (minimum age) as an argument
// - it returns a function that takes the original array as an argument, and returns the new data when called
------------
Step 4: (reduce)
------------
// create a *new* function which takes an array of people and returns the sum of all ages.
---------- EVENT BUS --------------
Step 1: pub sub ------------
// create an event bus. it must have the following functions:
// subscribe(eventName, handlerFunction)
Step 2: closures ------------
// update subscribe so that it returns a function which, when called, unsubscribes the event handler
----------- Soft Questions -------------
how did you get into JavaScript development / what do you like about it
how can you decide if someone is a good developer
what's the best thing you've made. (notice you've done a lot of side projects)
what makes good code
what are your thoughts on testing. TDD
if you were to create a web application now, what tools, libraries and frameworks could you choose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment