Skip to content

iOS Quiz Challenge - João Marcus - #220

Open
kiyo92 wants to merge 13 commits into
dynamox-s-a:mainfrom
kiyo92:joao-marcus-dionisio
Open

iOS Quiz Challenge - João Marcus#220
kiyo92 wants to merge 13 commits into
dynamox-s-a:mainfrom
kiyo92:joao-marcus-dionisio

Conversation

@kiyo92

@kiyo92 kiyo92 commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Implemented the iOS Quiz Challenge app with a SwiftUI-based quiz flow, API integration, local persistence, ranking, result screen, timer-based scoring, unit tests, snapshot tests, and project documentation.

What Was Implemented

  • Nickname entry flow before starting the quiz.
  • 10-question quiz flow.
  • Question loading via GET /question.
  • Answer validation via POST /answer?questionId=$id.
  • Visual feedback for correct/incorrect answers before moving to the next question.
  • 120-second quiz timer.
  • Automatic quiz finish when the timer reaches zero.
  • Final score calculation using correctAnswers * remainingSeconds.
  • Result screen with saved score feedback and restart option.
  • Ranking screen with locally persisted best score per nickname.
  • Local persistence using UserDefaults.
  • Dependency injection for app services.
  • Feature-based architecture with Configurator, Interactor, Presenter, Router, View/ViewState, Domain, and Service layers.
  • Unit tests for main business logic.
  • Unit-style snapshot tests for key views/components.
  • README with setup, test, architecture, and product decision notes.

Product Decisions

  • The ranking stores the best score per nickname instead of every quiz attempt, providing a clearer leaderboard experience.
  • The main UI is implemented with SwiftUI.
  • Snapshot tests instantiate views/components directly with mocks/spies instead of running end-to-end UI navigation.

Testing

  • Added/updated tests for quiz flow, timer finish, scoring, persistence, result, ranking, and entry use cases.
  • Added snapshot coverage for entry, quiz options, result, and ranking views.

Notes

  • The quiz API host is https://quiz-api-bwi5hjqyaq-uc.a.run.app.
  • To simulate the error state, temporarily change the question endpoint path from question to an invalid path in QuizService.swift.

Visual Reference

image

Screenshots

image image image image image

kiyo92 added 13 commits July 13, 2026 02:19
- Adding Cocoapods
- Adding Design System module
- Creating the first component
- Creating Quiz Screen
- Creating network layer module
- Configuring dependencies for main app
- Registering network dependency
- Implementing VIP-RC architecture for Quiz View
- Creating service and use case
Fixing selectedOptionID source of truth
Creating Ranking VIP
Creating Result VIP
Storing results on userDefaults
Creating some test cases for all features of the app (TODO: Add Service layer and Navigation tests)
@felipe-silva-dynamox

Copy link
Copy Markdown

Hello João Marcus, here is our feedback on your challenge.
1 - Quiz visualization and answer submission

  • As a user, I want to load a question with a set of alternative answers, so that I can choose the one that is right.
  • As a user, I want to choose an answer for a question from a set of alternatives and submit it, so that I can know if I made the right choice.

2 - Quiz navigation

  • As a user, I want to move to the next question once I have received the result of my answer submission, so that I can get to the end of the quiz.
  • As a user, I want to know the final score for the quiz once I have submitted 10 answers, so that I could share it with friends
  • As a user I want to restart the quiz with new questions, so that I could get a new score

3 - User management

  • As a user, I want to register my name or nickname, so that different users could use the app

  • As a user, I want to save the score of every quiz I made, so that I can visualize the score of every user at all times
    Mandatory Technical Requirements

  • The application must be written in Swift

  • Use CocoaPods for dependency management

  • Use some data persistence mechanism to store players and scores

  • Use UIKit and SwiftUI for the views

  • Ensure correct business logic and behavior with automated unit tests.

Bonus Points (Optional Requirements)
1 - Best Practices & Architecture

  • Use Dependency Injection to manage the application's dependencies.
  • Use Async await/Combine for asynchronous operations.
  • Use consistent design, animations, icons, etc.
  • Divide the solution into layers of responsibility (e.g., Api, Application, Domain, Infrastructure).
  • Implement some design pattern.
  • Implement consistent error handling, with appropriate HTTP status codes (e.g. 400 for validation, 404 for not found, 500 for unexpected errors).

2 - Quality & DevOps

  • Write unit tests for the main business logic.
  • Write integration tests for the main business logic.
  • Create a README.md file with clear instructions to run the project locally (either with Docker or manually).

Evaluation Criteria

• Technical capability
Demonstrates understanding of Swift and modern iOS development patterns

• iOS knowledge
Shows good grasp of iOS fundamentals

• Project and code architecture
Clean structure with feature-based organization, but lacks comprehensive DI and design patterns

• Code reuse
Some reusable components but limited systematic reuse

• Code readability
Clear naming, consistent style, well-organized code

• Commit history
Commits with too many files and not descriptive commit messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants