Running AI and Similarity Checks on Take-Home Interview Code

Two candidates, two different final-round take-homes, same job posting. Both Python. Both passed the tests. Both named their batch-normalization helper _proc_batch_norm, which is not a name anyone reaches for by accident. I found it because I diffed the two repos on a hunch, and the hunch took four minutes to confirm.

That was 2023. We were hiring two backend engineers and had 41 take-home submissions in flight. We had no take-home code plagiarism check, no AI pass, and no written policy. What we had was me, a terminal, and a growing suspicion.

Here's the workflow we ended up with, mostly because I run a bootcamp and needed the same machinery for cohort submissions anyway. It's not glamorous. It lives in a hiring/ folder next to a README nobody reads, and it works.

Why take-homes are the softest target in a hiring pipeline

Live coding is proctored. Contract work comes with a paper trail. The take-home sits in the middle: three to five days of unobserved effort, a candidate with a browser tab open to a chat model, and a submission you evaluate as evidence of authorship and evidence of skill at the same time. If the first is wrong, the second is worthless.

I'm not going to argue that take-homes are broken. They're the best predictor of real work I've found, and I've hired more good engineers through them than through whiteboard rounds. But the assumption that the artifact you received was written by the person who submitted it is load-bearing, and in most companies it's untested.

The score never decides anything. The score tells you which four submissions to read carefully. That's the whole job.

What a take-home code plagiarism check actually compares

People collapse this into one question ("did they cheat?") and then get confused when the tools disagree. They disagree because they're answering different questions.

Peer overlap asks: is this submission too similar to another submission in the same batch? That's token-level and structural comparison between files you already hold. It's the cheapest signal and the most reliable, because you control both sides of the comparison.

Web and repository overlap asks: does a meaningful chunk of this file appear on GitHub, Stack Overflow, or some tutorial site? Copying a retry_with_backoff decorator from a well-known gist is, in most take-homes, fine and expected. Copying the whole service layer is not. The useful signal isn't "match found," it's what fraction of the submission is matched and where.

AI generation asks a statistical question about the text itself: does this look like sampled output from a language model? That's the noisiest of the three and the one people over-trust.

Run all three. Not because any single one is decisive, but because the interesting cases are the ones where two of them fire at once.

Make the submission checkable before you make it clever

The cheapest upgrade to your process costs nothing and happens in the job posting. Ask for a git repository, not a zip. Ask for commits as they go, not one commit called "solution."

I don't need elaborate proof of authorship. I need a git log where the timestamps make sense and where at least one commit message is a bad one. Real work has bad commit messages. "fix" at 11:40pm is worth more as a signal than any detector output.

If you want to enforce it, a pre-receive hook on a private GitLab project takes twenty minutes to write:

#!/usr/bin/env python3
# pre-receive hook: flag a suspicious single-push take-home
import sys, subprocess

for line in sys.stdin:
    old, new, ref = line.split()
    if old == "0" * 40:
        continue  # branch creation, fine
    count = subprocess.run(
        ["git", "rev-list", "--count", f"{old}..{new}"],
        capture_output=True, text=True,
    ).stdout.strip()
    if count and int(count) > 40:
        print("Pushing more than 40 commits at once. Please commit as you work.")
        sys.exit(1)
sys.exit(0)

We shipped this in v0.4.2 of our internal tooling with a bug that rejected any commit signed with an SSH key, which is how I learned that nobody reads hook error messages. Fixed a week later. The approach still stands.

Run the batch as a cohort, not candidate by candidate

This is the part people get wrong. Similarity is a comparison, so you need something to compare against. Checking one candidate's repo in isolation tells you almost nothing about plagiarism and a fair amount about code style.

What works: for a given role, hold the take-homes until the batch closes, then run the whole set through a source code plagiarism checker as one group. Forty submissions for one role means 780 pairwise comparisons, and the outliers surface immediately. A submission scoring 0.3 against one peer and 0.02 against everyone else is a coincidence. One scoring above 0.7 against another submission in the same batch is not.

Keep last year's batch, too. Candidates talk. The person who did this role in 2024 has a repo that someone in 2025 might have been shown.

Codequiry smart review queue ranking submissions by cohort outlier score, topped by a 100% match
The smart review queue: cohort outliers ranked by priority, so a TA reviews the riskiest five, not all fifty.

Rank, don't threshold. What you want out of this is a queue of the ten most suspicious submissions with a human at the end of it, not a blocklist generated by a number. Codequiry's smart review queue does roughly this shape: sort by cohort outlier score, worst first, and let the reviewer open the actual diff. It's what I would have built myself if I'd had a spare week.

Where AI detection holds up, and where it doesn't

I've looked at several hundred AI scores on take-home code at this point, and the honest summary is that the tooling is useful in a narrower band than vendors imply.

It's strong on whole-file generation with light edits. A 200-line OrderService that a candidate pasted from a chat window and then renamed two variables will light up consistently. It's strong on the tells that survive editing: uniform docstring coverage on every public method, defensive validation on arguments that can't be invalid, and a test suite that covers only the happy path but covers it very thoroughly.

It's weak on AI-assisted work, which is most of what you'll actually see. Someone who wrote the algorithm by hand and used Copilot to fill in dataclass boilerplate has an AI score that means nothing, because there is nothing there to detect. That's also, for the record, how a good chunk of your current engineering staff works.

So the score isn't the finding. The finding is the conversation it triggers.

Codequiry per-file AI analysis showing AI versus human probability for each file with written indicators
Drilling into one submission: per-file AI and human probabilities, each with the stylistic indicators behind the score.

Per-file scores matter more than the aggregate. One file at 0.9 with the rest at 0.1 is a different story from a uniform 0.6 across the repository, and the uniform case is usually a false positive from a candidate with a very consistent style, often someone who learned to code in a language with strict formatting conventions and carried the habit over. I'd rather see the distribution than a headline number every time.

The fifteen-minute call is still the best detector

No model outperforms a senior engineer asking "walk me through why you made _cache a class attribute instead of passing it in." People who wrote the code can answer that. People who copied it can't, and the failure mode is usually not a stumble. It's a smooth, plausible, wrong answer that has nothing to do with the code on the screen.

A few questions that have earned their keep:

  • Why is this function 60 lines? What did you try first?
  • Point at the one place you'd refactor if you had another hour.
  • What broke while you were writing this, and how did you find it?
  • If I asked you to add pagination to list_orders, where would it go?

The last one is the tell. Someone who copied a solution can explain code they've read. They can't extend it.

Write the policy before you need it

I watched a company rescind an offer on the strength of a similarity score with no written policy behind it, and it went badly for everyone. The candidate had, it turned out, been given the same take-home by two companies a month apart and reused their own prior solution. That isn't misconduct. That's a Tuesday.

Before you run any of this, write down three things: what counts as a violation, what the consequence is, and what happens when a score is ambiguous. Then give candidates the policy. "We may compare your submission against other submissions for this role" is one sentence, and it changes the character of every later conversation you have about the result.

Keep the score out of the rejection. The score opens an investigation. The investigation closes it, and sometimes the investigation closes it by concluding nothing happened.

A small triage script

If you're doing this more than twice a year, automate the boring part. Pull the batch results from an API and sort them, so the human hours go to review instead of spreadsheet cleanup.

import os, requests

API = "https://api.codequiry.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['CODEQUIRY_KEY']}"}

def triage(check_id, peer_threshold=0.65, ai_threshold=0.80):
    r = requests.get(f"{API}/checks/{check_id}/results", headers=HEADERS)
    r.raise_for_status()
    rows = []
    for sub in r.json()["submissions"]:
        peer = max((m["score"] for m in sub.get("peer_matches", [])), default=0.0)
        ai = sub.get("ai_score") or 0.0
        web = sub.get("web_score") or 0.0
        if peer >= peer_threshold or ai >= ai_threshold or web >= 0.5:
            rows.append((sub["student"], peer, web, ai))
    return sorted(rows, key=lambda t: (-t[1], -t[3]))

for name, peer, web, ai in triage(os.environ["CHECK_ID"]):
    print(name.ljust(24), f"peer={peer:.2f}", f"web={web:.2f}", f"ai={ai:.2f}")

Two notes on that. The web threshold of 0.5 is deliberately low, because a matched chunk on GitHub deserves a look even when it's a small fraction of a large repo. And the sort puts peer overlap first, because among the three signals it's the one that's hardest to explain innocently.

Codequiry API keys page with a masked key, signed webhook configuration and API resources
The API surface: an account key, signed webhooks for finished checks, and docs for wiring scans into CI.

If you're on the education side rather than the hiring side, the same shape applies with different thresholds. A cohort of 60 students told to collaborate on environment setup but not on solutions will generate a lot of low-level peer noise you should ignore and a handful of cases you shouldn't. The code plagiarism checker for teachers view sorts by cohort outlier for exactly this reason.

What I'd tell the next person setting this up

Start with the git history requirement and the peer batch check. Those two cost almost nothing and catch most of what you'd want to catch. Add the AI code detector after you've written the policy, not before, because a score you don't know how to interpret is worse than no score at all. We ran ours for a full hiring cycle as a shadow signal before anyone was allowed to act on it, and we were wrong about four of the first six flags.

And keep the call. Detectors are good at telling you where to look. The conversation is where you find out what's actually there.

Frequently Asked Questions

Can you tell if a take-home coding assignment was written by ChatGPT?

Often, but not reliably, and reliability drops sharply once the candidate edits the output. Whole-file generated code with minimal changes produces strong statistical signals. A candidate who used Copilot for boilerplate and hand-wrote the logic is close to undetectable by AI scoring alone, which is why per-file scores and a follow-up interview matter more than an aggregate number.

Is it legal to run a plagiarism check on a candidate's take-home?

In most jurisdictions, yes, provided you disclose it in the application materials and don't make an automated rejection from it. Disclosure is what makes the practice defensible, and it's also what makes candidates take the exercise seriously. Check with counsel for anything involving candidates outside your home country.

How similar do two submissions have to be before it's a problem?

Above roughly 0.65 on a token-plus-structure comparison, with the caveat that shared boilerplate inflates scores in small programs. Below 0.3 you're almost certainly looking at coincidence. Between the two, open the diff: identical variable names in an unusual place mean far more than a high aggregate score.

If you want to see the batch view before you build your own, the team at Codequiry will run a sample cohort and hand you the report, and the API docs are public if you'd rather wire it up yourself first.