Skip to content

Instantly share code, notes, and snippets.

View bcm's full-sized avatar

Brian Moseley bcm

  • Sixfold
  • New York,NY
  • 19:38 (UTC -04:00)
View GitHub Profile
@bcm
bcm / dapx-data-eng-coding-exercise.md
Last active April 24, 2024 14:52
Data Engineer Coding Exercise (American Express | Digital Acquisition Platform Excellence)

This exercise consists of developing a distributed Extract-Transform-Load (ETL) application.

Your application should ingest the data from a source relational database system and use a distributed data processing tool such as Apache Hadoop or Apache Spark to compute some statistics and output them in a form that can be loaded into some destination storage system for consumption.

Please write your application in Python, Java, Scala or Kotlin. The application must be buildable from the command line; it should not require an IDE to build or run.

The exercise should generally not take more than 3 or 4 hours, although you're free to take as much time as you'd like to work on it. If you don't finish within a few hours, that's okay; submit what you've got anyway.

Source database

@bcm
bcm / dapx-fullstack-coding-exercise.md
Last active April 15, 2019 21:19
American Express Coding Exercise: Full Stack Engineer, Digital Acquisitions Platform Excellence

For this exercise you will create a simple application to insert a record into a relational database through a short stateful web flow.

First, create a database table that holds records representing people.

  • A person record has a unique identifier and the following additional attributes:
    • name (string)
    • age (integer)
    • date of birth (date)
    • email address (string)
  • Email address has a unique constraint (case-insensitive).
@bcm
bcm / dapx-web-eng-coding-assignment.md
Last active April 15, 2019 21:19
Coding Assignment - Web Engineer, Acquisitions Engineering

For this exercise you will create a web page that embeds a photo carousel based on a Flickr gallery (Flickr API details here: https://www.flickr.com/services/api/flickr.galleries.getPhotos.html).

  1. Create a web page (the embedding page) that embeds the content of a second web page (the embedded page) in an iframe. The embedded page should allow the user to submit the ID of a Flickr gallery.
  2. When the user submits a gallery ID, the embedded page should fetch photos from the identified Flickr gallery and display them in thumbnail form in a photo carousel.
  3. When the user clicks on a thumbnail in the carousel to select it, the embedding page should be updated to display metadata about that photo, including the owner's name, the date it was taken, and the number of times the photo has been viewed.
  4. When the user clicks on a selected thumbnail to deselect it, the corresponding photo metadata should be cleared from the embedding page.

Hint: If you find yourself making more than one request to the

@bcm
bcm / dapx-srv-eng-coding-exercise.md
Last active April 15, 2019 21:20
Amex Digital Acquisition Coding Exercise: Service Engineer, Platform Excellence

For this exercise you will build a simple Java web service that provides CRUD-style API access to data stored in a relational database system.  

  1. Create a database table that holds records representing people.
    • A person record should have a unique identifier and the following additional attributes:
      • name (string)
      • age (integer)
      • date of birth (date)
      • email address (string)
    • Email address has a unique constraint (case-insensitive).
@bcm
bcm / dacm-app-eng-coding-exercise.md
Last active April 15, 2019 21:20
Application Engineer Coding Exercise (Amex DACM)

Coding Exercise

For this exercise you will create a simple web application that does the following:

  1. Allow the user to enter the URL of a public webpage.
  2. From the browser, fetch the page and display the raw (not rendered) source to the user.
  3. When the user clicks on the name of an HTML element in the displayed source, highlight every element in the displayed source with that name (e.g. clicking on an a tag causes that and all other a tags to be highlighted).

The exercise should generally not take more than 2 or 3 hours, although you're free to take as much time as you'd like to work on it. If you don't finish within a few hours, that's okay; submit what you've got anyway.

$ rails-api new api-server
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$ cd api-server/
@bcm
bcm / gist:3353209
Created August 14, 2012 21:30
Balanced pagination metadata
diff --git a/lib/balanced/pager.rb b/lib/balanced/pager.rb
index 2338d0e..9150592 100644
--- a/lib/balanced/pager.rb
+++ b/lib/balanced/pager.rb
@@ -34,17 +34,29 @@ module Balanced
load! unless @page
@page[:limit]
end
+ alias limit_value limit
@bcm
bcm / gist:3014652
Created June 28, 2012 23:17
Gemfile.lock for failing stamps test
PATH
remote: .
specs:
stamps (0.2.0.copious.0)
hashie (>= 1.0.0)
httpi (= 0.7.9)
json (>= 1.5.1)
multi_json (~> 1.0)
savon (>= 0.8.6)
@bcm
bcm / gist:3014649
Created June 28, 2012 23:17
rvm info for failing stamps test
ruby-1.9.3-p0@stamps:
system:
uname: "Darwin vrock.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"
rvm:
version: "rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]"
updated: "4 months 21 days 19 hours 38 minutes 20 seconds ago"
@bcm
bcm / ScalatePackage.scala
Created February 13, 2011 19:29
default imports for scalate templates
import org.fusesource.scalate.{Binding, TemplateSource}
import org.fusesource.scalate.support.TemplatePackage
class ScalatePackage extends TemplatePackage {
def header(source: TemplateSource, bindings: List[Binding]) = """
import in.outside.slingshot._, controllers._, helpers._, models._
import ru.circumflex.web._
"""
}