How to customize exercise style for using question answers in book auto numbered

I am new to LaTeX and trying to compile several questions and answers for a book. I would be using question answer after a certain section or as per choice anywhere in the document.

So, I want the questions & answer to be auto-numbered. the numbering should reset once I use another set of exercise at some other section of the document. My sample design is as provided in the image

The MWE may be as follows

%The colour and font size of the text should be customizable as an option red colour to be used for font% %The questions and answers are are grouped together for each question and there are various types of question%

%Please note I already have tcolourbox for labeling and referencing so title exercise 1.1 etc. not needed. I only this this question and answer listing so that I able to use them as where I like. No need to link to any section or chapter % as I already have the colorbox code for that inside which i will put his code.%%

\documentclass[hidelinks,11pt]{book}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{exercise}
\usepackage{xsim}
\usepackage{blindtext}
\usepackage[english]{babel}

\begin{document}

{\noindent \textbf \LARGE  This is one option of one by one question answer}\bigskip

{\noindent \textbf {Question 1.}} Which if the following is a secondary memory Devices.?\hfill \break
(a) keyboard    (b) Monitor (c) Hard Disk   (d) SMPS \hfill \break
{\textbf {Answer 1.}} (c) Hard Disk.     \vspace{2\baselineskip} %used for skiping line for next question visibility

{\noindent \textbf {Question 2.}} Recently deleted files are stored in\hfill \break
(a) Recycle bin (b) Taskbar (c) My computer (d) desktop \hfill \break
{\textbf {Answer 2.}} ( a) Recycle bin.      \vspace{2\baselineskip}

{ \noindent \textbf {Question 3.}} What is RAM  \hfill \break
{\noindent \textbf {Answer 3.}} RAM is Random Acess Memory.  \vspace{2\baselineskip}

{\noindent \textbf {Question 4.}} What is ROM  \hfill \break
{\noindent \textbf {Answer 4.}} ROM is Read Only Memory.  \vspace{2\baselineskip} \hfill \break

{\noindent \textbf \LARGE This is 2nd  option of grouping question and snwer seperately } \bigskip

{\textbf \LARGE {Questions}} \par

{\noindent \textbf {\underline {A. MCQ}}}\hfill \break

{\noindent \textbf {Question 1.}} Which if the following is a secondary memory Devices.?\hfill \break
(a) keyboard    (b) Monitor (c) Hard Disk       (d) SMPS   \hfill \break

{\noindent \textbf {Question 2.}} Recently deleted files are stored in\hfill \break
(a) Recycle bin (b) Taskbar (c) My computer (d) desktop     \hfill \break

{\noindent \textbf {\underline{B. Very Short Questions}}} \hfill \break
{\noindent \textbf {Question 3.}} What is RAM \hfill \break \par
{\noindent \textbf {\underline{C. Short Questions}}}\hfill \break
{\noindent \textbf {Question 4.}} What is ROM and its function?  \hfill \break \par
{\noindent \textbf \LARGE Answers}\par  \bigskip \par
{\noindent \textbf  {\underline{A. MCQ}}}\par
{\noindent \textbf {Answer 1.}} (c) Hard Disk.\hfill \break
{\noindent \textbf {Answer 2.}} ( a) Recycle bin.\hfill \break \par
{\noindent \textbf {\underline{ B. Very Short Questions}}}\par
{\noindent \textbf {Answer 3.}} RAM is Random Acess Memory.\hfill \break \par
{\noindent \textbf  {\underline{C. Short Questions}}}  \par
\blindtext

\end{document}

• Can anyone guide me on use of package xsim. I find it very new and from the documentation, it seems to have so many customizable options. But the programming code seems to be tough for me as a beginner to design this as per my need. – Deb bijan Aug 2 '18 at 14:35

Since you explicitly ask for a xsim solution in the comments:

Can anyone guide me on use of package xsim.

Here is a quick example showing the basic setup from your MWE:

\documentclass{article}
\usepackage{xsim}

\DeclareExerciseProperty{mc}
\newcommand*\correct[1]{%
#1%
}

\xsimsetup{
% uncomment if you want the answer directly after the questions:
% solution/print = true ,
exercise/name = Question ,
exercise/template = runin ,
solution/template = runin ,
}
\renewcommand*\theexercise{\arabic{exercise}.}

\begin{document}

\begin{exercise}
Which if the following is a secondary memory Devices?
\end{exercise}
\begin{solution}
\end{solution}

\begin{exercise}
Recently deleted files are stored in
\end{exercise}
\begin{solution}
\end{solution}

\begin{exercise}
What is RAM?
\end{exercise}
\begin{solution}
RAM is Random Acess Memory.
\end{solution}

\begin{exercise}
What is ROM?
\end{exercise}
\begin{solution}