ASAPP Interview Question

I was asked to write a pseudo code for beam search for natural language generation.