PeerPrep

PeerPrep project preview

A platform for collaborative technical interview preparation

Project

Providing students a platform to practice coding interviews with peers

PeerPrep

PeerPrep project background

PeerPrep Collaborative Interview Prep

Overview

A platform where two users are matched and dropped into a live coding session with a shared editor, audio, and a curated question bank purpose-built for technical interview practice.

Technical Challenges

Collaborative Editing with CRDTs

Used Yjs (a CRDT library) synced over y-websocket to handle concurrent edits. CRDTs were chosen over OT because they resolve conflicts without a central coordinator, letting each peer apply remote operations out-of-order and converge to the same state critical for a real-time coding environment where network jitter is common.

Peer Matching Service

Matching is based on difficulty preference and topic tags. The matching service maintains per-category queues and attempts exact matches with a timeout, after which it relaxes constraints (drops topic requirement, then difficulty). Matched pairs are notified via Socket.io and a session record is created atomically to prevent double-matching.

Microservices & Orchestration

Services (User, Question, Matching, Collaboration, History) run as separate containers orchestrated with Kubernetes. Inter-service communication uses HTTP for synchronous calls and Socket.io rooms for real-time events. k8s readiness probes prevent traffic from reaching pods before their WebSocket servers are ready.

Audio Communication

Peer-to-peer audio is handled over WebRTC with the collaboration service acting as a signaling relay. The signaling channel reuses the existing Socket.io connection to avoid maintaining a separate WebSocket.

Polyglot Persistence

User accounts and session history are stored in PostgreSQL for referential integrity. The question bank uses MongoDB to accommodate flexible metadata schemas across different question types.

System Architecture

React Flow mini map
Frontend / ClientBackend ServicesExternal APIs / AIDatabases / StorageInfrastructure

Microservices deployed on Kubernetes. An API Gateway routes REST and WebSocket traffic to isolated services. Peer-to-peer WebRTC is negotiated via a signaling service; CRDT-based Y-WebSocket ensures conflict-free collaborative edits without locking.

Made with

MicroservicesSocket.ioNext.jsY-WebSocketDockerKubernetesMongoDBPostgreSQLWebRTC