☕ Tim Cook sends his love
A medium interview question. Apple announces iOS 14's release date. TypeScript is going to be 10 years old. Zwift raises a ton of money from KKR.
Howdy Guys & Gals!
Hope everyone’s having a fantastic day! Here’s your interview question and industry news for the day!
Interview Question
Write a function to delete a node in a singly-linked list.
You will NOT be given access to the head of the list, instead you’ll be given access to the node to be deleted directly.
The node you must delete will NOT be a tail node in the linked list.
We’ll send out the solution (with working code & test-cases) in our next email, 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 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”
Industry News
Apple shows their love for iOS developers by surprising them with a next-day iOS 14 release - Man, and I thought Microsoft loved their platform developers (DEVELOPERS! DEVELOPERS! DEVELOPERS!). During yesterday’s Apple Event, the company announced that iOS 14 would be released the next day. This surprised quite a few developers as many thought there would be at least a week of notice before the official public release (this is what Apple has done in the past). Developers need this gap to make sure the apps they’ve been building for the beta releases actually work on the final version. Apple’s approval process for apps also takes a while, so programmers have that week to make sure they can submit in time to guarantee their work will be in the App Store for the iOS release.
TypeScript is going to be 10 years old - TypeScript was officially released in 2012 and has since become a crucial language for front-end development. It’s been adopted by Slack, Airbnb, Microsoft and is now has a firm spot in the top 10 programming languages. Anders Hejlsberg (one of TypeScript’s co-creators) started pitching TypeScript to the higher-ups at Microsoft in 2010 and knew it would be a tough-sell. Microsoft, under Ballmer, was very ambivalent about open source and “afraid” of it. Despite that, Hejlsberg managed to get the project up and running.In 2014, under Satya Nadella, Microsoft would begin it’s pivot from Windows to the cloud… and with that there would be a culture change in the company. Microsoft would shift TypeScript to a model of “open development” via a public repository on GitHub. Now, the community of developers could influence TypeScript’s future.
Zwift raises $450 million dollars in funding from KKR - Zwift is an online fitness platform that immerses cyclists and runners in 3-D generated worlds. The company raised $450 million dollars in funding from KKR in exchange for a minority stake in the business. Zwift has now raised $620 million altogether and is valued at north of $1 billion dollars.The company plans to use this money to expand into the hardware business. Right now, Zwift’s users need to buy their own smart trainers (made by brands like Elite and Wahoo) and purchase treadmills/bikes from other companies. Zwift hopes to enter this space, starting with their own smart trainer. Given the success of Peloton, it won’t be surprising if Zwift decides build their own smart treadmills/bikes as well.
Previous Solution
As a refresher, here’s the previous question
Given two binary trees, write a function that checks if they are the same or not.
Two binary trees are considered the same if they are structurally identical and corresponding nodes have the same values.
Solution
Whenever you come across any type of problem involving a tree, you should first think about recursion. Recursion usually results in the most elegant solution to tree-type questions.
So, how can we use recursion here?
Well, we’re given two tree nodes, so we first check to make sure that both nodes have the same value (if they don’t, we return False).
Then, we want to make sure that both nodes have the same children. So, we can just call recursively call the function on the children of the nodes!
To make this more clear, let’s go through the pseudocode…
Actually, just read the Python code. I first typed out the pseudocode, then realized it was literally the same as the Python code lol.