Skip to content

Phase 3 — Technical DSA Round

Goal: Add technical_dsa as a fully functional stage type. Candidates complete LeetCode-style problems in an integrated IDE with automated test-case evaluation.


3.1 Backend — DSAProblem Service + Controller

GET  /v1/dsa-problems              — list (filterable by difficulty, tags, source)
POST /v1/dsa-problems              — create custom problem for org
GET  /v1/dsa-problems/:id          — detail view with visible examples (hidden test cases excluded)

Seed script: src/scripts/seedDsaProblems.ts — 20+ system problems across easy/medium/hard.


3.2 Backend — DSA Session Endpoints (No Auth)

GET  /v1/dsa/:token                — load problem list, starter code, time limits
POST /v1/dsa/:token/run            — run against visible test cases (non-final)
POST /v1/dsa/:token/submit         — final submission → run hidden test cases → store results

Code execution: integrate a sandboxed execution service (e.g., Judge0 self-hosted).


3.3 Backend — Automatic Expiry Cron Job

technical_dsa stages have dsaConfig.expiryHours. A cron job (runs hourly):

typescript
const expired = await Interview.find({
  stageTypeKey: 'technical_dsa',
  status: 'in_progress',
  expiresAt: { $lte: new Date() },
});
for (const interview of expired) {
  await Interview.findByIdAndUpdate(interview._id, { status: 'expired' });
  await CandidatePipeline.updateOne(
    { _id: interview.candidatePipelineId, 'stageProgression.interviewId': interview._id },
    { $set: {
      'stageProgression.$.status': 'expired',
      'stageProgression.$.candidateStatus': 'expired',
    }}
  );
}

3.4 Frontend — DSA Problem Picker in JobForm

When stageTypeConfig.questionBankConfig.questionType === 'dsa':

  • Render DSA problem picker (filterable by difficulty, tags)
  • Show estimated duration per problem
  • Show total estimated duration sum

3.5 Frontend — DSA Session Page

New public route: /dsa/:token

src/pages/DsaSession.tsx:

  • Monaco editor with language switcher
  • Problem statement panel
  • "Run" → test against visible examples
  • "Submit" → final evaluation
  • Timer countdown from session open time

Phase 3 — Acceptance Criteria

  • [ ] GET /v1/stage-types returns technical_dsa (available on all plans)
  • [ ] Recruiter can add DSA problems to a technical_dsa stage from the problem bank
  • [ ] Candidate receives email with DSA session link (token-gated, no auth)
  • [ ] Code runs against visible test cases via sandbox execution service
  • [ ] Final submission runs against hidden test cases; dsaSubmissions[].testResults stored
  • [ ] Sessions expire automatically after expiryHours; candidateStatus = 'expired'
  • [ ] Recruiter sees per-problem test pass rates in pipeline view (not raw scores to candidate)