Skip to content
Open

cc #17

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/sqldialects.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 76 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,76 @@
# data.code.cloud
coding interview for big 5
# Prem Vishnoi
## Lead Data Engineer | Expert in Big Data and AI

+65-92716405 | vishnoiprem@gmail.com | [LinkedIn](https://www.linkedin.com/in/vishnoiprem/) | [Blog](https://medium.com/@premvishnoi)

## PROFESSIONAL SUMMARY
Data Engineering Leader with 14+ years of experience transforming complex data ecosystems across e-commerce, retail, and financial services. Expert in building scalable data platforms, leading cross-functional teams, and delivering innovative cloud solutions.

## TECHNICAL EXPERTISE
- **Core:** Python, SQL, Java, Shell Scripting
- **Big Data:** Apache Spark, Hadoop, Kafka, Flink, HBase
- **Cloud:** AWS (Solutions Architect), Azure, Aliyun
- **Data Platform:** Databricks, Airflow, dbt, Teradata, MySQL, Postgres
- **ML/AI:** PyTorch, Scikit-learn, NLP, LLMs
- **Visualization:** Looker, Power BI, Quickview

## PROFESSIONAL EXPERIENCE

### Lead Data Engineer | CPaxtra (2024 - Present)
- Led 16-person engineering team building next-gen data platform
- Built end-to-end data pipelines serving 50+ stakeholders across retail operations
- Developed real-time data products for last-mile delivery reducing delivery time by 30%
- Architected Lakehouse solution reducing operational costs by 50%
- Implemented data validation frameworks improving reliability by 20%
- **Tech:** Azure, AWS, Databricks, Spark, Kafka, Python

### Lead Data Engineer | Xendit.co, Singapore (2024)
- Led 4-person team developing real-time and batch data pipelines
- Built automated FX data pipeline reducing manual processing by 80%
- Optimized AWS/Databricks costs by 40% through resource optimization
- Reduced DBT job execution time by 60% through code refactoring
- **Tech:** Databricks, AWS, Airflow, Python, DBT, Looker

### VP Data Engineer | Lazada Group, Singapore (2018 - 2024)
- Built Data Lakehouse on Alibaba Cloud using ODS, CDM, ADS layers supporting $10B+ GMV
- Built real-time last-mile delivery platform tracking 5M+ parcels daily
- Developed real-time hub analytics reducing backlog by 35% with capacity alerts
- Created campaign data platform supporting 11.11, 12.12 events handling 10M+ orders/hour
- Implemented data governance and lineage for 1000+ tables across 6 countries
- **Tech:** Alicloud, Kafka, Flink, Hologres, Python, SpringBoot

### Sr. Big Data Consultant | SCB Bank, Singapore (2016 - 2018)
- Developed batch data pipelines for Anti-Money Laundering (AML) operations
- Managed data workflows across 15+ international markets
- Improved data ingestion efficiency by 15%
- **Tech:** Hadoop, Hive, Kafka, Spark, SQL, Teradata, Scala

### Data Engineer | DBS Bank, Singapore (2015 - 2016)
- Migrated to Hadoop-based big data platform
- Developed scalable data ingestion frameworks
- **Tech:** Hadoop, Hive, Kafka, Spark, SQL, Teradata

### ETL Data Engineer | PayPal Inc., India (2014 - 2015)
- Designed ETL pipelines handling 500M daily transactions
- Reduced processing times by 50%
- **Tech:** ETL, Python, Hadoop, Spark, SQL

### Data Warehouse Engineer | Exilant Tech, India (2011 - 2014)
- Built data warehouse for Apple's customer care platform
- Improved data accuracy by 10%
- **Tech:** SQL, Informatica, Teradata, Tableau, Python

## EDUCATION
- **PGP in AI & Machine Learning** | University of Texas at Austin
- **Bachelor of Engineering** | University of Rajasthan

## CERTIFICATIONS & ACHIEVEMENTS
- AWS Solutions Architect Associate
- LLM Model Learning Certificate
- Internal Hackathon Winner at PayPal
- Promoted twice in 4 years for exceptional performance



## Head of data | Expert in Big Data and AI

Empty file.
Empty file.
16 changes: 16 additions & 0 deletions code/agoda/agoda_de/CanPlaceFlowers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

def canPlaceFlowers(flowerbed, n):
count = 0
for i in range(len(flowerbed)):
if flowerbed[i] == 0 and (i == 0 or flowerbed[i - 1] == 0) and (i == len(flowerbed) - 1 or flowerbed[i + 1] == 0):
flowerbed[i] = 1
count += 1
if count >= n:
return True
return False

# Example:
# Input: flowerbed = [1,0,0,0,1], n = 1
# Output: True
# Time Complexity: O(N)
# Space Complexity: O(1)
29 changes: 29 additions & 0 deletions code/agoda/agoda_de/CapacityToShipPackagesWithinDDays.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
def shipWithinDays(weights, days):
# Helper function to determine if a given capacity can ship within `days`
def canShip(capacity):
days_needed = 1
total = 0
for weight in weights:
if total + weight > capacity:
days_needed += 1
total = 0
total += weight
return days_needed <= days

# Binary search to find the minimum ship capacity
left, right = max(weights), sum(weights)
while left < right:
mid = (left + right) // 2
if canShip(mid):
right = mid
else:
left = mid + 1
return left

# Example Usage:
weights = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
days = 5

# Running the function
min_capacity = shipWithinDays(weights, days)
print(f"Minimum capacity needed to ship within {days} days: {min_capacity}")
14 changes: 14 additions & 0 deletions code/agoda/agoda_de/CoinChange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

def coinChange(coins, amount):
dp = [float('inf')] * (amount + 1)
dp[0] = 0
for coin in coins:
for x in range(coin, amount + 1):
dp[x] = min(dp[x], dp[x - coin] + 1)
return dp[amount] if dp[amount] != float('inf') else -1

# Example:
# Input: coins = [1, 2, 5], amount = 11
# Output: 3
# Time Complexity: O(N * amount)
# Space Complexity: O(amount)
25 changes: 25 additions & 0 deletions code/agoda/agoda_de/CourseSchedule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

from collections import defaultdict, deque

def canFinish(numCourses, prerequisites):
graph = defaultdict(list)
indegree = {i: 0 for i in range(numCourses)}
for dest, src in prerequisites:
graph[src].append(dest)
indegree[dest] += 1
queue = deque([k for k in indegree if indegree[k] == 0])
count = 0
while queue:
course = queue.popleft()
count += 1
for neighbor in graph[course]:
indegree[neighbor] -= 1
if indegree[neighbor] == 0:
queue.append(neighbor)
return count == numCourses

# Example:
# Input: numCourses = 2, prerequisites = [[1,0]]
# Output: True
# Time Complexity: O(N + E)
# Space Complexity: O(N + E)
Empty file.
32 changes: 32 additions & 0 deletions code/agoda/agoda_de/FindMedianFromDataStream.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

import heapq

class MedianFinder:

def __init__(self):
self.small = [] # Max heap (inverted to use with min-heap)
self.large = [] # Min heap

def addNum(self, num):
heapq.heappush(self.small, -num)
if self.small and self.large and (-self.small[0] > self.large[0]):
heapq.heappush(self.large, -heapq.heappop(self.small))
if len(self.small) > len(self.large) + 1:
heapq.heappush(self.large, -heapq.heappop(self.small))
if len(self.large) > len(self.small):
heapq.heappush(self.small, -heapq.heappop(self.large))

def findMedian(self):
if len(self.small) > len(self.large):
return -self.small[0]
return (-self.small[0] + self.large[0]) / 2

# Example:
# medianFinder = MedianFinder()
# medianFinder.addNum(1)
# medianFinder.addNum(2)
# medianFinder.findMedian() # Output: 1.5
# medianFinder.addNum(3)
# medianFinder.findMedian() # Output: 2
# Time Complexity: O(log N) for insertion
# Space Complexity: O(N)
15 changes: 15 additions & 0 deletions code/agoda/agoda_de/FirstUniqueCharacter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

def firstUniqChar(s):
count = {}
for char in s:
count[char] = count.get(char, 0) + 1
for i, char in enumerate(s):
if count[char] == 1:
return i
return -1

# Example:
# Input: "loveleetcode"
# Output: 2
# Time Complexity: O(N)
# Space Complexity: O(1)
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions code/agoda/agoda_de/JumpGameII.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

def jump(nums):
jumps = 0
cur_end = 0
cur_farthest = 0
for i in range(len(nums) - 1):
cur_farthest = max(cur_farthest, i + nums[i])
if i == cur_end:
jumps += 1
cur_end = cur_farthest
return jumps

# Example:
# Input: [2,3,1,1,4]
# Output: 2
# Time Complexity: O(N)
# Space Complexity: O(1)
11 changes: 11 additions & 0 deletions code/agoda/agoda_de/KthSmallestElementInBST.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

def kthSmallest(root, k):
def inorder(node):
return inorder(node.left) + [node.val] + inorder(node.right) if node else []
return inorder(root)[k - 1]

# Example:
# Input: [3,1,4,null,2], k = 1
# Output: 1
# Time Complexity: O(N)
# Space Complexity: O(N)
18 changes: 18 additions & 0 deletions code/agoda/agoda_de/LastStoneWeight.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

import heapq

def lastStoneWeight(stones):
stones = [-stone for stone in stones]
heapq.heapify(stones)
while len(stones) > 1:
first = -heapq.heappop(stones)
second = -heapq.heappop(stones)
if first != second:
heapq.heappush(stones, -(first - second))
return -stones[0] if stones else 0

# Example:
# Input: [2,7,4,1,8,1]
# Output: 1
# Time Complexity: O(N log N)
# Space Complexity: O(N)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

def smallestString(s):
for i, c in enumerate(s):
if c != 'a':
break
else:
return s[:-1] + 'z'
res = s[:i] + ''.join(chr(ord(c) - 1) if c != 'a' else c for c in s[i:])
return res

# Example:
# Input: "abcz"
# Output: "abcy"
# Time Complexity: O(N)
# Space Complexity: O(N)
26 changes: 26 additions & 0 deletions code/agoda/agoda_de/LongestPalindromicSubstring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

def longestPalindrome(s):
if not s:
return ""

start, end = 0, 0
for i in range(len(s)):
len1 = expandFromCenter(s, i, i)
len2 = expandFromCenter(s, i, i + 1)
max_len = max(len1, len2)
if max_len > end - start:
start = i - (max_len - 1) // 2
end = i + max_len // 2
return s[start:end + 1]

def expandFromCenter(s, left, right):
while left >= 0 and right < len(s) and s[left] == s[right]:
left -= 1
right += 1
return right - left - 1

# Example:
# Input: "babad"
# Output: "bab"
# Time Complexity: O(N^2)
# Space Complexity: O(1)
Empty file.
15 changes: 15 additions & 0 deletions code/agoda/agoda_de/LowestCommonAncestorOfBinaryTree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

def lowestCommonAncestor(root, p, q):
if not root or root == p or root == q:
return root
left = lowestCommonAncestor(root.left, p, q)
right = lowestCommonAncestor(root.right, p, q)
if left and right:
return root
return left if left else right

# Example:
# Input: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1
# Output: 3
# Time Complexity: O(N)
# Space Complexity: O(N)
21 changes: 21 additions & 0 deletions code/agoda/agoda_de/MinimumWindowSubstring.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def minimumTotal(triangle):
# Start from the second last row and move upwards
for row in range(len(triangle) - 2, -1, -1):
for col in range(len(triangle[row])):
# Update each element to be the sum of itself and the minimum of the two elements below it
triangle[row][col] += min(triangle[row + 1][col], triangle[row + 1][col + 1])

# The top element now contains the minimum path sum
return triangle[0][0]


# Example Usage:
triangle = [
[2],
[3, 4],
[6, 5, 7],
[4, 1, 8, 3]
]
# Running the function
minimum_path_sum = minimumTotal(triangle)
print(f"Minimum path sum from top to bottom: {minimum_path_sum}")
13 changes: 13 additions & 0 deletions code/agoda/agoda_de/MoveZeroes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

def moveZeroes(nums):
last_non_zero_found_at = 0
for i in range(len(nums)):
if nums[i] != 0:
nums[last_non_zero_found_at], nums[i] = nums[i], nums[last_non_zero_found_at]
last_non_zero_found_at += 1

# Example:
# Input: [0,1,0,3,12]
# Output: [1,3,12,0,0]
# Time Complexity: O(N)
# Space Complexity: O(1)
Loading