Pregunta de entrevista de Printivity

Write a random function algorithm using any language or pseudocode.