|
|
|
|
|
by searchableguy
2190 days ago
|
|
Do I get the job? defmodule Fibnoc do
def fib(0), do: []
def fib(1), do: [0]
def fib(2), do: [1 | fib(1)]
def fib(n) when n > 2 and is_number(n) do
[a, b | _] = rest = fib(n - 1)
IO.puts("a: #{a} b: #{b} rest: #{inspect(rest)}")
[a + b | rest]
end
end
Although I wouldn't call these questions a great way to assess people for the job, they are fine as a way to weed out people who can't program at all. Most high schoolers spend hours leetcoding these days. I do wonder how tough the market would be by the time I can legally work given current trends of everyone jumping into IT jobs. |
|