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

Python Interview Cheat Sheet

This document is a cheat sheet for Python interview questions covering basics, intermediate, and advanced topics. It includes key concepts such as data types, decorators, GIL, and coding challenges like reversing a string and FizzBuzz. Additionally, it compares libraries and frameworks like Flask, Django, Pandas, NumPy, and SQLAlchemy.

Uploaded by

Rajasekhar
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)
4 views2 pages

Python Interview Cheat Sheet

This document is a cheat sheet for Python interview questions covering basics, intermediate, and advanced topics. It includes key concepts such as data types, decorators, GIL, and coding challenges like reversing a string and FizzBuzz. Additionally, it compares libraries and frameworks like Flask, Django, Pandas, NumPy, and SQLAlchemy.

Uploaded by

Rajasekhar
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
You are on page 1/ 2

Python Interview Questions Cheat Sheet

Basics

- Python is an interpreted, dynamically typed, high-level programming language.

- Common data types: int, float, str, bool, list, tuple, dict, set, NoneType.

- List vs Tuple: Lists are mutable, tuples are immutable.

- 'is' checks identity, '==' checks value.

- PEP 8: Style guide for Python code.

Intermediate

- *args allows variable-length positional arguments; **kwargs allows keyword arguments.

- List comprehension: [x*x for x in range(5)]

- Decorator: A function that wraps another to modify behavior.

- Shallow copy: one level deep; Deep copy: full recursive copy.

Advanced

- GIL: Global Interpreter Lock, prevents multi-threaded execution in CPython.

- Generator: Uses 'yield', returns an iterator.

- Coroutine: Generator that can consume values with send().

- MRO: Method Resolution Order for classes with multiple inheritance.

Coding Challenges

- Reverse a string: s[::-1]

- Palindrome: s == s[::-1]

- Duplicates: [i for i, c in Counter(lst).items() if c > 1]

- FizzBuzz: for i in range(1,101): print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or i)

Libraries & Frameworks


Python Interview Questions Cheat Sheet

- Flask vs Django: Flask is lightweight; Django is full-featured.

- Pandas: Used for DataFrame-based data analysis.

- NumPy: Array computing and linear algebra.

- SQLAlchemy: ORM for SQL databases.

You might also like