Screening Take-Home Coding Submissions for AI-Generated Code

Thirty-eight take-homes went out last quarter. Seven came back above our AI threshold of 0.72. Three of those turned out to be real: candidates who'd pasted a ChatGPT session into the repo, comments and all. Two were false positives. The remaining two we never resolved, and both candidates took other offers before we finished the conversation.

Detecting AI-generated code in take-home submissions comes down to three things: a detector that scores per file rather than per submission, a threshold you've calibrated against your own past candidates, and a human who reads the flagged diff before anyone says a word to the candidate. Skip the third and you'll lose a good hire over a Javadoc block.

What follows is the workflow we run today at a ~600-person fintech, warts included. It's a GitHub Actions job plus a Python wrapper around an API, roughly 200 lines total, and it's been through three rewrites since February.

What the take-home actually asks for

The exercise is a small Java 17 service: parse a CSV of transactions, apply a set of categorization rules, expose two REST endpoints, write three tests. Four-hour timebox, no framework scaffolding provided beyond a Maven skeleton, and a README that says plainly that submissions are scanned for both similarity and AI assistance. We put that sentence in writing the same week we started screening. If a candidate doesn't want to be scanned, they can ask for a live pairing session instead, and two have.

Roughly 40 files come back per candidate once you count the test fixtures and the generated Maven wrapper. That matters, because per-file scoring is where the useful signal lives. A submission-level score of 0.65 tells you almost nothing. A submission where sixteen files sit at 0.12 and one service class sits at 0.94 tells you exactly where to look.

How we detect AI-generated code in take-home submissions

The scan runs after the deadline, not on every push. Early on we had it fire on each commit and it was useless: you get a score on work-in-progress code, and half the time the "AI-written" file was a stub the candidate deleted an hour later. One job at the deadline, one artifact, one Slack message to the private hiring channel.

import os, tarfile, requests

API = "https://api.codequiry.com/v1/checks"

def submit(repo_dir, candidate_id):
    archive = f"/tmp/{candidate_id}.tar.gz"
    with tarfile.open(archive, "w:gz") as tar:
        tar.add(repo_dir, arcname=".")
    with open(archive, "rb") as fh:
        r = requests.post(
            API,
            headers={"Authorization": f"Bearer {os.environ['CODEQUIRY_API_KEY']}"},
            files={"file": fh},
            data={
                "name": f"takehome-{candidate_id}",
                "language": "java",
                "engines": "ai,peer,web",
            },
            timeout=90,
        )
    r.raise_for_status()
    return r.json()["check_id"]

The exact payload shape is in their docs and it has changed once since we integrated, so pin the wrapper to a tested version and don't let a renovate bot bump it unattended. We learned that the boring way: a Tuesday where every check in the pipeline returned a 422 and nobody noticed until Thursday because the workflow was set to continue-on-error: true.

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.

A 40-file Java repo finishes in about ninety seconds. We poll, dump the JSON to an artifact, and post a one-line summary. Nothing in that summary says "reject" or "pass." It says a number and a link.

Where we compare: MOSS has been the academic default since 1994 and still does peer similarity well, but it has no AI signal, no HTTP API you'd want to depend on, and output that lands as a scatterplot in an email. Turnitin handles prose competently and code poorly. If you're building this into a hiring pipeline rather than a course, you want an API-first tool. Codequiry covers both AI generation and peer/web similarity in the same check, which means one artifact, one review surface, and one place to argue about thresholds. That consolidation is the actual reason we picked it, not any single score.

Setting thresholds against your own history

Our first threshold came from a single blog post and was wrong. We set it at 0.55, flagged 40% of candidates, and spent six weeks escalating borderline cases to a human review that didn't need to happen. There was a STRICT_MODE = True constant buried in the config module that our staging deploy had been reading since March.

What we have now, after re-scoring 140 historical submissions we'd already made offers on:

Average file AI scoreWhat we doObserved hit rate
0.00 to 0.45Nothing. Straight to the hiring manager.4 of 118 proved to be AI-assisted
0.45 to 0.72Logged, not flagged. Reviewed only if the interview goes badly.5 of 16
0.72 to 0.90Manual read of the top three files before any interview is scheduled.9 of 13
Above 0.90Manual read plus a live code walkthrough instead of the system design round.11 of 11

That bottom row is the only one I'd defend without caveats. Above 0.90 average across a whole repo, with at least one file above 0.97, we have never once found a human author. The 0.45 to 0.72 band is where most of our argument happens internally, and it's also where the tool is least decisive.

A score is a reason to look at the code. It is not a reason to reject a person.

Reading the report is the real skill

The number is the easy part. What actually takes practice is reading a per-file breakdown without importing your own priors about what "good code" looks like.

Codequiry AI code detection report with average AI score, highest file score and a risk distribution
AI code detection: probability scores per file, flagging submissions likely written by ChatGPT, Copilot, Claude or Gemini.

Here's the pattern that trips up new reviewers. This is from a real submission last quarter, high score, and it's genuinely well-written:

/**
 * Calculates the total value of all transactions in the batch.
 *
 * @param transactions the list of transactions, never null
 * @return the sum of all transaction amounts
 * @throws IllegalArgumentException if any amount is negative
 */
public BigDecimal calculateTotal(List<Transaction> transactions) {
    if (transactions == null || transactions.isEmpty()) {
        return BigDecimal.ZERO;
    }
    return transactions.stream()
            .map(Transaction::amount)
            .reduce(BigDecimal.ZERO, BigDecimal::add);
}

And here's the human version from the same batch of candidates, which scored 0.31:

BigDecimal total = BigDecimal.ZERO;
for (Transaction t : transactions) {
    // TODO: handle the negative case properly, judge said it's fine for now
    total = total.add(t.amount());
}
return total;

The second one is worse code. It's also obviously, unambiguously human. The tell isn't quality, it's the shape of the decisions: the AI answer reaches for the stream API and defends against null in a way no one does when they have four hours and a CSV parser to write. The human leaves a TODO that references a conversation. LLM output doesn't reference conversations.

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.

Three signals cluster across almost every confirmed case we've had. Uniform Javadoc coverage on private methods nobody calls. Defensive null checks and try/catch blocks that no test exercises. And a comment-to-code ratio that stays flat across files of wildly different complexity, which is not how anyone writes when they're tired at hour three.

What happens when a submission is flagged

Nothing dramatic. The hiring manager gets a link with the top three files pre-opened. They read them. If the read agrees with the score, we swap the system design round for a 45-minute live walkthrough where the candidate explains the design and then extends it. We do not mention the scan during the interview.

If the candidate can extend their own code, it wasn't AI-generated in any way that matters to us. Two of our best hires last year came in under a 0.8 and handled the walkthrough cleanly. The flag is a scheduling decision, not a verdict.

If they can't navigate their own submission, the recruiter has a separate conversation, and that conversation is about the gap between the code and the walkthrough, never about a tool's percentage. Everything up to that point stays in the hiring channel. It never goes in an ATS note. Our legal team wrote that rule and it's the only part of this process I'd call non-negotiable, because an accusation you can't substantiate is worse for the company than a bad hire.

Where this breaks down

Three places, and I don't have clean answers for any of them.

Boilerplate-heavy exercises score high no matter who writes them. Our original take-home was a Spring Boot CRUD service, and it had a standing 0.5 average because the whole thing is textbook. We fixed that by making the exercise weird: a rules engine with hand-written parsing. Weird tasks produce weird code, and LLMs are much worse at weird.

Strong developers using Copilot as a typing accelerator sit in exactly the same score band as candidates who pasted a whole solution. The tool can't distinguish "accepted a suggestion for the getter" from "generated the entire class." Only the walkthrough separates them.

And the calibration is ours, not anyone's. We've only run this across a few hundred submissions in one company, one language, one exercise. Treat the numbers above as a worked example of a method, not as a standard you can adopt unchanged. If you import our 0.72 directly you will get our false positive rate, which is roughly one in six.

If you're putting something like this in place, start by re-scoring submissions you've already decided on. That's the only dataset where you know the ground truth. You can wire it up the same afternoon with an API key from the AI code detector and a checkout of your last two hiring cycles.

Frequently Asked Questions

Can employers actually tell if a take-home was written by AI?

Not with certainty, and not from a single number. A per-file AI score plus a live walkthrough of the candidate's own code is the strongest combination we've found. The scan tells you who to look at; the walkthrough tells you what actually happened.

What AI code score should trigger a review?

Calibrate against your own past candidates first, but as a rough guide: above 0.90 on a whole repository is worth a serious look, 0.72 to 0.90 warrants reading the top files, and anything below 0.72 generates more noise than signal unless the exercise itself is boilerplate-heavy.

Is screening take-homes legally risky?

Less risky than making a decision you can't explain. Disclose the scan in writing before the candidate starts, keep the score out of the rejection reason, and make sure the only person who discusses it with the candidate is HR. Scored artifacts also survive better than a hiring manager's gut feeling if anyone ever asks.

Does AI detection work on languages other than Java and Python?

Coverage is broader than you'd expect, but parser quality varies by language and the wrapper-heavy repositories (heavy TypeScript with lots of React) score noisier than plain backend code. We run Java, Python and Go take-homes and only Java is reliable enough that I'd set the threshold without re-calibrating.

If you're scanning candidate submissions alongside student work, the same scoring approach holds; the difference is scale and who owns the review. Either way, start with a code plagiarism checker that gives you per-file AI and similarity scores in one report, because running two tools and reconciling two dashboards by hand is a chore nobody keeps up with past the first month.