Skip to content

Instantly share code, notes, and snippets.

View hackjutsu's full-sized avatar

CosmoX hackjutsu

View GitHub Profile

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water. From https://leetcode.com/problems/container-with-most-water/

Algorithm

The intuition behind this approach is that the area formed between the lines will always be limited by the height of the shorter line. Further, the farther the lines, the more will be the area obtained.

We take two pointers, one at the beginning and one at the end of the array constituting the length of the lines. Futher, we maintain a variable \text{maxarea}maxarea to store the maximum area obtained till now. At every step, we find out the area formed between them, update \text{maxarea}maxarea and move the pointer pointing to the shorter line towards the other end by one step.

@hackjutsu
hackjutsu / Nature.ipynb
Last active October 28, 2020 11:22 — forked from zonca/Nature.ipynb
[Jupyter Notebook Demo 2] This is a #demo for Lepton's support of Jupyter Notebook viewer.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hackjutsu
hackjutsu / sklearn.ipynb
Last active November 20, 2020 14:43 — forked from schwehr/sklearn.ipynb
[Jupyter Notebook Demo 3] This is a #demo for Lepton's support of Jupyter Notebook viewer.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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nst/kubectl-cheat.md
[Kubectl cheat sheet] Kubectl useful stuff #docker #kubectl #kubernetes
@hackjutsu
hackjutsu / lib.js
Created August 28, 2017 07:04 — forked from Offirmo/lib.js
[browser micro-lib] #JavaScript #browser #growth
function poll(predicate, options) {
// early check to save an initial poll period
let result = predicate();
if (result)
return Promise.resolve(result);
const {periodMs, timeoutMs, debugId} = Object.assign({
periodMs: 100, // check every 100ms
timeoutMs: 10 * 1000, // after 10 seconds, timeout