Implemented below mentioned changes :

1. Time, No of questions are dynamin and can be assigned directly while defining Quiz object.
2. Break the large functions into multiple smaller functions.
3. Optimized the code.