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
jrusev /
Last active Jan 19, 2016
Useful commands for working with Clojure in Emacs


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



Problem 1. Ransom note

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

Input: Integer greater than 0 and less than 4000.

Output: Integer greater than 0.


Input Output
583 53222000
888 544432221000
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 workers.go
package main
import "fmt"
import "time"
func f(in <-chan int, out chan<- int) {
for j := range in {
out <- j * 2

The Product Manager Interview


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


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'});
You can’t perform that action at this time.