Rudiments

under construction

Fundamental concepts, best practices and 'etudes'

Algorithm Patterns

Two Pointers

def two_sum_sorted(arr: List[int], target: int) -> List[int]:
left = 0
right = len(arr) - 1

while left < right:
sum = arr[left] + arr[right]

if sum == target:
return left, right

if sum < target:
left += 1
else:
right -= 1

Binary Search

def binary_search(arr, target):
left = 0
right = len(arr) - 1

while left <= right:
mid = (left + right) // 2

if arr[mid] == target:
return mid

if arr[mid] < target:
left += 1
else:
right -= 1

return -1

Monotonic Binary Search

def binary_search(arr, target):
left, right = 0, len(arr) - 1
first_true_index = -1

while left <= right:
mid = (left + right) // 2

if feasible(mid):
first_true_index = mid
right = mid - 1
else:
left = mid + 1

return first_true_index

React Essentials

Performance Optimization

Techniques for optimizing React applications

State Management

When to use useState, useReducer, or external state management

Component Lifecycle

Understanding React component lifecycle and hooks

TypeScript Essentials

Null Handling Operators

optional chaining, nullish coalescing, and non-null assertion operators

Result Pattern in TypeScript

Combining public keyword parameter properties with the Result Pattern for clean error handling in APIs

JavaScript Fundamentals

Async Await Patterns

Best practices for handling asynchronous operations

ES6+ Features

Modern JavaScript features every developer should know

Node Fundamentals

File System Operations

Reading, writing, and managing files in Node.js applications

Node Web Servers

Building APIs and web servers with Node.js fundamentals