Interview prep
Python Interview Questions
Python interviews mix language internals with practical data-structure work. Expect live coding plus questions about the standard library.
Questions and answers
01What is the difference between a list and a tuple in Python?
Lists are mutable and slightly heavier; tuples are immutable, hashable when their contents are hashable, and can therefore be used as dictionary keys. Interviewers usually follow up by asking where immutability helps — shared constants, cache keys and function defaults.
02How does Python manage memory?
CPython uses reference counting plus a cyclic garbage collector for reference cycles. Objects are freed as soon as their refcount hits zero, which is why holding a reference in a global or a closure is the usual cause of a leak.
03What are decorators and when would you use one?
A decorator is a callable that takes a function and returns a wrapped function. They are used for cross-cutting behaviour — timing, retries, caching, authorisation — without touching the wrapped function's body.
04Explain the GIL and how you work around it.
The Global Interpreter Lock allows only one thread to execute Python bytecode at a time. IO-bound work still benefits from threads or asyncio; CPU-bound work needs multiprocessing, native extensions or a different runtime.
05What is the difference between deep copy and shallow copy?
A shallow copy duplicates the outer container and shares references to the nested objects; a deep copy recursively duplicates everything. Mutating a nested list after a shallow copy is the classic bug this question probes.
How to answer these well
Interviewers are not grading recall — they are checking whether you've hit the failure mode the question describes. Anchor every answer to something you actually shipped or debugged with Python.
Say the trade-off out loud. "I'd use X here, but it costs Y under Z conditions" scores higher than a clean textbook definition every time.
Roles asking for Python
- Summer 2027 Software Engineering InternshipT-Mobile · Atlanta, GeorgiaonsiteentryPosted 1 min ago
- Software Engineer III - Release, STaRQ (Hybrid)CrowdStrike · USA - Redmond, WAhybridmidPosted 2 mins ago
- Sr. Engineer - Linux Sensor SDET (Hybrid)CrowdStrike · USA - Sunnyvale, CAhybridseniorPosted 2 mins ago
- Sr. Software Engineer, UI Developer Tooling (Hybrid, New York)CrowdStrike · USA - New York, NYhybridseniorPosted 2 mins ago
- Manager, Software EngineeringNike · Beaverton, OregononsitemidPosted 2 mins ago
- Embedded Software EngineerCisco · San Jose, California, USonsitemidPosted 7 mins ago
- Software Engineer (R60390 Copy)Motorola Solutions · Utah, US OffsiteonsitemidPosted 8 mins ago
- Software Engineer - Java / Python, Google Cloud / AWSMotorola Solutions · Richardson, TX (TX145)onsitemidPosted 8 mins ago
- Senior Software Engineer - Autonomous VehiclesNVIDIA · US, CA, Santa ClaraonsiteseniorPosted 11 mins ago
- Cloud Services Software EngineerNVIDIA · US, CA, Santa ClaraonsitemidPosted 11 mins ago
Related prep
- Software Engineer jobs
- Software Engineer career guide
- Data Engineer jobs
- Data Engineer career guide
- Data Scientist jobs
- Data Scientist career guide
- AI Engineer jobs
- AI Engineer career guide
- Java interview questions
- JavaScript interview questions
- React interview questions
- AWS interview questions
- Azure interview questions
- Kubernetes interview questions
- Docker interview questions
- Terraform interview questions