← Technical notes
Technical note1 diagram

Full-Stack Assessment: Performance Optimization & Live Debugging

Product engineer (candidate) — a timed take-home using Laravel and Next.js, a live technical session where a subtle bug surfaced, and the work I did afterward to reproduce, fix, and explain it clearly.

TL;DR

Take-home reflection: Laravel Http pooling, Next.js + SWR infinite scroll, live-session bug, and a concise post-interview follow-up.

live trace · Sequence viewfrom the original diagram
Next.js UI SWR UI Laravel API API External REST 01request paginated list, page N ◆ Cache? 03[hit] return cached JSON immediately 04[miss] GET /api/items with page and limit Risk: sequential detail calls inflate latency 06list endpoint returns batchidentifiers 07identifier rows for thecurrent page Laravel HTTP client concurrent pool parallel detail requests for each row 09detail payloads in completionorder Post-session fix map responses to stable indices, then merge 11single stable aggregate JSON 12hydrate list and images Skeletons, then Intersection Observer next page uses deduped SWR keys
  1. 01
    Next.js UI → SWRrequest paginated list, page N
  2. 02
    ◆ Cache?→ SWR → UI · return cached JSON immediately [hit]→ SWR → Laravel API · GET /api/items with page and limit [miss]
  3. 03
    SWR → UIreturn cached JSON immediately
  4. 04
    SWR → Laravel APIGET /api/items with page and limit
  5. 05
    Risk: sequential detail calls inflate latency→ API → External REST · list endpoint returns batch identifiers
  6. 06
    API → External RESTlist endpoint returns batch identifiers
  7. 07
    External REST → APIidentifier rows for the current page
  8. 08
    Laravel HTTP client concurrent pool · parallel detail requests for each row→ External REST → API · detail payloads in completion order
  9. 09
    External REST → APIdetail payloads in completion order
  10. 10
    Post-session fix · map responses to stable indices, then merge→ API → SWR · single stable aggregate JSON
  11. 11
    API → SWRsingle stable aggregate JSON
  12. 12
    SWR → UIhydrate list and images
  13. 13
    Skeletons, then Intersection Observer · next page uses deduped SWR keys
01

I am keeping this company-anonymous :

I am keeping this company-anonymous : no employer name, no verbatim brief, and no proprietary snippets. What follows is the engineering story—how I approached aggregation performance, UI stability, what broke under concurrency in the live session, and how I closed the loop with a written follow-up.

Challenge

Aggregation cost, UI churn, and a live race

The exercise required paginated data backed by a third-party REST API . A naive implementation naturally trends toward N+1-style latency when list rows each need a detail fetch. On the client, infinite scrolling plus image loading can cause layout shift if the UI does not reserve space. During the live session, stress on concurrent fetches exposed a bug: responses completed out of order, the merge step assumed stable ordering, and SWR revalidation briefly fought in-flight requests—producing inconsistent rows until refresh.

Solution

Pooling, skeleton-first UI, then a precise merge fix

On the server I replaced sequential per-row HTTP calls with concurrent requests via Laravel's HTTP client pooling so detail retrieval time tracks wall-clock parallelism instead of the sum of every round trip. On the client I used SWR for caching and deduplication, Intersection Observer to trigger the next page only when the sentinel enters view, and skeleton placeholders so the list height stays stable while data resolves. After the interview I reproduced the failure locally, fixed it by mapping pooled responses to explicit list indices before merge and tightening SWR keys so revalidation cannot clobber in-flight page fetches.

03

Impact

I treated the take-home as a chance to ship a small but coherent full-stack slice under time pressure—an honest best effort, not a claim to being flawless. After the interview, I still had open questions in my own head, so I went back, reproduced the issue locally, and tried to trace the cross-layer bug and write it up in plain language, mainly out of respect for the time the panel had already given me. I also documented where AI-assisted tooling helped (boilerplate, test scaffolding, wording)—and made clear it never replaced validating behavior against the network tab and server logs.

04

Communication — follow-up after the session

I sent a short email summarizing what I observed under concurrent fetches, the ordering assumption that made the merge step fragile, and the exact guardrails I added (index-keyed merge + safer SWR keys). I included a minimal repro path and what I would monitor in production (pool timeouts, partial failures, and cache invalidation). The goal was not to re-litigate the interview—it was to leave a clear, respectful paper trail that the panel could skim in two minutes.
05

Tools (used transparently)

Editor with inline assistance for repetitive typing, HTTP client docs for pool semantics, and browser devtools for waterfall verification. I treated AI like a fast scratchpad: suggestions still had to pass curl, logs, and UI behavior .

06

Technical architecture

One sequence view: cache-first reads, pooled backend aggregation, the ordering bug class I hit live, and how the UI stays stable while paginating.

← Technical notes on the home page