Skip to content

Instantly share code, notes, and snippets.

J R jrusev

Block or report user

Report or block jrusev

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 server.js
var http = require('http');
var port = 1234;
http.createServer(function (req, resp) {
var body = [];
req.on('data', function (chunk) { body.push(chunk); });
req.on('end', function () {
body = Buffer.concat(body).toString();
console.log({headers: req.headers, method: req.method, body: body});
resp.writeHead(200, {'Content-Type': 'text/plain'});
resp.end('OK');
View coding_problems_tests.md

problems

Problem 1. Ransom note

'one sentence from a magazine', 'ransom note' => True
'one payment', 'pay money' => False
'downpayment', 'pay now' => True
View pm_interview.md

The Product Manager Interview

Measure

  • product sense (discuss products, design, creativity, thinking from first principles)
  • execution/collaboration/metrics
  • analytical skills
  • technical depth

Questions

View workers.go
package main
import "fmt"
import "time"
func f(in <-chan int, out chan<- int) {
for j := range in {
time.Sleep(time.Second)
out <- j * 2
}
View parse.py
def parse(s):
"""Parse a JSON string containing only integers and arrays."""
return int(s) if s[0].isdigit() else parse_array(s, 1)[0]
def parse_array(s, i):
"""Return the array beginning at index i and the end index of the array."""
res = []
while s[i] != ']':
if s[i].isdigit():
start = i
View coding_problems.md

tests

Problem 1. Ransom Note

A kidnapper wishes to write a ransom note using letters from a magazine. Given the ransom note and the magazine, find if the kidnapper can write the note by cutting letters out of the magazine.

Problem 2. Brackets

View no_problem.md

Input: Integer greater than 0 and less than 4000.

Output: Integer greater than 0.

Examples:

Input Output
583 53222000
888 544432221000
@jrusev
jrusev / emacs-cmds.md
Last active Jan 19, 2016
Useful commands for working with Clojure in Emacs
View emacs-cmds.md
You can’t perform that action at this time.