It could be many things. Your solution may have worked but that is only a small portion of the task. When we were hiring ages ago we'd look at style, formatting, structure, etc.
This is especially true for a small company. The place I use to work at was small with only a handful developers that were really passionate and opinionated. We often had discussions about simple indentation or placement of a bracket in code that could go for hours. When we hired people it was important they fit in into this culture.