I need to design an online exam server for an exam like GRE in which question difficulty increases if you answer correctly and decreases if you answer wrong.Questions are multiple choice questionsDifficulty scale of question is 1-10, 1 being the easiest and 10 being  the hardest.If two continuous questions are answered wrong, decrease the  difficulty by 1 and if two questions answered right increase the  difficulty by 1.Test starts with a question of difficulty level of 4.Question carries marks equal to its difficulty.My question is Which the data structure should I use to store the questions, and best algorithms to fetch the question by its difficulty, etc. ?Currently what I'm thinking is I'll be having a double link-liststruct node {int data;node *prev;node *next;int nint MAX;};here 2 n's we need to store... one is MAX (actual size) and n is possible random size to pick questions from n - MAX we selected alreadyfor each double linked list you can add extra int data where u can storeprev link, next link, pointer to array, int Maxdata(MAX size), int n(current size)Each node is a pointer to array where list of questions for each level.if answer correct it moves next node and pick the random questions from that list else move to previous node and pick questionFor eg- lets an array is having 10 questions 1 - 10. so array size is n = 10 you know that.now you selected a random question rand() % 10 = 6 th questions.now swap the question number 6 & 10, make n-- and return the 6th question.now n = 9 so next time 10th will not be considered.random will return 1 - 9 onlyIs there any better way of doing it?
Designing online exam
design;algorithms;data structures