Binary Search Variant With Lower Bound (JavaScript)
Find the leftmost position where a sorted array can accept a target using binary search with a lower-bound variant that returns insertion index for duplicates.
Find the leftmost position where a sorted array can accept a target using binary search with a lower-bound variant that returns insertion index for duplicates.
Generate a Gray code sequence of n bits using bit manipulation where consecutive values differ by exactly one bit.
Implement a bloom filter with k hash functions for probabilistic membership testing with a configurable false positive rate.
Implement a binary search tree supporting insert and delete where delete uses the in-order successor for two-child nodes.
Compute single source shortest paths in a weighted graph using Dijkstra algorithm with a binary min heap for efficient extraction.
Compute the Levenshtein edit distance between two strings with insert, delete, and substitute operations each costing one.
Find the shortest path in an unweighted graph using breadth first search with a predecessor map for path reconstruction.
Perform topological sort on a directed acyclic graph using depth first search with cycle detection via a tri-color marking scheme.
Implement a hash table with open addressing and double hashing for collision resolution supporting insert, lookup, and delete.
Sort an array by building a max heap in place then repeatedly extracting the maximum element to the end of the array.
Match a pattern in text using the Knuth Morris Pratt algorithm with a precomputed failure function for linear time matching.
Solve the 0-1 knapsack problem using dynamic programming with a one dimensional rolling array to reduce space complexity.
Compute the longest common subsequence of two strings using dynamic programming with full table reconstruction.
Count the number of inversions in an array using a modified mergesort that counts crossings during the merge step in O(n log n) time.
Generate all primes up to n using a segmented sieve of Eratosthenes for memory efficiency on large ranges.
Sort an array in place using quicksort with median-of-three pivot selection to avoid worst-case behavior on already sorted or reverse sorted input.
Find all occurrences of a pattern in text using the Rabin Karp algorithm with a rolling hash for O(n+m) average time complexity.
Implement a skip list supporting insert, delete, and search with probabilistic level assignment using geometric distribution.
Build a trie from a word list supporting prefix search and autocomplete suggestions ranked by word frequency.
Implement a disjoint set union find structure with path compression and union by rank for near constant amortized time.
Evaluate attribute-based access control policies over subject resource and action attributes for fine-grained authorization.
Configure an Apollo Client with in-memory cache error handling and typed queries for GraphQL data fetching.
Hash passwords with Argon2id using explicit memory time and parallelism parameters and verify with constant-time comparison.
Compose async generators into a pipeline for lazy streaming transformation with backpressure.
Implement an async mutex with FIFO fairness for exclusive access to shared resources without priority inversion.
Limit concurrent access to a resource with an async semaphore supporting acquire release and run helpers.
Add a response cache interceptor to Axios with TTL and cache key normalization for idempotent GET requests.
Apply exponential backoff retry to async methods via a decorator with per-method configuration and error filtering.
Collect items into a batch and flush by size threshold or timer whichever fires first for efficient bulk API submission.
Configure a BullMQ job queue on Redis with retry backoff concurrency and dead letter handling.
Create a generator that yields fixed-size chunks from an array for memory-efficient batch processing.
Implement a circuit breaker with closed open and half-open states that probes recovery with a single trial call before full traffic.
Parse CLI arguments with subcommands flags and positional args using a declarative spec for consistent tooling.
Build a consistent hash ring with virtual nodes for even key distribution and minimal remapping when nodes join or leave.
Configure CORS with explicit origin allowlist credential support and preflight caching for safe cross-origin API access.
Build Content-Security-Policy headers with nonces for inline scripts and strict directives to prevent XSS and data exfiltration.
Parse and transform CSV streams with header mapping type coercion and column selection for data pipelines.
Implement debounce firing on leading edge then trailing edge with cancel and flush for async event streams.
Deep clone objects using structuredClone with fallback for older runtimes handling cycles and typed arrays.
Compare nested objects for deep equality handling arrays dates maps and circular references without stack overflow.
Resolve configuration from defaults file environment and CLI args with explicit precedence and type coercion.
Create a typed event emitter supporting on once off and emit with listener count introspection for decoupled communication.
Evaluate feature flags with user segment rules percentage rollout and dependency checks for safe progressive delivery.
Stream uploaded files to disk with size limit magic byte validation and temp directory cleanup for safe multipart handling.
Validate form fields with composable rule functions that return typed errors and support async dependency checks.
Handle shutdown signals by draining in-flight connections with a timeout before force closing for zero-downtime deploys.
Group array items by a key function and count occurrences for aggregation summaries and frequency analysis.
Implement liveness and readiness probes with dependency checks and timeout for Kubernetes orchestration integration.
Compute HMAC signatures and verify with constant-time comparison to prevent timing attacks on webhook authentication.
Escape HTML special characters and strip dangerous tags from user input to prevent XSS in server-rendered templates.
Parse and verify a JWT signature expiry and custom claims with explicit clock tolerance and audience validation.
Emit structured JSON logs with levels context binding and sampling for production observability without blocking the event loop.
Implement an LRU cache using Map insertion order for O(1) get set and eviction with optional TTL expiry.
Create a memoizing wrapper with LRU cache bounded by max size and per-entry TTL eviction for caching expensive pure functions.
Build a Merkle tree from leaf hashes for tamper-evident integrity verification with efficient root comparison.
Build MongoDB aggregation pipelines with typed stages for filtering grouping and projection.
Parse multipart form data with per-field size limits field count cap and content type validation for safe uploads.
Parse newline-delimited JSON from a stream line by line with error recovery and batch emission for large files.
Safely omit or pick keys from objects returning typed results for immutable data transformation.
Create an observable from DOM events with takeUntil teardown for reactive stream composition and automatic unsubscription.
Resolve file paths within a base directory and reject traversal attempts using dot segments and symlink escape detection.
Use pg Pool for parameterized queries with connection pooling transaction support and error handling.
Implement a binary heap priority queue with push pop and peek supporting custom comparators for scheduling.
Run async tasks through a fixed concurrency pool with backpressure collecting results in order while limiting outstanding promises.
Implement a pub/sub channel with topic subscriptions message filtering and async event delivery for decoupled services.
Implement role-based access control with role hierarchy inheritance and permission resolution for authorization decisions.
Implement a read-write lock allowing concurrent readers or a single writer with upgrade support for shared state.
Create a Node.js Readable stream from an async generator with backpressure and cancellation support.
Acquire distributed locks across multiple Redis instances using the Redlock algorithm with quorum and TTL.
Retry an async function with exponential backoff full jitter and max attempts cap to handle transient errors without thundering herd.
Validate form input with Zod schemas using safeParse for typed error collection and automatic type narrowing.
Deduplicate concurrent identical calls to an async function so only one execution runs and all callers share its result.
Generate 64-bit Snowflake IDs with timestamp worker ID and sequence for sortable numeric unique IDs without coordination.
Build parameterized SQL queries with explicit placeholders to prevent injection while supporting dynamic WHERE and ORDER BY.
Compose Node.js streams with pipe and backpressure handling for memory-efficient data transformation.
Build a fixed-window throttle limiting calls per interval with trailing invocation for bounded request rates.
Cache with time-based invalidation supporting stale-while-revalidate for fresh data with background refresh.
Implement an async token bucket rate limiter that refills tokens at a fixed rate and awaits when empty to enforce sustained throughput.
Generate TOTP codes from a shared secret with time step and digit parameters and verify with window tolerance for clock skew.
Generate RFC 9562 UUIDv7 with Unix timestamp random counter and trailing randomness for time-ordered sortable identifiers.
Implement a WebSocket server with heartbeat ping pong timeout and broadcast for real-time communication.
Cap concurrent async tasks with a promise-based semaphore that queues waiters and releases permits safely.
Propagate a correlation id across async calls with AsyncLocalStorage so every log line carries the request identity.
Parse a single-range HTTP Range header, resolve open ends against a resource size and return a satisfiable byte range.
Keep the first occurrence of each log signature and sample the repeats, cutting volume while preserving new messages.
Interpret a Retry-After header as seconds or an HTTP date and cap the delay before the next retry attempt.
Enforce a per-key request rate limit with a sliding window of timestamps, smoothing the bursts a fixed window allows.
Parse and validate a W3C traceparent header into version, trace id, span id and flags, rejecting malformed values.
Verify a hex HMAC signature over a webhook body with a timestamp tolerance, using constant-time comparison.
Validate request bodies against JSON Schema compiled with AJV using OpenAPI component schemas, with fast paths and collected error details.
Buffer a stream of items into adaptive batches with async cargo, flushing on size or timing thresholds so slow items never block the queue.
Pull remote pages lazily through an async generator, batching records per yield so consumers control pacing and memory stays flat.
Race a promise against a timer so a slow dependency cannot hold a request open indefinitely, aborting the underlying signal when the deadline passes.
Implement response-layer retry in Axios via a custom interceptor with attempt counters, exponential backoff, and idempotency-aware opt-in.
Search a sorted array in logarithmic time, returning the index of a match or the insertion point when the value is absent.
Smooth bursty traffic with Bottleneck using a token reservoir, rolling rate limit, and prioritized scheduled jobs that respect a fixed quota.
Enqueue background jobs with BullMQ backed by Redis, configure exponential backoff retries, and process them in a worker with failure handling.
Parse fetched HTML with Cheerio to extract OpenGraph metadata, clean text, and attribute values without executing any page scripts.
Split an array into fixed-size batches for bulk inserts, pagination, or parallel processing without mutating the original input.
Define a GitHub Actions CI pipeline with a Node version matrix, dependency caching, conditional deployment job, and pinned action versions.