Skip to content

Instantly share code, notes, and snippets.

View robconery's full-sized avatar
😍

Rob Conery robconery

😍
View GitHub Profile
@robconery
robconery / mission-interview-k-range.md
Created September 27, 2023 19:18
Mission K-Range

This one is a bit tougher so don't feel bad if you don't finish. Again: the point is to demonstrate your thinking process and that you ask enough questions and think things through before you write any code.

Here’s the question:

You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists.

Here's some sample code

// For example,
@robconery
robconery / mission-interview-all-numbers.md
Created September 27, 2023 19:16
Mission Interview All Numbers But This

Here's another practice question from Interview Cake, who kindly allowed me to use this other questions in this production.

Once again - I encourage you to do your best before watching all of the video. We can then try to solve it together!

Here’s the question:

Write a function getProductsOfAllIntsExceptAtIndex() that takes an array of integers and returns an array of the products.

Starter code:

@robconery
robconery / mission-interview-stocks.md
Created September 27, 2023 19:15
Mission Stock Price

OK grab your journal and dive in with me! I'll be solving this question by hand I urge you to do the same. I'll show you the solution near the end - but give it your best shot!

This question is from InterviewCake - thanks to Parker Phinney for permission to use. You can solve it there right now, if you like, as it’s part of the free questions.

Here’s the question:

Write an efficient function that takes stockPricesYesterday and returns the best profit I could have made from 1 purchase and 1 sale of 1 Apple stock yesterday.

Starter code:

@robconery
robconery / mission-interview-mindset.md
Created September 27, 2023 19:07
Mission Interview Mindset

I know you're wanting to jump right in and practice, but do yourself a favor and take a minute to get your head in the right place. So many people get super frustrated with this process and decide it's all a bunch of crap - and then they give up and either fail the interview or cancel before they get there.

Seriously - I can't tell you how many times I've heard a friend tell me how stupid Company X is becaust they wanted them to write a basic algorithm on the white board. The sentiment is always the same:

What does writing a search algorithm have to do with my job? NOTHING. Why are they even asking me this crap!

They're asking you these questions because, believe it or not, people like to lie on their resume. They don't know you and they especially don't know what you know. They want to be sure you can do the things you say you can do on your resume, so they're going to ask you to solve some problems.

So, deep breath. Let's do this - these are very good jobs and these companies want to pay you a

@robconery
robconery / chinook.sql
Created March 8, 2023 17:31
The Chinook/PG Database
This file has been truncated, but you can view the full file.
/*******************************************************************************
Chinook Database - Version 1.4
Script: Chinook_PostgreSql.sql
Description: Creates and populates the Chinook database.
DB Server: PostgreSql
Author: Luis Rocha
License: http://www.codeplex.com/ChinookDatabase/license
Modified By: John Atten
@robconery
robconery / Dockerfile
Last active September 11, 2022 06:43
Local Postgres with PGWeb
FROM postgres:14-alpine
COPY ff.sql /docker-entrypoint-initdb.d/seed.sql
ENV POSTGRES_USER=docker POSTGRES_PASSWORD=docker POSTGRES_DB=ff
EXPOSE 5432
const functions = require('firebase-functions');
const stripe = require("./lib/stripe");
exports.createCheckoutSession = functions.https.onCall(async (data, context) => {
console.log("Checkout session request incoming", data);
const res = await stripe.createSubscriptionCheckout(data);
return res;
});
@robconery
robconery / jsonb.js
Last active April 21, 2021 08:10
A Simple JSONB Module for Node
const runner = require("./runner");
const transformRecord = function(record) {
if (record) {
const doc = record.doc;
doc.createdAt = record.created_at;
doc.id = record.id;
return doc;
} else {
return null;
@robconery
robconery / ghost_azure.sh
Created April 10, 2019 01:42
Create a complete Ghost Website on Azure with Domain Assignment
RG="BLOG"
APPNAME="conery-ghost"
IMAGE=ghost
DOMAIN="ghost.conery.io"
DB_USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
DB_PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
DB_SERVERNAME=server$RANDOM
#You can get a list of locations by running
#az account list-locations --query [].name
tag:
git tag -l "deploy-$(date +%Y-%m-%d-%T)"
commit:
git commit -am "Deploying $(date +%Y-%m-%d-%T)"
build:
bundle exec middleman build
deploy: build commit tag