Skip to content

Instantly share code, notes, and snippets.

// This one seems pretty abstract and probably depends a lot from interview to interview
// but here's my interpretation without any feedback from the interviewer
// and trying to do it in 15 mins
public class Firework
{
public int StartTime {get;set;}
public int Duration {get;set;}
}
// 1a
public int FibCalcSum(int fib)
{
if(fib < 0)
throw new ArgumentException("Fib number must be greater than or equal to 0");
if(fib < 2)
return fib;
return FibCalcSum(fib - 1) + FibCalcSum(fib - 2);
}
@TomaQ
TomaQ / FlattenArray
Last active October 5, 2018 03:49
Flattens an array of arbitrarily nested arrays
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
var array = new Object[]
{
new Object[]
// Write a function that returns the maximum returns
// given a sequence of prices.
const stockPrices1 = [10, 7, 5, 8, 11, 9];
const stockPrices2 = [3, 7, 5, 13, 1, 8];
const stockPrices3 = [88, 4, 12, 3, 2, 1];
const stockPrices4 = [12, 16, 3, 2, 8, 7];
function getMaxProfit(prices) {
//Set the inial range
class Node {
constructor(value) {
this.value = value;
// own props for easier object shape recognition
this.left = null;
this.right = null;
}
}
@TomaQ
TomaQ / genesis_public_key
Created February 21, 2018 04:58
Genesis Key
0426bfff8a5d54a50eb8169e544afdc620f10c54c6a382af7a8724d29ba835e98acd8aa082734e60ae23b2bbd5c0890e4d114500b9e3d60b9932c9c1fe2698744d;hkal