Summit Bank interview question

Write a recursive function to accept and reject objects based on type with child objects.