Skip to content

Instantly share code, notes, and snippets.

View e-l-i-s-e's full-sized avatar

Elise Bonner e-l-i-s-e

  • New York City, NY
View GitHub Profile

The DOM

Objective

Students will learn about the Document Object Model (DOM) and practice interacting with it using the developer tools and JavaScript, first in the browser console then using scripts.

In the workshop, students will create a jQuery-like class and methods that manipulate the DOM

Pre-work

Object Oriented Programming - Part I

Pre-Reading

The pre-reading (in the Learn Dot workshop) covers TDD, reading test specs, the prototype chain, factory functions, and constructor functions.

Instructors should open this repo to allow students to complete the "Reading Test Specs" exercises.

Learning Objectives

Toolbox Setup, Intro to HTML

Needs Statement

Students need to understand HTML as it forms the basis for the modern web documents. Students need to have the right tools to work with and view code effectively, including version control and other command line tools. In short, students need an Integrated Development Environment (IDE).

Objective

Articulating Learning Objectives

Effective course design begins with the question, what do I want my students to be able to do or produce by the end of this module?[1] In answering this question, you will articulate course aims and objectives that will guide your choice of topics to cover in each module.


How to Write Effective Learning Objectives

The most effective learning objectives include active verbs and measurable outcomes.

Slides

Prompt

Implement an immutable binary search tree class. The class constructor should accept (at least) a single argument which will represent the value for its root node. Each instance should have two methods: insert, which takes a numerical value and returns a new binary search tree containing that value, and contains, which takes a numerical value and returns true or false based on whether the tree contains it.

Insert should not mutate the existing binary search tree. That is:

const bstA = new ImmutableBST(5);

Prompt

Given an array of distinct items return the power set of the array. The power set of a set is the set of all possible subsets. Given the input array, produce an array where each item is an array representation of a possible subset. The order of the resulting array does not matter.

Examples

Prompt

Given an an array of numbers, find the length of the longest possible subsequence that is increasing. This subsequence can "jump" over numbers in the array. For example in [3, 10, 4, 5] the longest increasing subsequence (LIS) is [3, 4, 5].

Examples

longestIncreasingSubsequence([3, 4, 2, 1, 10, 6]);
// should return 3, the length of the longest increasing subsequence:
// 3, 4, 6 (or 3, 4, 10)

class: center middle

Solving Graphs


Interviewer Prompt

Write a function that determines if a path exists between two vertices of a directed graph.

The graph will be represented as an object, each of whose keys represents a vertex of the graph and whose value represents all vertices that can be reached from the aforementioned key.

@e-l-i-s-e
e-l-i-s-e / gist:b7f9522d799e6f6c6cf08e3c81ddb10d
Created November 18, 2018 20:14
Medium article example
if (action instanceof Promise) {
this.setState({
[`${name}Status`]: {
isLoading: true
}
});
return action
.then(() => {
this.setState({
[`${name}Status`]: {