This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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;} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var array = new Object[] | |
{ | |
new Object[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
constructor(value) { | |
this.value = value; | |
// own props for easier object shape recognition | |
this.left = null; | |
this.right = null; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0426bfff8a5d54a50eb8169e544afdc620f10c54c6a382af7a8724d29ba835e98acd8aa082734e60ae23b2bbd5c0890e4d114500b9e3d60b9932c9c1fe2698744d;hkal |