☕ Open Source GPT-3
GPT-3 is OpenAI's revolutionary language model. A team is working on building an open source version. Plus, an interview question that I recently got from Bloomberg!
Hi Everyone!
Hope you’re all having a great day!
Here’s your Interview Problem, Yesterday’s Solution and Tech Snippets for the day!
Tech Dive
Our last tech dives were on Distributed Systems and Database Sharding!
Tech Snippets
Uses OpenAI’s GPT-3 algorithm to write a resume for you!
GPT-Neo is the name for a series of transformer based language models that are loosely styled around OpenAI’s GPT-3 architecture.
The goal is to replicate a GPT-3 sized model and open source it.
You can view their publication preprints here.
Southeast Asian ride-hailing company Grab is considering a U.S. IPO
Grab is a ride-hailing company that was founded in Singapore. It is Southeast Asia’s first decacorn, valued at $14 billion dollars in their last round.
They are considering a U.S. listed IPO to raise more than $2 billion dollars in capital.
The U.S. IPO market has been extremely lucrative for tech IPOs this past year and many technology companies are considering going public to take advantage of the current environment.
Interview Question
You are given an array of intervals
where intervals[i] = [start_i, end_i]
.
Merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.
Example
Input - intervals = [[1,3],[2,6],[8,10],[15,18]]
Output - [[1,6],[8,10],[15,18]]
Here’s the question in LeetCode.
(I just interviewed with Bloomberg and got this question, so I thought I’d share haha)
We’ll send a detailed solution tomorrow, so make sure you move our emails to primary, so you don’t miss them!
Gmail users—move us to your primary inbox
On your phone? Hit the 3 dots at the top right corner, click "Move to" then "Primary"
On desktop? Back out of this email then drag and drop this email into the "Primary" tab near the top left of your screen
Apple mail users—tap on our email address at the top of this email (next to "From:" on mobile) and click “Add to VIPs”
Previous Solution
As a refresher, here’s the previous question
Given an array nums
of n integers and an integer target
, find three integers in nums
such that the sum is closest to target
.
Return the sum of the three integers.
You may assume that each input would have exactly one solution.
Here’s the question in LeetCode.
Solution
We can solve this question using the two pointer technique.
The Two Pointer technique is useful for searching for pairs (or triplets) in a sorted array.
Since nums
isn’t sorted, we’ll first have to sort nums
.
Then, we’ll use two variables l
and r
(left and right) that point to indices in our array nums
. These are our two pointers.
Now, we iterate through each item in our sorted array and set l
and r
to 0 and len(nums
) - 1.
We sum the integers at the three indices. If our sum is greater than target
, then we increment l
. If our sum is less than target
, then we decrement r
. When calculating sum, we should also make sure that none of the indices equal each other, since we can’t repeat numbers.
As we do this, we’ll keep track of which sum came closest to target
. If our sum starts to get farther from target
, then we can continue our iteration to the next indice in nums
, since we’ve found the optimal triplet for our current iteration.
After we’ve iterated through our entire array (and run the two pointer technique on each indice), we’ll return the closest sum we’ve seen so far.
Best,
Arpan