- Please take as much time as you need.
- Feel free to use any internet sources, however please complete this exercise on your own.
- All code must be supported by tests.
- No actual database implementations are required, feel free to mock any data access you need.
- Please make sure your code follows SOLID principles.
- Please do not email us your solution. Return your code in a public github repo or file sharing website.
- Task 3 D) is a BONUS question.
Create a function which counts the number of occurrences of a given letter in a string.
Example:
Input:
'e' and "I have some cheese"Output:
5
Create a function which decides if a string is a palindrome.
Examples:
Input:
I have some cheeseOutput:
False
Input:
God saved Eva’s dogOutput:
True
Create a function which counts the number of occurrences of words from a "censored words list" in a text.
Example:
Input:
{"dog", "cat", "large"} and "I have a cat named Meow and a dog name Woof. I love the dog a lot. He is larger than a small horse."
Output: cat: 1, dog: 2, large: 1, total: 4
Create a way to censor words featured in the "censored words list" that appear in the text.
Example:
Input:
{"moew", "woof"} and "I have a cat named Meow and a dog name Woof. I love the dog a lot. He is larger than a small horse."
Output: "I have a cat named M$$w and a dog name W$$f. I love the dog a lot. He is larger than a small horse."
Create a way to censor a single word palindrome in a text.
Example:
Input:
"Anna went to vote in the election to fulfil her civic duty"Output:
"A$$a went to vote in the election to fulfil her c$$$c duty"
Come up with at least 3 different ways to provide the "censored words list" to the application. This task does not require coding, please send us 3 bullet points on how you would do this.
Thanks for your time.