Amazon data science interview questions
My quick and dirty answers are below. I&#x27;m thinking of moving jobs within the next year so I could use the practice. Can anyone do better?<p>&gt; How do you treat colinearity?<p>Throw away the redundant part of the data<p>&gt; How will you deal with unbalanced data where the ratio of negative and positive is huge?<p>This is very problem-dependent, but it&#x27;s got the potential to wreak havoc with your learning algorithms. You might get seemingly good results by e.g. always predicting positive. Think carefully about your loss function.<p>&gt; How will you decide whether a customer will buy a product today or not given the income of the customer, location where the customer lives, profession and gender? Define a machine learning algorithm for this.<p>This is a messy combination of continuous, categorical, and binary data. I&#x27;d encode the data in a vector [salary, x-y co-ords, one-hot encoding of profession, and binary indicator for gender]. Something like a random forest will probably get you most of the way there. Unusual professions could mess with the algorithm, so consider grouping by industry or averaging with a model that omits the profession data.<p>&gt; Is it useful to apply PCA to your data before SVM classification?<p>Probably, but it could be data dependent. Semi-supervised learning often improves machine learning models, and it&#x27;ll lower the dimensionality of your inputs, which will make training &#x2F; hyperparameter search far more efficient.<p>&gt; How do you compare a neural network that has one layer, one input and output to a logistic regression model?<p>Not entirely sure I understand the question, but a NN is basically just nested logistic regression, depending on the activation function.<p>&gt; From a long sorted list and a short 4 element sorted list, which algorithm will you use to search the long sorted list for 4 elements.<p>To be honest, I&#x27;d use binary search and call it a day. I realise this isn&#x27;t the answer you&#x27;re looking for.<p>&gt; How will inspect missing data and when are they important for your analysis?<p>You might try to impute the missing data from similar datapoints. Maybe use something like K nearest neighbours on the non-missing components to deduce the missing values. Got to be careful doing this though, since it could massively bias your analysis: consider using a special encoding for &quot;missing data&quot; too.<p>&gt; Estimate the probability of a disease in a particular city given that the probability of the disease on a national level is low.<p>This is a tough one, since there are so many ways to answer it. I think I&#x27;d start by writing down a list of factors that might allow a high prevalence of the disease locally despite a low prevalence nationally. Weather? Local wildlife? Proximity to major transport hubs? Then I might suggest a simple model like naive Bayes.