Created
March 11, 2024 08:36
-
-
Save saleemdev/2f5ff3ec11950389c55a3ed74aafaf4f to your computer and use it in GitHub Desktop.
Interview Prompt - KNS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Read Carefully: | |
The Office of the Data Protection Commissioner(ODPCC) requires that personally identifiable information MUST be masked. | |
For example | |
John Mutua should be presented as Jo** Mu***. | |
Dates should be masked as follows | |
2000-01-25 | |
20**-0*-2* | |
Write a function in python and javascript that returns masked values in a dictionary/JSON object as below | |
first_name | |
last_name | |
date_of_birth | |
Example: Provided this prompt | |
{ | |
first_name: "Greg", | |
last_name: "Salama", | |
date_of_birth: "1990-06-01", | |
email: "[email protected]" | |
} | |
Write a function that takes this as input and returns the following: | |
{ | |
first_name: "Gr**", | |
last_name: "Sa****", | |
date_of_birth: "19**-0*-0*", | |
email: "sa**********@*****.**m" | |
} | |
Note: For emails and dates please note that the delimiters @ and - MUST remain in place | |
Use any Object oriented programming language between : Java, Python and Javascript: The last 2 are preferred. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment