Skip to content

Instantly share code, notes, and snippets.

View chhetrisushil's full-sized avatar
🤕
pretty inactive

Sushil Chhetri chhetrisushil

🤕
pretty inactive
View GitHub Profile
@chhetrisushil
chhetrisushil / Donatas.js
Created July 5, 2021 09:09
Donatas Exploratory interview
/*
// Able to form the sentence -> true
// Not able to form the sentence -> false
Big O notation
O (n^2)
*/
const newspaper = `Hello Readers,
/*
str = "Hello There,
this is a new world."
sentence = "Hello World world"; // false
can create -> return true;
cannot create -> return false;
let latencyTotal=0;
let latencyAvg=0;
let minusPos=0;
let lattencyArr=[]
let cb = latency => {
lattencyArr.push(latency);
if(lattencyArr.length>100){
latencyTotal-=lattencyAr[minusPos++];
}
latencyTotal+=latency;
@chhetrisushil
chhetrisushil / Mark.js
Created July 1, 2021 12:14
Exploratory coding interview
/**
* pushLatency(cb);
* cb = latency => {
* };
*
* getAverageLatency => returns average of latest 100 latencies
*/
// 5,6,3,4 => 18
// 5,6,3,4,7 => (18 - 5) + 7 => 20
// 6,3,4,7,9 => (20 - 6) + 9 => 23
@chhetrisushil
chhetrisushil / Mario_Nunes.js
Last active June 29, 2021 12:18
Exploratory coding interview for Mario Nunes
/**
pushLatency(callback(latency))
find an average of last 100 latencies
you have to build an api which let's you query the average latency
getAverageLantency() -> returns average of last 100 latencies
*/
@chhetrisushil
chhetrisushil / vim.rb
Created July 11, 2017 08:51 — forked from mgrouchy/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '8.0'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end