☕ Regulators crack down
Regulators crack down on one of the biggest fintech startups. Amazon makes a bet on PWAs over native apps. Plus a solution to yesterday's google interview question.
Hi Everyone!
Hope you’re all having a fantastic day!
Tech Dive
Our next tech dive will be on the basics of Distributed Systems!
With microservices being all the rage, distributed computing is more important now than ever!
We’ll be talking about the challenges that come about when you’re working with a distributed system and the potential solutions.
Stay tuned!
Our last tech dive was on Database Sharding!
Snippets
Ben Thompson (Stratechery) wrote a very interesting piece on social network graphs. Facebook and Twitter started as V1 Social Networks, where they copied the physical world. Facebook digitized connections between friends and family while Twitter broadcasted conversations as if you were sitting at a bar. V2 Social Networking is what we’re seeing with TikTok, where an algorithm will discover content and recommend it to you. Ben Thompson sees this as the future of social networking.
Amazon bets on Progressive Web Apps rather than Native tech for Luna. Amazon Luna is a cloud gaming service that’s meant to rival platforms like Google Stadia and Microsoft xCloud. Luna has just been made available on Android and, similar to the iOS version, there is no separate Luna app to download. Instead, you access the app through the Chrome web browser. Both Microsoft and Google have used native technologies for their cloud gaming apps, although they are collaborating on a project to improve PWA experiences.
Industry News
Massachusetts State Regulators crack down on Robinhood
Robinhood is a zero-commission trading app that has millions of users. The company was recently valued at $11.2 billion dollars after their latest fundraising round in August of 2020.
The app has been criticized in the past for their “gamification” strategy towards user acquisition and retaining user engagement. Gamification is a strategy used by product managers where game-design elements and principles are incorporated into the app to make it more engaging and sticky. Typical elements are things like points, leaderboards, and badges to give users the sense of “leveling-up”.
According to Massachusetts Security Regulators, Robinhood is doing the same with their app through their use of free stocks, strategic push notifications, and decorations like digital confetti. They are filing a complaint against Robinhood alleging this.
Regulators claim that Robinhood is exposing investors to unnecessary trading risks and failing the fiduciary standard set in Massachusetts. The fiduciary standard requires brokers like Robinhood to always act in their client’s best interest.
Massachusetts gives the case of a Robinhood user with no investment experience making more than 12,700 trades in just six months as an example of Robinhood not acting in the best interest of their users.
European Union Regulators propose strict new regulations on Big Tech
Yesterday, European Union officials released drafts of two new regulations for Big Tech companies.
Digital Markets Act - companies with 45+ million monthly users must disclose planned takeovers to EU officials. They also face extra limits on using data they collect to launch competing products. They also must avoid favoring their own products on their platforms.
Digital Services Act - tech companies are more accountable for illegal content on their platforms. Fines can be up to 6% of annual revenue for failure to comply.
These laws still need to be ratified, which could take years. If they do become law, they will be Europe’s strictest laws on Big Tech to date.
Interview Question
You are given a non-negative number n
.
Count the number of primes less than n
and return the count.
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 previous question
Write a program to solve a Sudoku puzzle by filling the empty cells.
A sudoku solution must satisfy all of the following rules:
Each of the digits
1-9
must occur exactly once in each row.Each of the digits
1-9
must occur exactly once in each column.Each of the digits
1-9
must occur exactly once in each of the 93x3
sub-boxes of the grid.
The '.'
character indicates empty cells.
Here’s the question on LeetCode
Solution
This is a classic example of a backtracking question.
Backtracking is an algorithm where you incrementally build up your solution. If you find that your candidate cannot lead to a valid solution, you backtrack back and pick a different path. You can also think of backtracking as a form of Depth-First Search.
With our Sudoku question, we’ll create 3 arrays to keep track of all of our rows, columns, and squares. Remember that a valid Sudoku solution cannot repeat numbers in a single row, column, or square. Our array will represent each row, column, and square as a set. The set will allow us to check if a number is already in a row, column, or square in O(1)
time.
Now, we can write our backtracking function. We’ll write a recursive function that takes in the coordinates of a box.
It will incrementally test values from 1 to 9 as possible numbers to place in the box. Our function will start with 1 and check the row, column, and square associated with that box to make sure none of them already contain a 1.
If this check fails, then our function will move on to 2.
Otherwise, if the check succeeds, then we’ll place 1 in that box and update our respective row, column, and square sets by adding 1 to them.
Then, we’ll move on to the next box in our Sudoku puzzle and recursively call our function.
If at any point, we reach a scenario where we cannot place any number from 1 to 9, then our function will return False
and the parent caller will backtrack by removing the number that was placed in the square and moving on to the next possible number.
If we reach the end of the board, we can return True
and return the final board configuration.