Skip to content

Instantly share code, notes, and snippets.

View afrida67's full-sized avatar
🎯
Focusing

Afrida Aesha afrida67

🎯
Focusing
View GitHub Profile
@afrida67
afrida67 / problem1.py
Created December 9, 2018 07:33
Find geolocation information about an IP
'''
Sample Input
63.70.164.200
168.12.13.1
Sample Output
Lincoln (Highlands), Nebraska (United States)
Atlanta (150), Georgia (United States)
'''
##install: pip install ipapi
@afrida67
afrida67 / problem4.sql
Created December 9, 2018 07:35
Placements
/*
You are given three tables: Students, Friends and Packages. Students contains two columns: ID and Name.
Friends contains two columns: ID and Friend_ID (ID of the ONLY best friend). Packages contains two
columns: ID and Salary (offered salary in $ thousands per month)
Write a query to output the names of those students whose best friends got offered a higher salary than
them. Names must be ordered by the salary amount offered to the best friends. It is guaranteed that no two
students got same salary offer
Oracle Solution
*/
@afrida67
afrida67 / Problem2.py
Created December 12, 2018 04:24
Parse the logs
import logging
logging.basicConfig(filename='mock_log1.log', level=logging.DEBUG,
format='%(asctime)s [%(levelname)s] %(message)s')
class Server:
def __init__(self, consumer_id, product_id, error_info, msg_id, error_id):
self.consumer_id = consumer_id
self.product_id = product_id