Skip to content
Running interview video analysis on demand with Lambda and EC2

Running interview video analysis on demand with Lambda and EC2

· 2025-08-20

The previous article covered how we scored mock-interview videos: the specialised models, the timeline of text rows and the LLM scoring. This one is about how we ran it once it went live.

A candidate answers one question per video, so a finished interview is several videos, and each one goes through the full pipeline. Interviews didn't arrive on any schedule, several candidates could finish around the same time, and each of them was waiting for feedback. We wanted the videos from one interview processed in parallel, workers that only ran when there was an interview to process, and no interview holding up another.

A worker per interview

When an interview was submitted, the backend put a message on SQS. A Lambda function picked it up and launched an EC2 instance from a snapshot, with the interview ID in the instance's launch metadata. On startup, the instance queried its own metadata to find out which interview it had been launched for, then fetched the rest of the details from DynamoDB.

From there it pulled the interview's videos from S3 and processed them in parallel. Status and scores went to DynamoDB, SNS sent completion notifications and error alerts, and errors and progress were logged to CloudWatch. When it was done, the instance terminated itself.

We started on EC2 for two reasons. The proof of concept was already running on an EC2 machine, so a snapshot of it was the quickest way to production. EC2 also kept GPU instances open as an option if we needed them.

One instance per interview meant interviews didn't compete for the same machine, and a failure in one worker wouldn't directly interrupt another. The trade-off was that every interview had to wait for its instance to start and load the models before processing could begin. The number of instances was configurable, with an upper limit. In practice we never ran more than ten in parallel, so I can't say how the setup would have behaved much beyond that.

Orchestration: the backend puts a message on SQS, a Lambda launches one EC2 instance per interview with the interview ID in its metadata, and the instance reads its metadata, loads the interview from DynamoDB, processes the videos from S3 in parallel, saves scores, flags failed videos and terminates itself. A scheduled job terminates instances running longer than 15 minutes; flagged interviews are retried once, then go to manual review.

The happy path runs top to bottom inside the instance. The two paths at the bottom handle interviews and videos that didn't finish.

When an interview didn't finish

There were two ways processing could go wrong.

An instance could hang or crash partway through, and then it would never terminate itself. A scheduled job looked for any instance that had been running for more than 15 minutes, terminated it and flagged the interview, which was then retried automatically. If the retry also failed, the interview was flagged for manual review.

The other case was a single video failing while the rest of the interview processed fine. We kept the partial results and flagged the videos that weren't processed, which also sent them to manual review.

Picking an instance type

We started on t3 instances, and processing was slow. Moving to m4 helped, but a full interview still took around ten minutes, which felt too long for someone waiting for feedback. We tried GPU instances (g4dn.large and g4dn.xlarge), but they didn't give us a significant advantage, and the cost wasn't reasonable for what we got.

Running the fleet

Running our own EC2 fleet meant we owned the orchestration: launching instances, tracking them and cleaning up the ones that didn't finish. We were also concerned about account limits and instance availability in the region. We tried a spot fleet as a proof of concept, but it didn't go far, partly because of availability and partly because other deliverables took priority.

We later moved the workers off EC2, which I'll cover in a separate article.