Skip to content

Instantly share code, notes, and snippets.

View PrudhviVajja's full-sized avatar
🦋
ButterFly Effect ...!

Star Boy PrudhviVajja

🦋
ButterFly Effect ...!
View GitHub Profile
@PrudhviVajja
PrudhviVajja / AmazonSDE.md
Last active August 22, 2020 08:35
Amazon SDE Questions

This is a list of most frequently asked coding questions for Amazon SDE roles.

Let's get started.

Merge K sorted lists

Leetcode Link

def mergeKLists(self, lists: List[ListNode]) -> ListNode:
Supervised Unsupervised RL DeepLearning
XGBoost Clustering Model Free RL-TRPO-PPO-A3C CNN
Linear Regression K-Means PG NN
Logistic Regression Hierarchical clustering Q-learning -DQN RNN
SVM Fuzzy C-Means QR-DQN LSTM
Desicion Trees PCA C51 R-CNN
Random Forests SVD HER GANS
LightGBM ICA Model Based RL Faster-RCNN
KNN Cyclic-GANS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PrudhviVajja
PrudhviVajja / simpledecorator.py
Created November 10, 2020 08:34
SimpleDecorator
def func_name_printer(func):
def wrapper(*args):
print("Function that started running is " + func.__name__)
func(*args)
return wrapper
def add(*args):
tot_sum = 0
for arg in args:
tot_sum += arg
@PrudhviVajja
PrudhviVajja / interdecorator.py
Created November 10, 2020 08:56
python-decorators
def func_name_printer(func):
def wrapper(*args):
print("Function that started running is " + func.__name__)
func(*args)
return wrapper
@func_name_printer
def add(*args):
tot_sum = 0
for arg in args:
@PrudhviVajja
PrudhviVajja / returndecorator.py
Last active November 20, 2020 21:50
Return From Decorator
from functools import wraps
def func_name_printer(func):
@wraps(func)
def wrapper(*args):
"""Prints the Name of the function.
"""
print("Function that started running is " + func.__name__)
result = func(*args)
return result # Extra Return
@PrudhviVajja
PrudhviVajja / timeitdecorator.py
Created November 11, 2020 01:23
Timer Decorator
from functools import wraps
import time
def timeit(func):
@wraps(func)
def wrapper(*args, **kwargs):
print("Tracking function: " + func.__name__ + "()")
start = time.time()
func(*args, **kwargs)
end = time.time()
@PrudhviVajja
PrudhviVajja / classmethod_example.py
Last active November 11, 2020 03:56
Classmethod Python decorator
class Datatypes():
def __init__(self, *args):
self.args = list(args[0])
def __call__(self):
print(self.args)
@classmethod
def from_list(cls, arglist):
args = tuple(arglist)
@PrudhviVajja
PrudhviVajja / property_decorator.py
Created November 11, 2020 07:51
property-decorator python
class Storage:
"""
MaxLimit of storage is 100
"""
def __init__(self, maxlimit=0):
self.limit = 100
self.maxlimit = maxlimit
@property
def maxlimit(self):
@PrudhviVajja
PrudhviVajja / staticmethod.py
Created November 20, 2020 22:30
static decorator - python
class Multiply:
def __init__(self, numbers):
self.numbers = numbers
def __call__(self):
print(f"multiply {self.numbers}")
self.checker(self.numbers)
self.result = 1
for num in self.numbers:
self.result *= num