This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
You are given a set of log files in the format below. | |
Write a function that will return a resource with maximum number of hits in any 5 minute time frame. | |
You should return hits count and resource name. | |
""" | |
log = [ | |
["2", "user_1", "resource_1"], | |
["130", "user_1", "resource_1"], | |
["355", "user_1", "resource_2"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# Definition for a Node. | |
class Node: | |
def __init__(self, val, left=None, right=None): | |
self.val = val | |
self.left = left # prev | |
self.right = right # next | |
""" | |
""" | |
Approach: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict, defaultdict | |
def add_tags(obj, string): | |
# remember the index of each element | |
indexes = {k: v for k, v in enumerate(string)} | |
# formatting | |
formatting = defaultdict(list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
class FileObject: | |
def __init__(self, name): | |
self.content = None | |
self.name = name | |
self.children = [] | |
class FileSystem: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HitCounter: | |
def __init__(self): | |
self.counters = dict() | |
def hit(self, timestamp: int) -> None: | |
self.counters[timestamp] = self.counters.get(timestamp, 0) + 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
class Codec: | |
def serialize(self, root): | |
"""Encodes a tree to a single string. | |
:type root: TreeNode | |
:rtype: str | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sankeyDraw( | |
{ | |
"nodes": [ | |
{"name": "Improve CX Flow"}, | |
{"name": "Nevermind Response"}, | |
{"name": "Download Resources"}, | |
{"name": "Our Amazing Customers"}, | |
{"name": "Last Response"}, | |
{"name": "Emoji Response"}, | |
{"name": "Greeting"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script> | |
<script type="text/javascript" src="./sankey.js"></script> | |
<title>Sankey Diagram</title> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"nodes": [{"name": "Improve CX Flow"}, {"name": "Nevermind Response"}, {"name": "Download Resources"}, {"name": "Our Amazing Customers"}, {"name": "Last Response"}, {"name": "Emoji Response"}, {"name": "Greeting"}, {"name": "Abandoned"}, {"name": "About Ada"}, {"name": "Customers"}, {"name": "Customer's Bot On Site"}, {"name": "Mike Murchison"}, {"name": "David Hariri"}, {"name": "How much can I save"}, {"name": "Ada in the Press"}, {"name": "Positive Review"}, {"name": "Careers"}, {"name": "Mikael"}, {"name": "1000-5000"}, {"name": "Wolfram Alpha API"}, {"name": "About"}, {"name": "Price"}, {"name": "Channels"}, {"name": "> 5000"}, {"name": "Sad"}, {"name": "Acknowledgement"}, {"name": "No, I'm just browsing"}, {"name": "Wolfram API - II"}, {"name": "Competition"}, {"name": "24/7 Office Hours"}, {"name": "Personalize - Website Landing Page"}, {"name": "Personalize - Customize every convo"}, {"name": "Optimize - Calculate your savings"}, {"name": "Languages"}, {"name": "Self-Learning"}, {"name": "Common Ques |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | Price | Link | Language | |
---|---|---|---|---|
Apache Airflow | Free (Paid cloud integrations available) | https://airflow.apache.org/ | Python | |
Luigi | Free | https://luigi.readthedocs.io | Python | |
Scriptella | Free | http://scriptella.org/#usage | SQL and JavaScript | |
Talend | Available for free | https://www.talend.com/ |