1.6 KiB
1.6 KiB
IBM Data Scientist Interview
There are several types of questions they might ask.
This is a good website to check out to try to prep for the interview.
String Mapping
algorithms
Easy
Given two strings, string1
and string2
, write a function str_map
to determine if there exists a one-to-one correspondence (bijection) between the characters of string1
and string2
.
For the two strings, our correspondence must be between characters in the same position/index.
Example 1:
Input:
string1 = 'qwe'
string2 = 'asd'
string_map(string1, string2) == True
# q = a, w = s, and e = d
Example 2:
Input:
string1 = 'donut'
string2 = 'fatty'
string_map(string1, string2) == False
# cannot map two distinct characters to two equal characters
Example 3:
Input:
string1 = 'enemy'
string2 = 'enemy'
string_map(string1, string2) == True
# there exists a one-to-one correspondence between equivalent strings
Example 4:
Input:
string1 = 'enemy'
string2 = 'ymene'
string_map(string1, string2) == False
# since our correspondence must be between characters of the same index, this case returns 'False' as we must map e = y AND e = e
Total Transactions
- a good SQL Hackerrank article via Medium
How would you deal with outliers when training a model?