Kinaxis Interview Question

Two related to Arrays, third one was to write a function which uses Rand to generate an Integer within a specified range, fourth was to write an acceptance criteria.