Implement type AST and infer generics | OpenAI Coding Question