Skip to content

Instantly share code, notes, and snippets.

Knock Frontend Screening - Analytics

This project should take between 2 - 4 hours to complete. Your project will be evaluated on presentation, code quality, testing, and documentation.

Deliverable

Our customers want a simple reporting application which displays a table of data and a filter.

MVP Requirements

  • Built in React
import React, {Component} from 'react';
export default class ResourceBill extends Component {
constructor(props) {
super(props);
this.state = {
resource: props.resource,
billing_records: [{}]
};
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
{
"Records": [
{
"eventVersion": "1.05",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDAI5HSV5Q3AL3LD7SNA",
"arn": "arn:aws:iam::836073662699:user/svc-lookglass-prd",
"accountId": "836073662699",
"accessKeyId": "AKIAIYTEDDZFXFO2MOKA",
{
"Records": [
{
"eventVersion": "1.05",
"userIdentity": {
"type": "AWSService",
"invokedBy": "ec2.amazonaws.com"
},
"eventTime": "2017-09-19T23:59:46Z",
"eventSource": "sts.amazonaws.com",
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
import datetime
import logging
import struct
import sys
import os
sys.path.append("lib")
import httplib2
from googleapiclient import http
import json
import boto3
import os
import logging
from clumpy.google import service
from clumpy.google.models import BigQuery_Job
from clumpy.google.storage import delete_object
from clumpy.amazon.dynamodb import put_item
from clumpy.amazon.cloudwatch import write_metrics
def test_handler(self):
...
with patch.dict("os.environ", {"jobs": self.queue_name}):
with patch("clumpy.google.service", service):
job_check.handler({}, FakeContext(10))