Day 4 of acing and mastery of data science interview and concept.
Christine Karimi Nkoroi
As a Senior Data Scientist, I help businesses and companies design and implement impactful data and AI strategies. This drives measurable outcomes, including 20% efficiency gains ?? and 15% revenue growth ??.
1 Given an array of?words?and a?max_width?parameter, write a function?justify?to format the text such that each line has exactly?max_width?characters. Pad extra spaces?’ ‘?when necessary so that each line has exactly?max_width?characters.
Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line does not divide evenly between words, place excess spaces on the right-hand side of each line.
Note: You may assume that there is no word in?words?that is longer than?max_width
2 How would you determine if the price of a Netflix subscription is truly the deciding factor for a consumer?
3 We want to build a model to predict housing prices in the city of Seattle. We’ve scraped 100K sold listings over the past three years but found that around 20% of the listings are missing square footage data.How do we deal with the missing data to construct our model?
4 Given a list of integers called?dataset, write a function called?automatic_histogram?to automatically generate a dictionary representing a histogram of the data set with?x?bins uniformly distributed over the values.
Note: You should not include any bins that have zero values in them in your dictionary.
Note: Do NOT use?numpy?or?pandas.
Bonus: What would be an advantage of taking a bayesian approach to machine translation vs a standard frequentist one?
Happy coding !