tdd Interview Base

Flow:

  • Find a problem
  • Ask to solve it & prove it work
  • Connect (export/require) with test.
  • Test with edge cases
  • Ask to commit.

Example of questions to ask:

1- Write three function that compute the sum of the numbers in a given list using a for-loop, a while-loop, or recursion or ES6. (kinda old, but fun for recursion)

2 - Write a function that combines two lists by alternatively taking elements. For example: given the two lists [a, b, c] and [1, 2, 3], the function should return [a, 1, b, 2, c, 3].

3 - Prob 3, Find Fibo Number Nth.

4 - 2 object overlapping, how to get a resulting object that exclude common item. Ex: So you want {a: 1 b: 2} vs {a: 4, c: 7} to return {b: 2, c: 7}. (a being common & excluded)

5 - How would you design a Tic Tac Toe game? & Maybe implement part of it.

6 - Fun one: (Multiply) return an array that multiply all value but itself.

Remember: Always start small & add edge cases.