Pergunta de entrevista da empresa Volusion

What is a XSS & SQL injection attack and e.g. and how would you prevent it?