Python Coding Interview Practice: Hashing, Pointers, and Windows
Real Python · 2026年11月10日
AI 摘要 AI 生成,可能有误
本文倡导围绕三种常见解题模式进行 Python 编码面试练习:哈希、双指针和滑动窗口。文章鼓励读者单独练习每种模式,学会为混合问题选择合适的方法,并能清晰地阐述解决方案的时间和空间复杂度。此外,还提供免费的 Tech Career Story Kit(科技职业故事工具包),内含职业模板、快速参考指南和面试准备资源,拥有免费的 Real Python 账户即可获取。
Build your coding interview skills with hashing, two pointers, and sliding windows. Practice each pattern, choose approaches in mixed problems, and explain the time and space costs of your solutions.
Free Kit: Getting ready for interviews? Get the Tech Career Story Kit with career folder templates, a quick reference, and quizzes, including a folder for your interview prep notes. You only need a free Real Python account.
AI 摘要Real Python ran GLM 5.4 through an informal five-task benchmark of everyday Python skills, including using the turtle module to draw a python reading a book, which the model completed successfully with 172 lines of code. Across the tasks, the model wrote Python at a 3.10 level with some 3.11 features, avoided all ten unrelated edits in a cleanup test, correctly identified that itertools.flatten() doesn't exist, and cost $0.16 total. The full results are available on Real Python's website as part of their ongoing AI benchmark series.
AI 摘要This article presents Real Python's informal AI benchmark of Amazon Ergo, which was tasked with drawing a python reading a book using Python's turtle module. Across five tasks, the model drew the snake with 3,205 drawing commands, used modern Python 3.11 features, correctly flagged that itertools.flatten() doesn't exist, and made zero unnecessary edits to a script. The full run took about 2.5 minutes and cost $0.18, with the model reporting Python 3.15.1 as the newest release.
AI 摘要This article introduces a quiz that tests comprehension of a tutorial on building an AI agent from scratch in Python. The quiz revisits core concepts that turn a language model into an agent, including the harness, the conversation context, the tools the model can request, and the agentic loop that chains tool calls until an answer is reached.
AI 摘要This tutorial teaches readers how to implement Python microservices that communicate with each other using gRPC, explaining why splitting a monolithic application into independently deployed services offers benefits like modularity, flexibility, and robustness. It covers building middleware for monitoring, performing unit and integration tests, and deploying microservices to a production environment with Kubernetes, using a web app and a Recommendations microservice as a running example.
AI 摘要The article introduces Altair, a declarative Python visualization library where users describe what their data means—such as which columns map to axes, colors, and interactivity—and the library generates the chart, unlike Matplotlib's approach of scripting every visual detail. Altair produces web-native charts (HTML and JavaScript) that render in notebooks and can be saved as standalone files or embedded in web pages, making it ideal for interactive exploratory analysis. It's not a replacement for Matplotlib, which remains the better choice for pixel-precise publication figures or 3D plots, so the two libraries serve complementary use cases.