Skip to content

Instantly share code, notes, and snippets.

Alicja Raszkowska trueskawka

Block or report user

Report or block trueskawka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View takehome-fp-interview.markdown

Take-home functional programming interview

This document is licensed CC0.

These are some questions to give a sense of what you know about FP. This is more of a gauge of what you know, it's not necessarily expected that a single person will breeze through all questions. For each question, give your answer if you know it, say how long it took you, and say whether it was 'trivial', 'easy', 'medium', 'hard', or 'I don't know'. Give your answers in Haskell for the questions that involve code.

Please be honest, as the interviewer may do some spot checking with similar questions. It's not going to look good if you report a question as being 'trivial' but a similar question completely stumps you.

Here's a bit more guidance on how to use these labels:

View keybase.md

Keybase proof

I hereby claim:

  • I am trueskawka on github.
  • I am trueskawka (https://keybase.io/trueskawka) on keybase.
  • I have a public key whose fingerprint is FB50 AD8C 7DDC 538D E585 4D00 93DB 3D63 245C 9B75

To claim this, I am signing this object:

@trueskawka
trueskawka / decode.cpp
Last active Jan 30, 2017
Decoding a message in C++
View decode.cpp
#include <cstdio>
int decode_number(int number, int mode)
{
char characters[] = { '!', '?', ',', '.', ' ', ';', '"', '\'' };
char letter;
if (mode == 0) {
number %= 27;
letter = 'A' + number - 1;
View checksum.cpp
#include <cstdio>
#include <utility>
int get_sum(int num)
{
num *= 2;
int sum = 0;
// if (num < 10) sum = num; else sum = num % 10 + 1;
View bf.ex
defmodule BF do
def new do
%{
tape: %{},
ptr: 0,
output: "",
stack: [],
code: []
}
end
@trueskawka
trueskawka / imvalue.py
Created Oct 15, 2016
infinite matrix brain teaser
View imvalue.py
def summation(n):
return ((n**2 + n)/2) + 1
def imvalue(i, j):
if ((j + i - 1) % 2 == 0):
return summation(j + i - 1) - i
else:
return summation(j + i - 1) - j
#edges that are starts of streams
@trueskawka
trueskawka / mergesort.py
Last active Oct 10, 2016
algorithms course - assignment 1
View mergesort.py
array = open("integerarray.txt")
number_list = array.read()
number_list = number_list.strip()
number_list = [int(i) for i in number_list.split('\n')]
def mergesort(splits, array):
array_length = len(array)
if array_length > 1:
middle = array_length//2
left_side = array[:middle]
View pairs.elm
import Html exposing (text)
import Set
import List
main =
-- text (toString (List.sum (pairs [1, 5, 3, 4, 2] 2)))
text (toString (List.sum (pairs [363374326, 364147530, 61825163, 1073065718, 1281246024,
1399469912, 428047635, 491595254, 879792181, 1069262793]
1)))
View hangman.py
n_guesses = 6
guesses = set()
word = "never graduate"
game_over = False
def print_game_state():
global game_over
correct = [c for c in guesses if c in word]
incorrect = [c for c in guesses if c not in word]
View piggy.py
#piggy - pig latin
#piggy("This is a string, yeah?")
#"Isthay isay a ingstray, eahyay?"
#separate words
#check if the first letter is capitalized
#regex - find first consonant group - from the start
#if there is one - move it to the back
#add "ay"
#capitalize if it was capitalized
You can’t perform that action at this time.