☕ Google is changing

Google is making strides in how it manages one of it's biggest open source projects (with massive implications on the web as a whole). Also, software is eating your utility bill!

Hi Everyone!

Hope you’re all having a fantastic weekend!

Tech Dive

No tech dive for today unfortunately! Here’s the schedule for future tech dives

  • Tomorrow - API Design

Our last tech dive was on Serverless Computing.

Check it out here!

Interview Question

Write a function to calculate pow(x, n), which is x raised to the power n.

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 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

Google is loosening control over Chromium

Chromium forms the core of the Google Chrome web browser. The Chromium project includes the user interface, V8 JavaScript engine and Blink rendering engine. Many other browsers like Microsoft Edge and Opera are also based on Chromium code.

The Chromium project is open source however governance of the project has mostly been by Google engineers. Contributions to the codebase have also mostly been by Googlers. However, the company is now taking steps to change this.

Google has begun a new nomination process that allows outsiders to join the inner circle, with a developer from the company Igalia joining through the process.

Chromium project leaders are also accepting features from other companies into Chromium even if they won’t be added into Chrome. An example is the Storage Access API, which provides a way for cross-origin content to gain access to Web Storage (sessionStorage and localStorage).

However, some developers are still vocal about wanting Google to cede more control. The CEO of Brave Browser, Brendan Eich, commented that “The Chromium playing field and rules still tilt steeply in Google’s favor. Brave disables Chromium features it views as nonstandard and privacy risks, but Google doesn't accept those changes in Chromium”.

Digital Electricity supplier Tibber raises $65 million dollars in their Series B round.

Software is eating your utility bill! Or that’s the goal at least.

Tibber is a digital electricity supplier that uses AI to help customers lower their energy bills and electricity consumption. Many households do not just have one electricity supplier for their home, they have multiple providers that each having differing rates per kilowatt-hour.

Tibber develops software that can purchase energy from these producers at the best prices and at the best time of day based on your personal usage. They provide a mobile app so customers can see a detailed breakdown of their energy usage, including what devices are using how much power.

The company launched in 2016 and has seen organic growth to 100,000 paying customers in Norway, Sweden and Germany. The company is now expanding to new countries and markets.

Previous Solution

As a refresher, here’s the previous question

Given a string s, return the longest palindromic substring in s. A palindromic substring is a substring that is a palindrome.

Example

Input - “programming”

Output - “mm”

Input - “quastor”

Output - “q”

Input - “racecarfun”

Output - “racecar”

Solution

The brute force solution would be to go through every substring in our string (O(n^2) substrings) and check each one to see if it’s a palindrome (takes O(n) time). Then, we return the longest one.

That would take O(n^3) time.

Can we do it faster?

Yes!

Instead, we can go through every character in our string and assume it’s the middle of our palindrome (a string of length 1 is always a palindrome). Then, we expand from that character with two pointers on the right and the left of that character and check if the characters at the right and left pointer are equivalent.

If they are equivalent, then we can extend our palindrome by 2 characters and shift our pointers further apart. Once they’re not equivalent (or one of the pointers points to a location outside of our string), we’ll terminate.

This way, we can solve this question in O(n^2) time since iterating through the entire string takes O(n) time and checking each character to find the longest palindrome is also O(n).

If you have any feedback or questions, feel free to reply to this email!

Best,

Arpan