Skip to contentSkip to content
Verified credentials. On-chain. Forever.Learn more
Cover image for Convert an Imperative Recommendation Service to Pure Functional Style
Code

Convert an Imperative Recommendation Service to Pure Functional Style

FreeVerified credential3 weeksIntermediate

Overview

What this challenge is about.

Take the Python ranking module (around 900 lines). Identify side-effects (DB reads, cache lookups, logging, time) and lift them to the boundary. Rewrite the ranking core in Scala 3 as pure functions over immutable case classes. Express side-effecting dependencies as function parameters (Reader pattern) so tests need no mocks. Cover all ranking edge cases with unit tests that take no test doubles. Deliver Scala source, mock-free test suite, and a 6-page writeup on the refactor patterns applied (separation of pure core from imperative shell).

CredentialBlockchain-anchored
ShareableLinkedIn-ready
LanguageEnglish
PaceSelf-paced

The Brief

What you'll do, and what you'll demonstrate.

Rewrite a recommendation-ranking module from imperative Python to pure-functional Scala with mock-free tests, demonstrating the functional-core/imperative-shell pattern.

Earning criteria — what you'll demonstrate

  • Separate a pure functional core from imperative shell
  • Apply the Reader pattern for dependency injection without DI frameworks
  • Write a test suite that needs no mocks because the code has no hidden dependencies
  • Communicate refactor patterns clearly to a Python-native team

Program Fit

Where this fits in your program.

Sharpens the same skills your degree expects you to demonstrate.

Skills

Skills you'll demonstrate.

Each one shows up on your verified credential.

Careers

Roles this prepares you for.

Real titles. Real skill bridges. Pick the one closest to your trajectory.

Career mappings coming soon.

One more thing

You can put a credential on your CV by Friday.