ToptalRole: AI EngineerSeptember 2026
Interview question
Implement a Python/pandas data-modeling exercise using the supplied hospital-patient dataset. Patients were checked for diabetes and TSH (thyrotropic hormone). Features include patient ID; height, weight, gender and age (in days or years); arterial pressure with high and low values in the pressure field; cholesterol and glucose level tiers; smoking, alcohol consumption (alco) and regular physical activity (active); diabetes diagnosis (diabetes == 1); and TSH value. Load the datasets, merge the two parts of the training dataset, convert gender to only "f" or "m", apply min-max scaling to numeric columns, draw a scatter plot of high versus low pressure, and predict the diabetes column using a tree model with a target accuracy of 0.98. The provided data includes train-info, train-analysis, test-info and test-analysis files, plus a Python template. Complete the exercise in 30 minutes; documentation and syntax lookup are allowed, but generated full solutions are not.
Follow-up questions
- What does your high-versus-low-pressure scatter plot show, and how would you handle its extreme outliers?
- What steps would you take next to finish training and evaluating the model?
- Which other classifiers could work for this dataset besides a decision tree?