Skip to content

Instantly share code, notes, and snippets.

View arverma's full-sized avatar
:octocat:
Looking for a remote job

Aman Ranjan Verma arverma

:octocat:
Looking for a remote job
View GitHub Profile
@arverma
arverma / bigquery_table_describe.py
Created May 8, 2025 04:51
Exports metadata information for all columns in a BigQuery table to a CSV file.
"""
Exports metadata information for all columns in a BigQuery table to a CSV file.
This function retrieves the schema of the specified BigQuery table and computes the following
details for each column:
- Column name
- Data type
- Count of NOT NULL values
- Count of NULL values
- Sample of up to 10 distinct values
"""
Airflow Hook for Notion API: https://developers.notion.com/reference/intro
author: Aman Ranjan Verma(https://www.linkedin.com/in/ar-verma/)
"""
import json
from airflow.providers.http.hooks.http import HttpHook
from airflow.exceptions import AirflowException
import logging
"""
Airflow Hook for Amplitude API: https://www.docs.developers.amplitude.com/analytics/apis/taxonomy-api/
author: Aman Ranjan Verma(https://www.linkedin.com/in/ar-verma/)
"""
from airflow.providers.http.hooks.http import HttpHook
from airflow.exceptions import AirflowException
from urllib.parse import quote
AMPLITUDE_EVENT_ENDPOINT = "amplitude.com/api/2/taxonomy/event"
@arverma
arverma / customer_dim.csv
Last active March 26, 2023 11:48
Data Modelling Interviews Made Easy
Customer Schema Names Constraints
customer_id PRIMARY KEY
customer_name NOT NULL
mob_num CHECK
email_id CHECK
active_from DEFAULT CURRENT_DATE_TIME
active_to
@arverma
arverma / uber.py
Created December 6, 2022 12:08
Uber interview question
"""
Suppose you have a big text log file and there are three columns:
------------------------------------
Name | City | Timestamp
-------------------------------------
Jamie city1 ts4
Dana city1 ts3
Jamie city2 ts1
Jamie city3 ts3
@arverma
arverma / booking_q2.md
Created December 6, 2022 11:57
booking.com interview question

A Covid Stream Aggregation

Question Description

During the Covid outbreak, a system was implemented to allow hospitals and test centers to report the daily number of confirmed cases to a central system.Your team is responsible to answer certain questions based on the stream of events.

You may only use the following given operators of a hypothetical distributed stream processing framework:

@arverma
arverma / booking.md
Last active December 6, 2022 10:46
booking.com interview question

Table Build Order

As part of a job submission to a server, that is responsible for orchestrating the creation of tables for consumption by reports, a piece of metadata is submitted that declares the dependencies of the various tables for the given job.It is the responsibility of the server to make sure that a correct build order is chosen and executed.

An example of such a dependency declaration is:

{
 "TableA": ["TableB", "TableC"],
@arverma
arverma / share_chat_q2.md
Created December 5, 2022 15:29
Share Chat Coding Interview Questions

Given a number N, print all numbers say x which satisfy the following condition: x + F(x) + F(F(x)) = N

Where F(x) is the sum of the digits of the number x

Constraints

1 <= N <= 109 

Example Input

@arverma
arverma / share_chat_q1.md
Last active December 5, 2022 15:28
Share Chat Coding Interview Questions

Given three positive integers A, B, and C. Any positive integer is magical if it is divisible by either B or C. Return the Ath magical number. Since the answer may be very large, return it modulo 10^9 + 7.

Problem Constraints

1 <= A <= 109
2 <= B, C <= 40000

Input Format

@arverma
arverma / insert_print.py
Created June 23, 2022 02:29
basic linkedlist example
class Node:
def __init__(self, data):
self.data = data
self.next = None
def create_linked_list(a):
head = Node(a[0])
start = head
for element in a[1::]: