Question d’entretien chez Microsoft

Design an algorithm for creating a puzzle.