I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains 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
1. Build GraphQL server using `express-graphql` package. | |
2. Configure `schema.js` file. | |
3. Query for data. |
This file contains 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
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
This file contains 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 file shows a hack to achieve operator overloading in | |
// JavaScript. I have defined 3 different operators: | |
// | |
// >= = monadic bind | |
// >> = kleisli composition | |
// > = functor map | |
// * = applicative apply | |
// + = semigroup append | |
// | |
// Head straight to the bottom to see example usages. |
This file contains 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
D [0-9] | |
L [a-zA-Z_] | |
H [a-fA-F0-9] | |
E ([Ee][+-]?{D}+) | |
P ([Pp][+-]?{D}+) | |
FS (f|F|l|L) | |
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U)) | |
%{ | |
#include <stdio.h> |
This file contains 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
void switch_func(int n) { | |
char *s; | |
switch(n) { | |
case 0: | |
s = "Sun"; | |
if(0) | |
case 1: | |
{ s = "Mon"; } | |
if(0) | |
case 2: |
This file contains 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
/* | |
* Find the longest palindrome in the text. | |
* | |
* This is Greplin's first challenge, and I originally solved it in Python. | |
* | |
* This algorithm is linear on the average input, but has a quadratic | |
* worst case running time. There exists an even better algorithm, but | |
* this should do. | |
* | |
* There might also be a small error below, but you get the general idea. |
NewerOlder