← Work

Case Study — 03

code.rajkar.dev.

A real-time collaborative coding interview platform, built after CodeSandbox killed live collaboration.

Role
Solo builder
Type
Personal
Period
2024 — Present
Stack
Next.js 16 · React 19 · TypeScript · CodeMirror 6 · Sandpack · PartyKit · Supabase · Zustand

01

The product

I run a lot of technical interviews at Metafic, and for years CodeSandbox was the tool: share a link, code together, watch the candidate's cursor. Then CodeSandbox removed real-time collaboration. StackBlitz had the same story, Replit was laggy, and everything else either demanded candidate sign-ups or had no session control. I ended up watching candidates type over Zoom screen share — no visibility, no way to jump in.

So I built my own. code.rajkar.me is a live coding interview platform: the interviewer creates a session, shares a six-character passcode, and the candidate is coding in seconds — no account, no email verification, nothing. Both sides see each other's cursors in real time, Google-Docs style. It supports React, React Native (with preview), and Node.js templates.

02

My role

Solo: product, design, frontend, real-time layer, persistence. It exists because I needed it, which kept the scope brutally honest — every feature maps to something that went wrong in a real interview.

03

The hard part

Remote cursors in CodeMirror 6. There's no built-in support, so I wrote a custom extension that uses StateEffects to inject cursor widgets as decorations — showing other people's cursors without ever touching the document itself. Cursor updates are debounced to 50ms to keep network traffic sane, and each cursor is color-coded and labeled.

Cursors are also file-aware: when the candidate switches files, their cursor must not ghost around in the file I'm looking at. Every cursor tracks which file it belongs to and only renders in that context. The other hard piece was instant session control — when I end a session, a WebSocket event blocks the candidate's screen immediately, no refresh, with their code preserved.

04

How it was built

The real-time layer is PartyKit — serverless WebSockets, so there's a globally distributed room server without me running infrastructure. Code execution and live preview run in the browser through Sandpack (CodeSandbox's own embeddable runtime — ironic, I know), with CodeMirror 6 as the editor and Zustand for client state.

Data loss in an interview is unacceptable, so persistence is dual: every keystroke goes to localStorage immediately, and the session syncs to Supabase every 30 seconds in the background. If the candidate's browser crashes, I can still read their last auto-save from the admin panel.

05

Outcome

It's live and it's what I actually use to run interviews now. Candidates join in seconds with zero friction, I can see their thought process instead of a shared screen, and sessions end cleanly with the code kept. Recording and replay are next on the list.

Visit live site ↗