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
- Senior Software Engineer, System Validation - EDA InfrastructureNVIDIA · US, CA, Santa ClarahybridseniorPosted 16 mins ago
- Senior Storage Software Engineer - DGX CloudNVIDIA · US, CA, Santa ClaraonsiteseniorPosted 16 mins ago
- Senior Software Engineer, Capacity Management - DGX CloudNVIDIA · US, CA, Santa ClaraonsiteseniorPosted 16 mins ago
- System Software Engineer - CUDA ChipsNVIDIA · US, CA, Santa ClaraonsitemidPosted 16 mins ago
- Senior Software Engineer, AI FrameworksNVIDIA · US, CA, Santa ClaraonsiteseniorPosted 16 mins ago
- Lead Java Software EngineerCVS · Work At Home-ConnecticutonsiteleadPosted 32 mins ago
- Staff Software Engineer - JavaCVS · RI - WoonsocketonsitestaffPosted 32 mins ago
- Embedded Linux Software Engineer – Robotics Platform (DeviceOS)Anduril · Costa Mesa, California, United StatesonsitemidQuick applyPosted 2 hours ago
- Infrastructure Software Engineer, Active ClearanceAnduril · Costa Mesa, California, United States; Seattle, Washington, United States; Washington, District of Columbia, United StatesonsitemidQuick applyPosted 3 hours ago
- Frontend Software EngineerAnduril · Costa Mesa, California, United StatesonsitemidQuick applyPosted 3 hours 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