Hi ,
Recently i came across an interview question like how you will save and display different questions for different group of users in UI ? So have two doubts regarding this question, as follows
Requesting suggestions from everyone.
Thanks in Advance,
Pradeep
Discussion posts and replies are publicly visible
pradeepb8546 said:Is this kind of use case exists in real time?
Yes.
pradeepb8546 said:Is there any best practice/way for achieving this?
Yes, You will have to use your data base to store the Reference questions and Reference Groups (All the groups). Then create a table which would store the Question and Group mapping. Use this data to build the UI.
Thanks Konduru Chaitanya for the reply. I feel your answer is generic way of saving to DB, but is it the best practice?
pradeepb8546 said:I feel your answer is generic way of saving to DB, but is it the best practice?
Depends on the use case. If the question or the groups need to be updated time-time by a business user from a update process, then my solution will be very feasible. Many of us consider this as a best practice.
Ex: Consider a Survey or a review process that needs to be completed by employees who are in projects, there might be questions which are valid to few projects and few which are not. So this can change over a period of time and the manager is someone who would decide the questions, he should be able to make changes to these. So it should be implemented in such a way that the user is also able to add new questions or delete older question and add which groups will need to get this question in their form.