# web dev

**URL:** https://forum.kirupa.com/c/programming/web-dev/42.md?page=15

[Latest](https://forum.kirupa.com/latest.md) · [Categories](https://forum.kirupa.com/categories.md)

**Page:** 16

---

## [Why is my optimistic cart update rolling back the wrong item?](https://forum.kirupa.com/t/why-is-my-optimistic-cart-update-rolling-back-the-wrong-item/680125)

<div class="topic-metadata">

**Author:** [@Ellen1979](https://forum.kirupa.com/u/Ellen1979)\
**Replies:** 2\
**Last updated:** [April 7, 2026, 8:42am UTC](https://forum.kirupa.com/t/why-is-my-optimistic-cart-update-rolling-back-the-wrong-item/680125 "2026-04-07T08:42:35Z")

</div>

Hey everyone, I’m wiring up a cart UI and trying to keep it snappy with optimistic updates, but when two quantity changes happen fast the rollback sometimes hits the newer value instead of the failed one. let cart = \[{ …

---

## [Why does this quickselect sometimes return the wrong kth value?](https://forum.kirupa.com/t/why-does-this-quickselect-sometimes-return-the-wrong-kth-value/680143)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 1\
**Last updated:** [April 7, 2026, 8:21am UTC](https://forum.kirupa.com/t/why-does-this-quickselect-sometimes-return-the-wrong-kth-value/680143 "2026-04-07T08:21:30Z")

</div>

Hey everyone, I’m wiring up a leaderboard helper and trying to avoid a full sort because the list can get pretty big, but my quickselect version occasionally returns the wrong item after a few swaps and that makes me ner…

---

## [Why does this heap-based merge skip some values?](https://forum.kirupa.com/t/why-does-this-heap-based-merge-skip-some-values/680131)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 1\
**Last updated:** [April 7, 2026, 4:21am UTC](https://forum.kirupa.com/t/why-does-this-heap-based-merge-skip-some-values/680131 "2026-04-07T04:21:28Z")

</div>

Hey everyone, I’m working on a small utility to merge several sorted arrays, and I’m using a min-heap so I don’t have to flatten everything first. It mostly works, but on duplicate values I sometimes lose items, which is…

---

## [Why is this topological sort saying there's a cycle when there isn't?](https://forum.kirupa.com/t/why-is-this-topological-sort-saying-theres-a-cycle-when-there-isnt/680127)

<div class="topic-metadata">

**Author:** [@WaffleFries](https://forum.kirupa.com/u/WaffleFries)\
**Replies:** 1\
**Last updated:** [April 7, 2026, 2:07am UTC](https://forum.kirupa.com/t/why-is-this-topological-sort-saying-theres-a-cycle-when-there-isnt/680127 "2026-04-07T02:07:37Z")

</div>

Hey folks, I’m wiring up a small task runner and trying to topologically sort job dependencies before execution, but this version keeps flagging a cycle on a graph that should be valid. I wanted something quick and simpl…

---

## [When does analytics instrumentation start distorting the product itself?](https://forum.kirupa.com/t/when-does-analytics-instrumentation-start-distorting-the-product-itself/680123)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 1\
**Last updated:** [April 7, 2026, 12:14am UTC](https://forum.kirupa.com/t/when-does-analytics-instrumentation-start-distorting-the-product-itself/680123 "2026-04-07T00:14:14Z")

</div>

Hey everyone, I’m working on a product flow redesign and trying to add more analytics so we can see where people drop off without flying blind. The part I’m stuck on is that every new event seems useful in isolation, bu…

---

## [Why does this rate limiter block requests longer than the window?](https://forum.kirupa.com/t/why-does-this-rate-limiter-block-requests-longer-than-the-window/680121)

<div class="topic-metadata">

**Author:** [@Quelly](https://forum.kirupa.com/u/Quelly)\
**Replies:** 1\
**Last updated:** [April 6, 2026, 11:42pm UTC](https://forum.kirupa.com/t/why-does-this-rate-limiter-block-requests-longer-than-the-window/680121 "2026-04-06T23:42:29Z")

</div>

Hey everyone, I’m wiring up a simple per-user rate limiter for a small API and trying to keep it cheap in memory, but right now it feels too strict after a burst and users stay blocked longer than I expect. class RateLi…

---

## [Why does this LRU cache evict the wrong key after a get?](https://forum.kirupa.com/t/why-does-this-lru-cache-evict-the-wrong-key-after-a-get/680119)

<div class="topic-metadata">

**Author:** [@MechaPrime](https://forum.kirupa.com/u/MechaPrime)\
**Replies:** 1\
**Last updated:** [April 6, 2026, 10:07pm UTC](https://forum.kirupa.com/t/why-does-this-lru-cache-evict-the-wrong-key-after-a-get/680119 "2026-04-06T22:07:27Z")

</div>

Hey everyone, I’m working on a small LRU cache for an API client, and I’m trying to keep it simple with a Map so reads stay fast. The weird part is that after I read a key, the next insert sometimes evicts that same key …

---

## [Why does this Dijkstra implementation lock in the wrong shortest path?](https://forum.kirupa.com/t/why-does-this-dijkstra-implementation-lock-in-the-wrong-shortest-path/680117)

<div class="topic-metadata">

**Author:** [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 10:00pm UTC](https://forum.kirupa.com/t/why-does-this-dijkstra-implementation-lock-in-the-wrong-shortest-path/680117 "2026-04-06T22:00:15Z")

</div>

Hey everyone, I’m wiring up a route finder for a small map tool, and my Dijkstra code mostly works until there are multiple entries for the same node in the heap. I skipped a decrease-key setup because life is short, but…

---

## [When does denormalizing product data stop paying off?](https://forum.kirupa.com/t/when-does-denormalizing-product-data-stop-paying-off/680113)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 9:21pm UTC](https://forum.kirupa.com/t/when-does-denormalizing-product-data-stop-paying-off/680113 "2026-04-06T21:21:13Z")

</div>

Hey everyone, I’m working on a catalog-heavy app and trying to decide how far to denormalize product data across search, listing, and recommendation paths. Reads get much simpler when each surface owns its own copy, but …

---

## [How to probe latent patterns in language models?](https://forum.kirupa.com/t/how-to-probe-latent-patterns-in-language-models/680118)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 1\
**Last updated:** [April 6, 2026, 9:07pm UTC](https://forum.kirupa.com/t/how-to-probe-latent-patterns-in-language-models/680118 "2026-04-06T21:07:13Z")

</div>

Sean Trifero sketches a way of probing LLMs sideways instead of just asking better direct. Sora :slightly\_smiling\_face:

---

## [When does a feature flag system become worse than just shipping slower?](https://forum.kirupa.com/t/when-does-a-feature-flag-system-become-worse-than-just-shipping-slower/680107)

<div class="topic-metadata">

**Author:** [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 8:49pm UTC](https://forum.kirupa.com/t/when-does-a-feature-flag-system-become-worse-than-just-shipping-slower/680107 "2026-04-06T20:49:07Z")

</div>

Hey everyone, I’m working on a product with more and more feature flags, and it started as a sane way to reduce rollout risk but now every release feels like we’re dragging around old branches and weird edge cases. The t…

---

## [When does adding retries make a product feel less reliable?](https://forum.kirupa.com/t/when-does-adding-retries-make-a-product-feel-less-reliable/680095)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 4\
**Last updated:** [April 6, 2026, 8:42pm UTC](https://forum.kirupa.com/t/when-does-adding-retries-make-a-product-feel-less-reliable/680095 "2026-04-06T20:42:12Z")

</div>

Hey everyone, I’m working on a small checkout flow right now, and I’m stuck on a product decision around automatic retries after failed requests. They can smooth over flaky networks, but they also seem to hide real failu…

---

## [Why does this cursor pagination helper repeat the last item on the next page?](https://forum.kirupa.com/t/why-does-this-cursor-pagination-helper-repeat-the-last-item-on-the-next-page/680111)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 8:19pm UTC](https://forum.kirupa.com/t/why-does-this-cursor-pagination-helper-repeat-the-last-item-on-the-next-page/680111 "2026-04-06T20:19:53Z")

</div>

Hey everyone, I’m working on a small API helper for cursor pagination, and I’m trying to keep it simple without loading extra rows in memory. The problem is I either miss an item or repeat the last one from the previous …

---

## [Why does this trie search miss words that are prefixes of longer words?](https://forum.kirupa.com/t/why-does-this-trie-search-miss-words-that-are-prefixes-of-longer-words/680115)

<div class="topic-metadata">

**Author:** [@WaffleFries](https://forum.kirupa.com/u/WaffleFries)\
**Replies:** 1\
**Last updated:** [April 6, 2026, 8:07pm UTC](https://forum.kirupa.com/t/why-does-this-trie-search-miss-words-that-are-prefixes-of-longer-words/680115 "2026-04-06T20:07:26Z")

</div>

Hey everyone, I’m working on a tiny autocomplete feature and switched from a plain array lookup to a trie so inserts stay cheap, but now some exact matches disappear when that word is also a prefix of a longer one. clas…

---

## [When does personalization start hurting trust more than it helps retention?](https://forum.kirupa.com/t/when-does-personalization-start-hurting-trust-more-than-it-helps-retention/680109)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 7:49pm UTC](https://forum.kirupa.com/t/when-does-personalization-start-hurting-trust-more-than-it-helps-retention/680109 "2026-04-06T19:49:08Z")

</div>

Hey everyone, I’m working on a product flow that personalizes the home screen based on a user’s first few actions, and it does lift short-term engagement a bit. The problem is it can also feel oddly pushy when the model …

---

## [Why does this debounce helper still fire on every keystroke?](https://forum.kirupa.com/t/why-does-this-debounce-helper-still-fire-on-every-keystroke/680088)

<div class="topic-metadata">

**Author:** [@Yoshiii](https://forum.kirupa.com/u/Yoshiii)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 5:56pm UTC](https://forum.kirupa.com/t/why-does-this-debounce-helper-still-fire-on-every-keystroke/680088 "2026-04-06T17:56:08Z")

</div>

Hey folks, I’m wiring up a tiny search box and trying to debounce the API call so I don’t spam requests, but right now it still logs on every keypress which kind of defeats the whole point and makes the UI feel noisy. f…

---

## [Why does this union-find count too many groups after merges?](https://forum.kirupa.com/t/why-does-this-union-find-count-too-many-groups-after-merges/680101)

<div class="topic-metadata">

**Author:** [@WaffleFries](https://forum.kirupa.com/u/WaffleFries)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 5:28pm UTC](https://forum.kirupa.com/t/why-does-this-union-find-count-too-many-groups-after-merges/680101 "2026-04-06T17:28:07Z")

</div>

Hey everyone, I’m working on a little connectivity checker for a grid game, and I’m trying to count how many separate groups are left after merging neighbors. The annoying part is it mostly works, but on a few inputs the…

---

## [How Planet of Lana II scaled its art direction?](https://forum.kirupa.com/t/how-planet-of-lana-ii-scaled-its-art-direction/680100)

<div class="topic-metadata">

**Author:** [@BobaMilk](https://forum.kirupa.com/u/BobaMilk)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 4:49pm UTC](https://forum.kirupa.com/t/how-planet-of-lana-ii-scaled-its-art-direction/680100 "2026-04-06T16:49:08Z")

</div>

This piece shows how the bigger art team shaped Planet of Lana II’s soft Ghibli-like look, with behind-the-scenes videos on environment art,. This behind-the-scenes look at Planet of Lana II really shows how much care…

---

## [Why does this binary search miss the last matching index?](https://forum.kirupa.com/t/why-does-this-binary-search-miss-the-last-matching-index/680104)

<div class="topic-metadata">

**Author:** [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 4:21pm UTC](https://forum.kirupa.com/t/why-does-this-binary-search-miss-the-last-matching-index/680104 "2026-04-06T16:21:20Z")

</div>

Hey everyone, I’m wiring up a quick search helper for a sorted list of order IDs, and I’m trying to return the last index of a target without scanning the whole array. The linear scan is safe but too slow for the hot pat…

---

## [Why does this heap-based scheduler skip a task after I reinsert it?](https://forum.kirupa.com/t/why-does-this-heap-based-scheduler-skip-a-task-after-i-reinsert-it/680071)

<div class="topic-metadata">

**Author:** [@Yoshiii](https://forum.kirupa.com/u/Yoshiii)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 3:56pm UTC](https://forum.kirupa.com/t/why-does-this-heap-based-scheduler-skip-a-task-after-i-reinsert-it/680071 "2026-04-06T15:56:09Z")

</div>

Hey folks, I’m working on a little task scheduler in TypeScript for practice, and I’m trying to use a min-heap so I can always grab the next task by time. The weird part is when I pop one task, update its time, and push …

---

## [Why does this topological sort return an order even when there’s a cycle?](https://forum.kirupa.com/t/why-does-this-topological-sort-return-an-order-even-when-there-s-a-cycle/680093)

<div class="topic-metadata">

**Author:** [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 3:35pm UTC](https://forum.kirupa.com/t/why-does-this-topological-sort-return-an-order-even-when-there-s-a-cycle/680093 "2026-04-06T15:35:09Z")

</div>

Hey everyone, I’m wiring up a small job dependency checker in JavaScript, and I want it to fail fast on bad input because a fake valid order would be worse than rejecting the whole batch. Right now this seems to return s…

---

## [When does eventual consistency stop being worth the confusion?](https://forum.kirupa.com/t/when-does-eventual-consistency-stop-being-worth-the-confusion/680099)

<div class="topic-metadata">

**Author:** [@ArthurDent](https://forum.kirupa.com/u/ArthurDent)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 2:49pm UTC](https://forum.kirupa.com/t/when-does-eventual-consistency-stop-being-worth-the-confusion/680099 "2026-04-06T14:49:10Z")

</div>

Hey everyone, I’m working on a small internal tool that syncs inventory across a few services, and I’m stuck on the part where eventual consistency stops feeling like a clever tradeoff and starts feeling like a bug with …

---

## [Why does this interval merge skip one overlap at the end?](https://forum.kirupa.com/t/why-does-this-interval-merge-skip-one-overlap-at-the-end/680077)

<div class="topic-metadata">

**Author:** [@MechaPrime](https://forum.kirupa.com/u/MechaPrime)\
**Replies:** 4\
**Last updated:** [April 6, 2026, 2:21pm UTC](https://forum.kirupa.com/t/why-does-this-interval-merge-skip-one-overlap-at-the-end/680077 "2026-04-06T14:21:10Z")

</div>

Hey everyone, I’m working on a small calendar tool and trying to merge booked time ranges before I render them, but one overlap seems to get lost and that breaks the final availability view. function mergeIntervals(inte…

---

## [Why does this quickselect sometimes return the wrong kth value?](https://forum.kirupa.com/t/why-does-this-quickselect-sometimes-return-the-wrong-kth-value/680097)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 1\
**Last updated:** [April 6, 2026, 12:14pm UTC](https://forum.kirupa.com/t/why-does-this-quickselect-sometimes-return-the-wrong-kth-value/680097 "2026-04-06T12:14:35Z")

</div>

Hey everyone, I’m working on a leaderboard feature and trying to grab the kth largest score without sorting the whole array, but my quickselect helper occasionally gives the wrong answer and that scares me more than the …

---

## [Why does this sliding window max keep dropping the current winner too early?](https://forum.kirupa.com/t/why-does-this-sliding-window-max-keep-dropping-the-current-winner-too-early/680073)

<div class="topic-metadata">

**Author:** [@MechaPrime](https://forum.kirupa.com/u/MechaPrime)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 12:00pm UTC](https://forum.kirupa.com/t/why-does-this-sliding-window-max-keep-dropping-the-current-winner-too-early/680073 "2026-04-06T12:00:09Z")

</div>

Hey everyone, I’m working on a small analytics helper and trying to compute the max for each window without rescanning, but my deque version goes weird when the old max sits near the left edge and I end up trading speed …

---

## [Why does this LRU cache evict the wrong key after a get?](https://forum.kirupa.com/t/why-does-this-lru-cache-evict-the-wrong-key-after-a-get/680086)

<div class="topic-metadata">

**Author:** [@sora](https://forum.kirupa.com/u/sora)\
**Replies:** 4\
**Last updated:** [April 6, 2026, 11:49am UTC](https://forum.kirupa.com/t/why-does-this-lru-cache-evict-the-wrong-key-after-a-get/680086 "2026-04-06T11:49:08Z")

</div>

Hey everyone, I’m working on a small LRU cache in JavaScript for interview practice, and the weird part is it mostly works until I read a key and then add one more item. I wanted O(1) behavior, but right now it feels lik…

---

## [Why does this BFS shortest-path helper return one extra step for reachable cells?](https://forum.kirupa.com/t/why-does-this-bfs-shortest-path-helper-return-one-extra-step-for-reachable-cells/680051)

<div class="topic-metadata">

**Author:** [@WaffleFries](https://forum.kirupa.com/u/WaffleFries)\
**Replies:** 4\
**Last updated:** [April 6, 2026, 10:56am UTC](https://forum.kirupa.com/t/why-does-this-bfs-shortest-path-helper-return-one-extra-step-for-reachable-cells/680051 "2026-04-06T10:56:08Z")

</div>

I’m computing the shortest path in a grid with BFS, but reachable cells sometimes come back with a distance that’s 1 too high. I expected the bottom-right cell here to be 4 steps away, but my function returns 5. Am I inc…

---

## [Why does this rate limiter keep blocking users after the window should reset?](https://forum.kirupa.com/t/why-does-this-rate-limiter-keep-blocking-users-after-the-window-should-reset/680090)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 2\
**Last updated:** [April 6, 2026, 10:49am UTC](https://forum.kirupa.com/t/why-does-this-rate-limiter-keep-blocking-users-after-the-window-should-reset/680090 "2026-04-06T10:49:08Z")

</div>

Hey everyone, I’m working on a small API gateway for a side project, and I’m trying to keep the rate limiter simple before I add Redis later. Right now it mostly works, but some users stay blocked longer than the window,…

---

## [What design interviews really assess under pressure?](https://forum.kirupa.com/t/what-design-interviews-really-assess-under-pressure/680074)

<div class="topic-metadata">

**Author:** [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)\
**Replies:** 5\
**Last updated:** [April 6, 2026, 10:28am UTC](https://forum.kirupa.com/t/what-design-interviews-really-assess-under-pressure/680074 "2026-04-06T10:28:09Z")

</div>

A designer explains that Google’s design challenge wasn’t about landing the perfect answer, but about showing clear thinking, tradeoffs, and how you handle uncertainty under pressure. https://uxdesign.cc/youre-not-suppo…

---

## [Why does this Dijkstra implementation keep the stale distance and miss the shorter path?](https://forum.kirupa.com/t/why-does-this-dijkstra-implementation-keep-the-stale-distance-and-miss-the-shorter-path/680075)

<div class="topic-metadata">

**Author:** [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Replies:** 3\
**Last updated:** [April 6, 2026, 9:49am UTC](https://forum.kirupa.com/t/why-does-this-dijkstra-implementation-keep-the-stale-distance-and-miss-the-shorter-path/680075 "2026-04-06T09:49:08Z")

</div>

Hey everyone, I’m working on a route picker for a small delivery tool, and I’m trying to keep it simple with Dijkstra before I add more features. The weird part is it looks fine on light cases, but once a node gets disco…

[Previous page](https://forum.kirupa.com/c/programming/web-dev/42.md?page=14)

[Next page](https://forum.kirupa.com/c/programming/web-dev/42.md?page=16)
