Machine Learning Engineer Interview Questions

6,173 machine learning engineer interview questions shared by candidates

What would the classes and methods for a "Hit Point Management" system look like, that has the following functions - increment(user, value), decrement(user, value), getHitPoints(user) and killAll()? The first two methods add/subtract the user's hit points by the amount in value. getHitPoints() returns a user's hit points and killAll() sets all users' hit points to 0. What are the run times of the methods? How can you make all the methods run in O(1)? Note: If we set the hit points data structure to null, or re-initialized it to a new structure, the garbage collector still has to do the work of going through all the users.
avatar

Machine Learning Engineer

Interviewed at A Thinking Ape

4.4
Dec 30, 2017

What would the classes and methods for a "Hit Point Management" system look like, that has the following functions - increment(user, value), decrement(user, value), getHitPoints(user) and killAll()? The first two methods add/subtract the user's hit points by the amount in value. getHitPoints() returns a user's hit points and killAll() sets all users' hit points to 0. What are the run times of the methods? How can you make all the methods run in O(1)? Note: If we set the hit points data structure to null, or re-initialized it to a new structure, the garbage collector still has to do the work of going through all the users.

Viewing 5221 - 5230 interview questions

Glassdoor has 6,173 interview questions and reports from Machine learning engineer interviews. Prepare for your interview. Get hired. Love your job.