☕ AI startups raise higher
Memory Management with Python explained. Plus, AI startups are fundraising at even higher valuations. An awesome data visualization tool in ReactJS.
Hey Guys,
Interviewing.io is a fantastic resource I wanted to share with you all.
You can book realistic mock interviews with senior FAANG engineers who will give you detailed and actionable feedback on exactly what you need to work on.
Mastering algorithms on LeetCode and system design on SystemsExpert is great, but they don’t prepare you for the pressure and stress that comes from an actual interview setting.
The best part?
You don’t pay anything until you’re hired.
Check them out here.
Special thanks to Interviewing.io for sponsoring Quastor Daily. I’m a user of the service!
Industry News
AI startups are getting even hotter
Last week, Microsoft announced a massive acquisition of AI company Nuance for $19.7 billion dollars. This is Microsoft’s second-largest purchase ever (their largest purchase was LinkedIn for $26.2 billion dollars).
This acquisition is just another signal of the massive amount of value that AI companies can have for Big Tech giants like Microsoft, Google, Facebook, Apple, and Amazon.
The Big Tech giants are entering more diverse markets like Healthcare, Food Delivery, and Finance and they’re looking for a differentiating advantage. Machine Learning can help them in their search for competitive advantages, so Big Tech companies aren’t afraid to buy when they get the chance.
This raises the valuations of all the startups in the AI space as they are now even bigger targets for strategic acquisitions or acquihires (where a company buys another company in order to hire their employees/founder).
In the past month, we’ve also seen massive fundraising rounds by startups based in the AI space.
ScaleAI is building a platform to provide high-quality training data for machine learning teams. They count Airbnb, Brex, Instacart, OpenAI, Toyota, and Nvidia as their customers. ScaleAI has recently raised $325 million dollars at a $7 billion dollar valuation in their Series E financing round.
Copysmith is developing software for copywriting (the text used by companies for their marketing and promotional materials) using OpenAI’s GPT-3. The company was started last year (after the beta release of GPT-3) and has now raised $10 million dollars.
If you’re interested in learning more about Machine Learning, my favorite course is fast.ai’s Practical Deep Learning for Coders, which focuses a bit more on the applications rather than theory and allows you to start building cool apps fast.
If you want to know more about the theory side, Elements of Statistical Learning is a fantastic introduction to ML (check out An Introduction to Statistical Learning if that book is too complicated) and Ian Goodfellow’s Deep Learning Book is an awesome intro to Deep Learning.
All of the resources I’ve mentioned above are completely free and can be viewed here.
Tech Snippets
An awesome introduction to the concepts in Memory Management with Python.
Covers
How are Python objects stored in Memory
Garbage Collection in Python
How Python’s GIL (Global Interpreter Lock) plays into memory management.
An awesome visualizer of the Bitcoin Blockchain
If you’re into data visualization, check out this awesome visualizer of the Bitcoin Blockchain.
It’s open-source, so you can check out the code here.
Interview Question
Implement a function to check if a linked list is a palindrome.
Here’s the question in LeetCode
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 last question
You are given a binary tree in which each node contains an integer value. The integer value can be positive or negative.
Write a function that counts the number of paths in the binary tree that sum to a given value (the value will be provided as a function parameter).
The path does not need to start or end at the root or a leaf, but it must only go downwards.
Here’s the question on LeetCode
Solution
The brute force solution is to use a preorder traversal.
For each node in our preorder traversal, we’ll set that node as the root of our path and then search that node’s children to find all the paths that sum to our target.
With this solution, we’re doing a preorder traversal and then searching each node’s children for every node in our traversal.
This makes our time complexity O(n^2)
.
Can we reduce our time complexity?
We can if we add a hash table to function as cache. Our hash table will keep track of the path sums that we’ve come across and the number of times that they appeared.
We first create our cache (hash table) and initialize it with a path sum of 0 appearing 1 time, since the initial path sum is 0.
Then, we search our tree in a depth-first fashion.
For each node, we first calculate the new path sum by adding in our current node’s value.
Then, we check if (path sum - target)
exists in our cache of previous path sums.
If it does, then that means that between that node(s) (where the path sum was (path sum - target)
) and our current node the path sum must have been equal to target
.
Therefore, we can add the number of times that (path sum - target)
appeared as times that the path sum equaled target. We keep track of the number of path sums that equal target in a variable called result
.
After, we can search the current node’s children and repeat the process.
After searching the children, we’ll want to backtrack up the tree.
That means that we should remove the current path sum from our cache since that path sum will no longer be part of nodes in different branches.
Can you figure out the new time complexity?
Reply back to this email with the time complexity.
We’ll tell you if you’re right or wrong.
Want more practice with real FAANG software engineers?
Check out Interviewing.io!
You don’t have to pay anything until you get that job at FAANG!