MAQ Software Interview Question

they asked me to write a code of snake n ladder problem