Printivity Interview Question

Write a random function algorithm using any language or pseudocode.