Skip to content

Instantly share code, notes, and snippets.

View robconery's full-sized avatar
😍

Rob Conery robconery

😍
View GitHub Profile
@robconery
robconery / sql-setup-pg.md
Created September 28, 2023 00:17
Setup Postgres

There are numerous ways to get a PostgreSQL server up and running - the easiest is usually your best choice!

I like to run Postgres locally, so I typically run Postgres.app because I'm working on a Mac. It's very flexible and is a drag/drop install.

You can also work with Docker if you like, but beware that you might run low on resources later in the course as we dive into millllllions of records. Here's a docker-compose file for you to get started with:

version: "3"
services:
  postgres:
@robconery
robconery / mission-interview-skeet-binary-tree.md
Created September 27, 2023 19:20
Mission Skeet Binary Tree

This question is seemingly simple:

Decide if a tree is a binary tree

and then…

Decide if the tree is balanced

Another super common question you will likely be asked in one form or another. Interviewers just LOVE questions about binary tree traversal!

@robconery
robconery / mission-interview-skeet-linter.md
Created September 27, 2023 19:18
Mission Skeet Linter

We're going to start Jon off with a bit of a softball, asking him to create a linter for C#. Here’s the question:

Create a linter for C# which ensures that code structures are balanced. Specifically, code blocks starting with (, { and [.

Normally this question would take a candidate about 30 minutes, even if they haven't studied their interview questions.

Code is just a string and we're checking to make sure that certain characters have their counterparts. How would you solve this? Think about it for a minute and see if your ideas match Jon's.

We'll be using C# for this and the rest of the questions.

@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 / CommandRunner.cs
Created February 22, 2015 12:16
Simple Data Access for Postgres and .NET
using Npgsql;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Massive
@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