Skip to main content

Backend - Rails & Node.js

Goal

The goal of the backend live coding interview is to evaluate the candidate's ability to design and implement scalable, maintainable, and secure backend solutions. This includes assessing their problem-solving skills, understanding of backend architecture, and ability to write clean, efficient code under time constraints.

Check general recommendations for Live Codings Interviews.

Areas of Focus

  • API design
  • API security
  • Persistence / queries (e.g., N+1 issues)
  • Data modeling and validation
  • Async execution
  • Error management
  • Code quality: Assess code style, structure, and readability
  • Testing strategies

Problem Statement

Design and implement a RESTful API for handling the following use cases:

  1. Initiate a call immediately: A doctor should be able to initiate a call with a patient on demand.
  2. End ongoing call: A doctor should be able to stop the ongoing call anytime.
  3. Fetch patient call history: Retrieve a log of all the calls made between a doctor and a patient.
  4. Update call details: The third-party provider will send a call summary, including the duration and transcript, via a webhook.

Webhook Request Example

{
"event_type": "call_update",
"call_id": "6ba3d52e-48b9-4900-845e-edd965109e86",
"status": "completed",
"duration": 123,
"transcript": ["Hey there!", "Hi!"]
}

Instructions for the Interviewer

Data Modeling

Data Models:

  • User: Represents an internal user or patient.
  • Call: Represents a call.
    • caller: User
    • callee: User

Use Cases

1. Start Call

What to Test:

  • Persistence / Data modeling
  • Tracking external IDs
  • Error management
  • Input validation (e.g., phone numbers)

Test Scenarios: (To be defined by the interviewer)


2. End Call

What to Test:

  • Update state
  • Error management

Test Scenarios: (To be defined by the interviewer)


3. List Calls

What to Test:

  • Filtering / Pagination
  • Parameter whitelisting
  • N+1 queries with caller / callee

Test Scenarios: (To be defined by the interviewer)


Webhooks

1. Get Call Summary

What to Test:

  • Security
  • Error management: How to avoid losing events
  • Async processing / jobs

Test Scenarios: (To be defined by the interviewer)

Other Questions:

  • How to detect if the event is never received?