Pergunta de entrevista da empresa IFDC

1)forward and backward pattern question