Amazon Interview Question

Write code for a tree whose number of children is configurable