Leetcode 57 Insert Interval

Introduction Sebastian (🧔🏼) and Carl (👨) been working through the Grind 75 to prepare for their upcoming interviews at MAANG. Back in university they made a great team and they believe that they can nail their coding interview prep by explaining their Leetcode solutions to each other. Sebastian meets with Carl at the hip little coffee show down on 8th street for their bi-weekly group study session. 🧔🏼 “I’ll start off with Leetcode 57, the insert interval problem....

January 7, 2023 · 5 min · 1029 words · Me

Leetcode 236 Lowest Common Ancestor of a Binary Tree

Introduction Daniel (🧔🏽‍♂️) nodded his head slowly as he added cream to his freshly poured coffee. He had worked hard to learn his Leetcode and he was feeling ready. He took a sip and walked over to his laptop and sat down. Moments later the interview began. 👩 “Good afternoon Daniel! Thanks for taking the time to interview with me today. Let’s begin with some brief introductions. My name is Jordanna!...

January 7, 2023 · 9 min · 1821 words · Me

Leetcode 121 Best Time to Buy and Sell Stock

Problem statement You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0. Example 1: Input: prices = [7,1,5,3,6,4] Output: 5 Explanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5....

January 2, 2023 · 2 min · 220 words · Me

Leetcode 1 Two Sum

Introduction After weeks of preparation, the big day has finally arrived. At 10:28 am PST, Javier (👨) is moments away from his first interview with Jordanna (👩), a senior software engineer at MAANG inc. The zoom call begins. 👩 “Thanks for taking the time to interview with us today. We’ll start off with brief introductions. My name is Jordanna and I earned my M.Sc. from UPenn before joining MAANG six years ago....

January 2, 2023 · 5 min · 943 words · Me

Design a Unique ID Generator

Overview Design a unique ID generator that works in a distributed environment A traditional database with an auto_increment primary key is difficult to scale Scope Questions: q: What are the requirements for our unique IDs? a: must be unique and sortable q: Do our IDs increment by 1 for each new record? a: IDs increment by time (IDs generated earlier are smaller) q: Do IDs only contain numbers? a: Yes q: What is the ID length requirement?...

December 28, 2022 · 3 min · 578 words · Me