Skip to content

Instantly share code, notes, and snippets.

@mratzloff
mratzloff / challenge.md
Last active February 8, 2024 00:06
API Coding Challenge

REQUIREMENTS

This coding exercise is an opportunity for you to show us how you break down product requirements into actual code, as well as to demonstrate quality, coding style, experience, and creativity in problem solving. It will also introduce you to the Bitly API and expose you to some of the functionality the back-end team develops on a daily basis. This task is designed to be relevant to the kind of work backend engineers at Bitly do. You should not expect there to be any gotchas.

Bitly Access Token

  • In order to make use of our API, you will need a Bitly Access Token.
    1. Sign up for a Bitly account if you do not already have one.
    2. Visit this page to get your Access Token.
  • Due to security concerns, do not include your access token as part of the submission. We will immediately reject any submission containing an access token!!!
package main
import (
"crypto/rand"
"fmt"
log "github.com/cihub/seelog"
"io"
"os"
)
@mratzloff
mratzloff / validateCreditCard.js
Created February 2, 2012 18:10 — forked from petercowan/luhnCheck.js
Luhn check for jQuery-Validation-Engine
var validateCreditCard = function(field, rules, i, options) {
var valid = false,
cardNumber = field.val().replace(/ +/g, "").replace(/-+/g, "");
var numDigits = cardNumber.length;
if (numDigits >= 14 && numDigits <= 16 && parseInt(cardNumber) > 0) {
var pos = 1;
var luhn = "";
for (var i = numDigits - 1; i >= 0; i--) {
var digit = parseInt(cardNumber.charAt(i));