Skip to content

Instantly share code, notes, and snippets.

@Varnan
Last active November 2, 2017 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Varnan/cff1a0a8f084c8131a98f027b86388b5 to your computer and use it in GitHub Desktop.
Save Varnan/cff1a0a8f084c8131a98f027b86388b5 to your computer and use it in GitHub Desktop.
Python Interview Basics
REST :
Representational State Transfer
Garbage Collector:
It works by reference counting and by cycle detection.
Multi Threading:
Global Interpreter Lock (GIL)
decorator:
A decorator is essentially a callable Python object that is used to modify or extend a function or class definition.
Lamda Functions :
Lambda expressions are a shorthand technique for creating single line, anonymous functions.
g = lambda x: x*2
def f (x): return x*2
List comprehensions:
List comprehensions provide a concise syntax for creating lists.
They can also be used to create a subsequence of those elements whose members satisfy a certain condition.
In Python, list comprehensions provide an alternative to using the built-in map() and filter() functions.
Generators:
Generators are simple functions which return an iterable set of items, one at a time, in a special way.
a generator is a function that returns an object (iterator) which we can iterate over (one value at a time).
yield keyword for return , and we can use multiple yields in the function.
Generators are used either by calling the next method on the generator object or using the generator object in a for loop. In python, generator functions or just generators return generator objects.
unittest:
unittest supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework. The unittest module provides classes that make it easy to support these qualities for a set of tests.
Unicode:
Unicode is an international encoding standard that works with different languages and scripts.
UTF-8:
UTF-8 is a type of encoding, a way of storing the code points of Unicode in a byte form,
PEP 8 :
PEP 8 is a coding convention(a set of recommendations) how to write your Python code in order to make it more readable and useful for those after you
set ():
Sets stores unordered values & have no index. And unlike Tuples and Lists, Sets can have no duplicate data, It is similar to Mathematical sets
Socket :
Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while other socket reaches out to the other to form a connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment