Oracle Interview Question

Design a scheduler. First flow diagram and then I was asked to write code.