The "normal" approach is to define a function which takes some kind of input and exhibits side effects but doesn't return output.
The approach here is to define a webserver which takes input in the form of a URL path and delivers output in the form of an HTTP response body. The differences are:
- the input is considered to be a string rather than an integer
- the output is returned rather than swallowed
But I don't really see that one is harder to understand than the other.
The problem can and should be solved in a handful of lines of code at most, requiring knowledge of nothing more complex than the modulus operator and simple Boolean logic.
I don't really think this is right. Saying that understanding the presented solution requires knowledge of YAML, Kubernetes, and httpbin is like saying that understanding a solution in C with printf requires knowledge of file descriptors and terminal control codes. That's stuff the solution is built on, but you don't include it in your understanding of the solution.
Ask your interview candidate how printf works, and odds are they'll be stumped. But if we don't require that in order to understand the printf solution, why do we need to understand how the primitives of the Kubernetes solution work in order to understand that solution?
- You're hiring for a DevOps position - You use kubernetes to orchestrate your system
The test you do is FizzBuzz (? because that'll help you when your cluster is on fire). Along comes someone that seems to be way way better versed in kubernetes than anyone alive.
They use exactly the tools they'll be using day in and day out for their devops role. Hell, they implement FizzBuzz AS A SERVICE with kubernetes alone. And you pass it along.
Now ofc, in a real world situation you wouldn't want a person that when asked to implement a regex spins up a cluster and you do mention you have "Go" on your stack, so the easiest way would probably be to do a Go program, the thing still remains that for what it seems they were hiring, this person would be an amazing hire? You also say, "use any language", so the person could simply have thought - "well, this is for a devops position using kubernetes, I'm going to show you how much I understand this to the point your brain will melt"
That's why I think the story is good, it can be looked through quite different angles and it does pose some questions regarding the problems we use to proxy knowledge in a given domain/tool and also how we can access in a valid way someone's knowledge within a domain/tool when, and if, we ourselves lack considerable knowledge in that domain/tool. Maybe the person you end up hiring does the normal FizzBuzz in go and in all other areas is a better "hire", or culture fit, but when Kubernetes is burning they might not know how to put off the fire.