What are we assessing:
- Ability to clarify requirements for vague requests
- Ability to design and clearly articulate a solution
- Ability to execute on the plan from step 2
Interview Structure:
Phase 1
| // upload-image.ts | |
| // Upload a file to S3 or Cloudflare R2 using Bun's built-in S3 client. | |
| // No third-party dependencies required. | |
| // | |
| // Usage: | |
| // bun run upload-image.ts <path-to-file> [key] | |
| // | |
| // Arguments: | |
| // <path-to-file> Local file to upload | |
| // [key] Optional S3 object key (defaults to the filename) |
| function handleHttpStatusSwitch(statusCode: number): string { | |
| switch (statusCode) { | |
| case 200: | |
| return 'OK - Request successful' | |
| case 201: | |
| return 'Created - Resource created successfully' | |
| case 202: | |
| return 'Accepted - Request accepted for processing' | |
| case 204: | |
| return 'No Content - Request successful but no content to return' |
| const direction = { | |
| '↑': [-1, 0], | |
| '↗': [-1, 1], | |
| '→': [0, 1], | |
| '↘': [1, 1], | |
| '↓': [1, 0], | |
| '↙': [1, -1], | |
| '←': [0, -1], | |
| '↖': [-1, -1], | |
| } satisfies Record<string, [number, number]> |
| class Heap<T> { | |
| #heap: (T | undefined)[] = [undefined] | |
| #prioritize: (a: T, b: T) => number | |
| constructor(prioritize: (a: T, b: T) => number, toHeapify: T[] = []) { | |
| this.#prioritize = prioritize | |
| this.#heap = [undefined, ...toHeapify] | |
| this.#heapify() | |
| } |
So let's say I'm building a website to tell me what I should wear based on the current weather (raining, sunny, snowing).
I only use the app once per day, and the weather won't change while I'm looking at the app, so the clothing choice should be constant.
I also want the code to be easy to read so other members of my team can easily understand the code.
Why is it cool?
| const pubSub = <UpdateType>() => { | |
| type Subscriber = ({ update, unsubscribe }: { update: UpdateType; unsubscribe: () => void }) => void | |
| const subscribers = new Set<Subscriber>() | |
| const subscribe = (sub: Subscriber) => subscribers.add(sub) | |
| const publish = (update: UpdateType) => { | |
| subscribers.forEach((sub) => { | |
| const unsubscribe = () => subscribers.delete(sub) | |
| sub({ update, unsubscribe }) |