This repository contains 15 coding challenges to prepare you for the assessment. The main branch is protected, and changes must be submitted via pull requests. GitHub Actions will run unit tests on PR submission.
solutions.py: Implementation file with TODOs for 15 functionstest_solutions.py: Unit tests for all functions
Implement these functions in solutions.py:
mastermind: Calculate Mastermind guess resultsto_roman: Convert integer to Roman numeralbinary_search: Implement binary searchfibonacci: Calculate nth Fibonacci numberis_palindrome: Check if string is palindromemerge_sorted_arrays: Merge two sorted arraysvalidate_password: Validate password complexitycash_register: Calculate change in ZAR (R50, R20, R10, R5, R2, R1, 50c, 20c, 10c)are_anagrams: Check for anagramslongest_common_prefix: Find common prefixevaluate_expression: Evaluate arithmetic expressionfind_duplicates: Find duplicates in arrayprint_pascal_triangle: Generate Pascal's triangleprint_diamond_pattern: Generate diamond patternfactorial: Calculate factorial
Each function has a TODO comment for your implementation.
- Python 3.8+
- No external dependencies
- Clone the repository
- Create a branch:
git checkout -b your-branch-name - Implement solutions in
solutions.py - Run tests locally:
python -m unittest test_solutions.py- Commit and push your branch
- Create a pull request to main
- Pull Rquests trigger a workflow running all unit tests
- All tests must pass for Pull Request approval
- Do not modify test file
- Implement functions as specified
These challenges cover algorithms, string manipulation, pattern printing, and practical applications like currency handling.
Good luck!