Skip to content

Instantly share code, notes, and snippets.

View eduarmreyes's full-sized avatar
🏙️
Moved to a nice city

Eduardo eduarmreyes

🏙️
Moved to a nice city
View GitHub Profile
@eduarmreyes
eduarmreyes / interview-questions.md
Created August 12, 2019 21:16 — forked from jvns/interview-questions.md
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

function find(needle, heystack) {
let returnValue = false;
let indexNeedle = 0;
heystack.split("").forEach(element => {
if (needle[indexNeedle] === element) {
indexNeedle += 1;
if (indexNeedle === needle.length) {
return false; // break free the cycle
}
}
function intersection(array1, array2) {
const intersectionOfArrays = [];
const cache = {};
array1.forEach(element => {
cache[element] = element; /// filling up my dictionary
});
array2.forEach(element => {
if (cache[element]) {
intersectionOfArrays.push(element);
}
@eduarmreyes
eduarmreyes / poketrack-settings.txt
Created February 18, 2018 14:18
PokéTrack favorite Pokés
document.getElementById('cfs_393').checked = true
document.getElementById('cfs_398').checked = true
document.getElementById('cfs_403').checked = true
document.getElementById('cfs_404').checked = true
document.getElementById('cfs_405').checked = true
document.getElementById('cfs_406').checked = true
document.getElementById('cfs_407').checked = true
document.getElementById('cfs_412').checked = true
document.getElementById('cfs_413').checked = true
document.getElementById('cfs_417').checked = true
@eduarmreyes
eduarmreyes / solution.js
Created June 29, 2017 20:47
Equid: Find an index in an array such that its prefix sum equals its suffix sum.
```
This is a demo task.
A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of higher indices, i.e.
A[0] + A[1] + ... + A[P−1] = A[P+1] + ... + A[N−2] + A[N−1].
Sum of zero elements is assumed to be equal to 0. This can happen if P = 0 or if P = N−1.
For example, consider the following array A consisting of N = 8 elements:
A[0] = -1
@eduarmreyes
eduarmreyes / a_f.js
Created June 23, 2017 21:05
Array Flatten using Javascript
(function() {
function f_a(a, result = []) {
a.map(function(e) {
if (Array.isArray(e)) {
result.concat(f_a(e, result));
} else {
result.push(e);
}
});
return result;