Skip to content

Instantly share code, notes, and snippets.

View ericnormand's full-sized avatar

Eric Normand ericnormand

View GitHub Profile
@ericnormand
ericnormand / graphy-modules.md
Last active May 11, 2026 23:18
Graphy Modules (May 11, 2026 11:23AM)

Graphy module dependency report — 2026-05-11

⚠️ Module ownership in this report comes from :team in .clj-kondo/config/modules/config.edn. The Engineering & Product Playbook is canonical — if a module owned by Graphy is missing here, its :team tag in the kondo config is wrong or absent.

Var-level edges come from clj-kondo :var-usages analysis over src/ and enterprise/backend/src/. An edge with no listed vars indicates a :require that doesn't actually call anything (likely a load-time side effect).

Regenerate with clj -X:dev dev.team-report/-main :path '"graphy-modules.md"' :team '"Graphy"'.

Summary

# Coffee shop scenario
Background: *This scenario is from a self-service ordering touchscreen at a coffee shop that you are assigned to develop. Jill is a customer who wants some coffee.*
Operation set:
(defn create-order []) ;;=> Order
(defn add-coffee [order coffee]) ;;=> Order
(defn order-price [order]) ;;=> Price
(defn remove-coffee [order coffee-index]) ;;=> Order
# Coffee shop scenario
Background: *This scenario is from a self-service ordering touchscreen at a coffee shop that you are assigned to develop. Jill is a customer who wants some coffee.*
Jill starts to order some coffee at the touchscreen. She adds a small, dark roast. Then
she adds a large medium roast with double almond syrup. She adds a
medium medium roast with two soy milk shots (the second one by
accident). She reads the price and it's too expensive. So she removes
the second coffee (the one with the almond syrup). Then she realizes
the third coffee has two soy milk shots and she removes one. The price
@ericnormand
ericnormand / coffee-scenario.md
Last active October 9, 2025 01:50
Coffee Shop Scenario

Coffee shop scenario

Jill starts to order some coffee. She adds a small, dark roast. Then she adds a large medium roast with double almond syrup. She adds a medium medium roast with two soy shots (the second one by accident). She reads the price and it's too expensive. So she removes the second coffee (the one with the almond syrup). Then she realizes the third coffee has two soy shots and she removes one. The price looks good, so she submits the order.

@ericnormand
ericnormand / mealPrep.js
Last active November 27, 2024 21:38
Minimal meal prep times for two stoves
/**
// Using number of minutes for prep time
mealPrep([120])
2 // one single long dish
mealPrep([30, 30, 30, 20])
2 // multiple shorter dishes
^
I don't understand, this should take 60 minutes.
@ericnormand
ericnormand / 00 Super Digit.md
Created September 12, 2022 15:11
478 Eric Normand Newsletter

Super Digit

This is kind of a contrived problem, but it's the kind that breeds lots of interesting implementations and tests your understanding of lower-level details. So let's do it!

You're given an integer n and an integer k. There is an integer p that is k instances of the digits of n concatenated together. For example:

@ericnormand
ericnormand / 00 Box of chocolates.md
Created September 4, 2022 16:02
477 Eric Normand Newsletter

Box of chocolates

You work at a chocolate shop that makes two sizes of chocolates:

  • Small (2 grams each)
  • Large (5 grams each)

When someone orders a box of chocolates, they order by total mass. It's your job to figure out how to fulfill the order using a combination of small and large chocolates to exactly hit the total mass ordered.

@ericnormand
ericnormand / 00 How many digits.md
Last active December 5, 2022 12:05
476 Eric Normand Newsletter

How many digits?

Imagine you took all the integers between n and m (exclusive, n < m) and concatenated them together. How many digits would you have? Write a function that takes two numbers and returns how many digits. Note that the numbers can get very big, so it is not possible to build the string in the general case.

Examples:

(num-digits 0 1) ;=> 0 (there are no integers between 0 and 1)
(num-digits 0 10) ;=> 9 (1, 2, 3, 4, 5, 6, 7, 8, 9)
(num-digits 9 100) ;=&gt; 180
@ericnormand
ericnormand / 00 Least common multiple.md
Created August 22, 2022 01:59
475 Eric Normand Newsletter

Least common multiple

Write a function that finds the least common multiple of a collection of numbers. Remember that the least common multiple is the smallest integer that is evenly divisible by all the numbers in the collection.

Examples:

(lcm []) ;=> nil (undefined)
(lcm [10]) ;=> 10
(lcm [2 4]) ;=&gt; 4
@ericnormand
ericnormand / 00 Simplifying fractions.md
Created August 8, 2022 03:00
473 Eric Normand Newsletter

Simplifying fractions

A harder one for this week.

Fractions are often represented in simplified form, where the numerator and denominator share only the factor 1. Write a function simplify that takes two integers (representing the numerator and denominator) and simplifies the fraction they represent, returning the two numbers.

Examples

;; the fraction 10/10