Skip to content

Instantly share code, notes, and snippets.

View nicklathe's full-sized avatar

Nick Lathe nicklathe

View GitHub Profile
@nicklathe
nicklathe / assures-architecture-question.md
Last active October 11, 2021 23:45
assures-architecture-question

Design Question

Your team runs a web application in AWS. For compliance reasons, your team has been tasked with migrating the entire service to a brand new AWS account. Your job is to create a documented plan for moving to the new account that the team can use to perform the migration. How do you do it?

@nicklathe
nicklathe / assures-interview.js
Last active July 12, 2021 16:09
Olive Assures Interview Questions
/**
* Takes a function and an array and calls the function for
* each item in the array.
* @param f - The function to call
* @param arr - The array
*/
function forEach(f, arr) {
}
@nicklathe
nicklathe / gist:e2454e586243956c2d4c9a808bf11b81
Last active July 26, 2016 13:23
Minimum coins - Given a set of coin denominators, find the minimum number of coins to give a certain amount of change.
'use strict';
let minCoins = (amount, index, count, denomination) => {
if((index + 1) > denomination.length) {
return count;
}
if(amount >= denomination[index]) {
amount -= denomination[index];
count += 1;
} else {
@nicklathe
nicklathe / gist:1c0a45f70c643d6f099c9a778d2fbcd8
Last active July 26, 2016 18:32
A functional approach to FizzBuzz
'use strict';
// criteria: iterate through a given array, and do normal FizzBuzz things.
let checker = (num, divisor) => num % divisor === 0;
let fizzerBuzzer = (arr) => {
return arr.map((num) => {
let checkedNum = '';
if(checker(num, 3)) {
@nicklathe
nicklathe / gist:0186a3632dd609cec739
Created March 27, 2016 21:00
Iterate through array without using a loop or library
let x = [1,2,3,4,5];
let sum = function(arr, sums) {
if(arr.length === 0) {
return sums;
}
sums += arr[0];
arr.shift();
return sum(arr, sums);
};
@nicklathe
nicklathe / gist:1f3a287d7bdbe73d2d96
Created March 27, 2016 01:48
Merge two graphs.
var graphLinks1 = [
{
name: "A",
children: ["B", "C"]
},
{
name: "B",
children: ["D", "G"]
},
{