Explain Python and Systems Fundamentals
Company: Lyft
Role: Machine Learning Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Answer the following software engineering fundamentals questions:
1. A production system has become very slow. How would you detect the bottleneck, measure the problem, and improve performance?
2. A system used to behave correctly but starts crashing after repeated runs. How would you investigate and fix it?
3. In Python, what are generators and decorators?
4. Why is `with open(...)` preferred over manually opening and closing a file?
5. Compare synchronous and asynchronous execution.
6. Explain multithreading, the difference between threads and processes, and when you would choose each approach.
Quick Answer: This question evaluates understanding of production system debugging and performance analysis, reliability and resource-management issues, core Python features (generators, decorators, and context managers), and concurrency concepts including synchronous versus asynchronous execution and the trade-offs between threads and processes.