Killer Google?

An awesome library for developing Quant Finance applications. Plus, a System Design Interview question on databases!

Hi Everyone!

Hope you’re all having a great day!

Here’s your Interview Problem, Yesterday’s Solution and Tech Snippets for the day!

Tech Dive

Our last tech dives were on Distributed Systems and Database Sharding!

Tech Snippets

  • A new and innovative way for Google to kill your SaaS startup

    • Google controls access to multiple walled gardens, and they’ve made it clear that they’re willing to use their power.

      • Sites get bumped off Google’s Search Engine Results Page

      • Android Apps get removed from the Google Play Store

      • Google APIs have pricing altered drastically or get depreciated

    • Google Safe Browsing is a feature that Google uses to help users avoid malicious websites (phishing, scams, etc.)

      • Google Safe Browsing is handled by AI and it isn’t perfect!

      • Getting your website blacklisted by Google Safe Browsing results in a domain level block in Google Chrome and by several other software and hardware vendors.

    • Google’s ETA for reviewing a blacklist report is measured in weeks!

    • If you run a SaaS business with an availability SLA (Service Level Agreement), getting flagged by Google Safe Browsing is a real risk that can kill your business!

    • You can mitigate this risk by

      • Spreading your application over multiple domains

      • Not hosting any customer generated data in your main domains

      • Proactively claim ownership of all your production domains in Google Search Console.

      • Be ready to jump domains if necessary

  • Tensorflow Based Quantitative Finance Library

    • A Quantitative Finance library that utilizes the hardware acceleration support and automatic differentiation of tensorflow

    • Library provides support for

      • Core Mathematical Methods - Optimization, Interpolation, Root Finders, Linear Algebra, etc.

      • Mid-level Mathematical Methods - Ordinary Differential Equation & Partial Differential Equation Solvers, Ito process framework, etc.

      • Pricing Methods & Quant Finance Specific Utilities - Volatility Models, Rate curve building, etc.

    • If you’re interested in Quantitative Finance, checkout this awesome (and free) course by MIT!

Interview Question

What is Database Replication and Database Sharding?

Why is Replication necessary?

Why is Sharding necessary?

How can you implement these two features into a database?

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

You are given an array of intervals where intervals[i] = [start_i, end_i].

Merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.

Example

Input - intervals = [[1,3],[2,6],[8,10],[15,18]]

Output - [[1,6],[8,10],[15,18]]

Solution

We can solve this question by first sorting the input list of intervals.

The way we’ll sort the list is by the first integer in each interval (the start time). This will allow us to quickly check whether any two intervals overlap.

After we sort the input list, we’ll have to iterate through it and check if any intervals overlap.

If any two intervals do overlap, then we’ll merge the two intervals into one interval.

We can check if two intervals overlap by checking if the start bound of the later interval is smaller than (or equal to) the end bound of the earlier interval.

If so, we merge the two intervals.

We can do that by replacing the first interval’s ending bound with the max of (the first interval’s ending bound, the second interval’s ending bound).

Then, we delete the second interval.

Best,

Arpan