Start by clarifying the code's purpose and constraints, then systematically review readability, correctness, performance, and scalability. For each area, identify concrete issues and propose actionable improvements, prioritizing high-impact changes and discussing trade-offs.
Pro tip: Frame improvements in terms of business impact—e.g., how vectorization reduces latency or caching cuts costs—and acknowledge trade-offs like memory vs. speed to show engineering maturity.
Ask about data volume, latency requirements, and deployment environment to tailor your review. This ensures your suggestions are relevant and prioritized.
Check naming, modularity, documentation, and adherence to PEP 8. Suggest refactoring into functions/classes and adding type hints for clarity.
Look for bugs, unhandled exceptions, and incorrect assumptions (e.g., coordinate systems, null values). Recommend unit tests and validation.
Identify bottlenecks like loops over large datasets, inefficient data structures, or repeated I/O. Propose vectorization (NumPy/Pandas), caching, and parallelization.
Suggest specific changes (e.g., use GeoPandas, spatial indexes, LRU cache) and discuss trade-offs (memory vs. speed, complexity vs. gain).
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.