5 ms·
Ask HN: Have a code performance-oriented interview Monday. Tips?
I have an interview on Monday, which, according to some advice from previous interviewees and the recruiter, will involve taking some existing Python code and some existing SQL code, and then use libraries like numpy and pandas to 'improve the performance' (for the Python section) and probably just standard SQL performance questions for the SQL part.
I mostly use the libraries in their desired manner and so not sure if it will be like a "terrible performance pandas code" and then try to locate how it is mis-using the APIs, or if it is just plain vanilla python code and then figuring out how to improve it with the library APIs.
For now I am pretty focused on preparing for the Python aspect.
I have a pretty workable understanding of vectorization, but are there any other things of note that you would want a candidate to know specifically in terms of improving the performance of running code in the context of these specific tools in the toolbelt?
What would you make sure to cover if you were the interviewer, asking a candidate to demonstrate understanding of these libraries in the context of writing performance-oriented code?
- strangattractor 4y agoSounds like a dumb interview. Are you sure you want to work there? How can you do any of this if you have never used the libraries. Else it must be so simple and obvious (at least to the interviewer) that they think it is a no brainer. Likely they want you to unwind some loops and use some of Pandas Vectorized routines. But as this article states https://pythonspeed.com/articles/pandas-vectorization/ https://pythonspeed.com/articles/pandas-vectorization/ that is not always easy to do. It takes a lot of work to get good performance. Improve SQL performance - which one? Mysql, Postgres, etc. Sounds like an interview designed by an engineer.
- 2143 4y agoI don't have advice, but once the interview is over come back here to tell us how it went so that it'll be useful to the next person. Good luck!
- freemint 4y agoHow did it go?
- arthurcolle 4y agoIt was pretty easy. The Python question was a bit of client code calling a helper to generate a object instance that returns some data and you had to fix it up to cache the data and make it more performant. Then a basic SQL question with two joins, a group by and some aggregations, and the third question that we didn't get to in time was doing the same thing as question 2 but in pandas. I passed the interview, have a third round (2.5 hours) later this week also involving coding. Glad I practiced the SQL more than I had planned, I might have gotten some syntax messed up but the interviewer was very reasonable and when I reached for a LEFT JOIN just like "Google it if you want to just check something - its fine" Overall felt like a totally reasonable interview. To the other commenter harping over the differences across SQL flavors - this is pretty trivial, I'm sure most people would be forgiving if you used Oracle SQL vs PSQL, etc...
- freemint 4y agoCongrats! Cheers.