☕ Be snowflake
A Microsoft Interview Question. Details about Facebook's new VR headset. Snowflake, a cloud data warehousing service, bumps up their IPO price. Airtable, a cloud collaboration tool, raises a ton of $$
Hope you’re all having a fantastic day! Here’s your interview question and industry news for the day!
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.
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”
- Facebook’s Oculus Quest 2 leaks - Details about Facebook’s new Oculus Quest leaked after a pair of promotional videos were accidentally uploaded. The new headset will be powered by the Snapdragon XR2 platform (which is specifically designed for AR/VR hardware) and has an “almost 4K display”. The new headset has 6 GB of RAM (up from the last Quest’s 4 GB) and will be officially announced in mid September.
- Snowflake bumps expected IPO price by 30% - Snowflake is a cloud-based data warehousing company that is part of the “data warehouse as a service” trend. Their software now offers Data Engineering, Science, Exchange and other applications that you can run on top of AWS S3, GCP or Azure. The company is going public soon and has now increased their IPO price due to the large amount of demand. Snowflake could go public at a valuation of more than $30 billion dollars.
As a refresher, here’s the previous question
Given a reference to a node in a connected, undirected graph… return a deep copy of the graph.
You can assume that each node in the graph will contain a value (int) and a list (a list of nodes) of its neighbors.
We can solve this using a graph traversal algorithm. You can pick your favorite with BFS or DFS. We’ll be using DFS for the solution.
As you traverse the given graph, create the new graph simultaneously.
Use a hashmap to keep track of visited nodes and their corresponding mappings (to the new graph). The keys in the hashmaps are nodes that we’ve visited (in the original graph) and the values are the corresponding nodes in the deep-copy.
When we come across an unvisited node, we create its corresponding copy and add them to the hashmap. Then, we iterate through the original node’s neighbors and run the same process on each one of them (in a recursive DFS fashion).
The time and space complexity are both linear.
Thanks for reading!
Should I continue providing the solutions in Python? Or do you guys want a different programming language? Please reply to this email with what programming language you guys prefer the solutions in. Thanks!