0% found this document useful (0 votes)
12 views2 pages

Python Interview Focused Notes

This document provides focused notes on essential Python concepts for interviews, covering topics such as Python basics, data types, functions, OOP concepts, exception handling, and memory management. It highlights the differences between mutable and immutable types, shallow and deep copies, and multithreading versus multiprocessing. Additionally, it lists important built-in functions and common interview questions to aid in quick revision for Python interviews.

Uploaded by

Brijesh KB
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Python Interview Focused Notes

This document provides focused notes on essential Python concepts for interviews, covering topics such as Python basics, data types, functions, OOP concepts, exception handling, and memory management. It highlights the differences between mutable and immutable types, shallow and deep copies, and multithreading versus multiprocessing. Additionally, it lists important built-in functions and common interview questions to aid in quick revision for Python interviews.

Uploaded by

Brijesh KB
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Interview-Focused Notes

1. Python Basics (Most Asked)


• Python is interpreted, dynamically typed, and object-oriented.

• PEP 8 – Python coding style guidelines.

• Python uses indentation instead of braces.

2. Data Types & Mutability


• Mutable: list, dict, set

• Immutable: int, float, string, tuple

• Strings are immutable – operations create new objects.

3. List vs Tuple
• List is mutable, Tuple is immutable.

• Tuple is faster and memory efficient.

• Tuples can be used as dictionary keys.

4. Shallow Copy vs Deep Copy


• Shallow copy copies references.

• Deep copy copies all nested objects.

• Use copy module for deep copy.

5. Functions & Lambda


• Functions defined using def keyword.

• Lambda functions are anonymous single-line functions.

• Arguments: positional, keyword, default, *args, **kwargs.

6. OOP Concepts
• Class, Object, Inheritance, Polymorphism, Encapsulation, Abstraction.

• __init__ is constructor method.

• self refers to current object.

7. Exception Handling
• Use try-except block.

• finally always executes.

• Custom exceptions can be created.


8. Memory Management
• Python uses automatic garbage collection.

• Reference counting is primary mechanism.

• gc module manages garbage collection.

9. Multithreading vs Multiprocessing
• GIL allows only one thread to execute Python bytecode.

• Multithreading used for I/O bound tasks.

• Multiprocessing used for CPU bound tasks.

10. Important Built-in Functions


• map(), filter(), reduce()

• zip(), enumerate()

• any(), all(), sorted()

11. File Handling


• Modes: r, w, a, rb, wb

• Use with statement to auto-close files.

12. Common Interview Questions


• Difference between == and is

• What is GIL?

• Explain decorators

• Explain generators and yield

Prepared for quick Python interview revision.

You might also like