Make a simple Android "quiz" app. Spend 2-3 hours on it, and stop. It is OK if the app is not complete or perfect - part of the exercise is to see where you stop (if you did not finish) and what parts you chose to prioritize. We can then discuss those decisions and what you would have done with more time.
- On launch of the app, parse the JSON (included later on this page) and present the first question and available answers.
- Answers should be presented in a 2x2 grid, and not in a vertical list.
- If you are comfortable With Jetpack Compose for your UI, please use that.
- Provide a “selected” visual state for an answer when tapped (like a colored stroke around the answer, as an example). If there was already a selected answer, the prior answer should be deselected and the new answer selected.
- When pressing the submit button, provide an alert or some indication if the answer was correct or not.
- Then move on to the next question. Repeat until all questions have been answered.
- If you have time and are feeling fancy, provide a final screen indicating overall score from the quiz and a button to start over.
Provide your recruitment contact with either: A link to a public github(or similar) repo for your assignment, or a .zip file containing your full assignment.
After submitting this as an assignment I reviewed the work I completed in the allotted time and came up with the following observations of things I missed, things I'd do differently if given more time, as well as some rationale behind my decisions. I waited to commit these observations until after the accompanying interview. The initial submission, without these observations and code changes can be found on Github under the tag, initial-submission.
- I neglected to add
aspectRatio
to AnswerCard. Doing so with input1f
would have forced theAnswerCard
to be square like the mockup provided with the assignment instructions. - I developed the view to be a strict, inflexible presentation in
QuizViewFixed
. This was done to quickly build the view in the allotted time. To enable more flexibility in the presentation of theQuestion
to support questions with varying numbers of answers (not just 4), I should have usedLazyVerticalGrid
(introduced in compose in version 1.2.0) with the columns set toGridCells.Fixed(count = 2)
. Doing so reduces the amount of code and simplifies theComposable
as can be seen in my reimplementation in QuizViewGrid. - Initial work using
WindowSizeClass
was completed to provide more flexibility to address different form factors (e.g. phone, tablet, foldable, etc) and reconfiguration upon device rotation. Given time constraints, this work was discontinued and the application was locked in portrait mode inAndroidManifest.xml
. TheWindowSizeClass
work was still used to provide adaptive font sizes relative to the device type. Given more time, I would have put more work into making the application more adaptive in both orientation (portrait and landscape) and screen sizes. - Nothing was changed in the code generated theme package at app creation in
Android Studio. Colors/Styles were applied right on the affected
Composables
. Theme work should be part of any Android app. Given more time, proper development of the theme would have taken place. - The actual quiz data was provided as a JSON file.
It was loaded from disk straight into the
QuizRepository
on the main thread inonCreate
ofQuizApp
. It is more probable that the source of data would be made available from an external source retrieved using a network API call. In this case, the retrieval of quiz data and loading it inQuizRepository
should be done asynchronously, using coroutines. An observable flag that indicates whether quiz data is present could be used to force a recomposition of the starting view to a screen that allows for quiz selection once quizzes have been downloaded.