Mindstrong Interview Questions

Mindstrong Interview Guides

Click or hover over a slice to explore questions for that topic.
Data Structures & Algorithms
(17)
Machine Learning
(13)
Behavioral
(6)
SQL
(4)
A/B Testing
(4)

Mindstrong Interview Questions

Practice for the Mindstrong interview with these recently asked interview questions.

QuestionTopicDifficulty
Data Structures & Algorithms
Medium

Let’s say you work as a medical researcher.

You are given a dataframe of patient data containing the age of the patient and two columns, smoking and cancer, indicating if the patient is a smoker or has cancer, respectively.

Write a function, stratified_split, that splits the dataframe into train and test sets while preserving the approximate ratios for the values in a specified column (given by a col variable). Do not return the training set. Instead, return the number of columns in the training set that are in the "no" class of col

Note: Do not use scikit-learn.

Example:

Input:


print(df)
...
   age smoking cancer
0   25     yes    yes
1   32      no     no
2   10     yes     no
3   40     yes     no
4   75      no     no
5   80     yes     no
6   60     yes     no
7   60      no    yes
8   40     yes    yes
9   80     yes     no

Output:

def stratified_split(df, train_ratio=0.7, col='cancer') -> 5

The resulting dataframe was:

   age smoking cancer
1   32      no     no
3   40     yes     no
4   75      no     no
6   60     yes     no
7   60      no    yes
8   40     yes    yes
9   80     yes     no
SQL
Easy
A/B Testing
Medium
Loading pricing options

View all Mindstrong questions

Challenge

Check your skills...
How prepared are you for working at Mindstrong?

Discussion & Interview Experiences

?
There are no comments yet. Start the conversation by leaving a comment.

Discussion & Interview Experiences

There are no comments yet. Start the conversation by leaving a comment.

Jump to Discussion