Pergunta de entrevista da empresa Fiserv

Difference between stored procedure and function? How to your indexes for performance tuning?