I Aced Tesla Codility in 2026: Real Questions and 7-Day Prep Plan

Tesla Codility OA guide cover

Quick Facts

AssessmentTesla SWE online assessment on Codility, 2026
Format3 programming tasks, one whole-test timer
Time limit85 to 90 minutes, one sitting, no pause
SubmissionAuto-submits at expiry, and the code must compile
ScoringHidden correctness cases, including performance cases
Passing barTesla publishes no cutoff score
ProctoringRecruiter-configured per test, off by default

I took the Tesla Codility assessment for a SWE internship role in 2026. The sitting was three programming tasks on one 85-minute timer, and I finished all three. What follows is the complete process and how I prepared for it.

The last task was a scheduler, and mine kept firing the late job instead of the sooner one. With ten minutes left and fifteen already gone, I used an AI interview helper to check the logic. It surfaced the condition variable my loop never re-read, which I break down below.

Before my test, I went through every Tesla Codility post from the past two years on Reddit, LeetCode Discuss, and Teamblind. What I found tracks closely with what I experienced. The traps behind most failed runs come up in detail below. They run from the zeroed task to the integrity event that ends an attempt early.

The Real Questions on My Tesla Codility Test

My invite named the team and the platform, not the questions. I sat three programming tasks on one timer, 85 minutes for the whole set, and the timer does not pause. Here is exactly what I got, in the order it arrived.

Question 1: Bulls and Cows Per-Position Signals

Codility OA question 1: Bulls and Cows Per-Position Signals

The problem I got: I got two equal-length strings, a target and a guess, and I had to compare them position by position and return an array of signals instead of a single score. Each index came back as 2 for an exact match, 1 if that character existed somewhere else in the target, and 0 if it did not. The catch was that a target character can only be used once. If the guess had three bs and the target had one, only one of those positions could come back 1. The example they handed me was target sabby against guess assby.

My approach: My first instinct was one pass with a counter of the target, and that breaks on the case above, because it keeps reporting present-elsewhere after the copies run out. I split it into two passes instead. Pass one locked every exact match and flagged that target position as already used. Pass two built a counter from the target characters I had not matched, then walked the guess and spent exactly one available character per 1. The interviewer then asked how I would do it without a frequency counter at all. I talked through sorting the index pairs by character, or, for a small alphabet, a bitmask of which target positions were already spent.

from collections import Counter

def score_per_position(target: str, guess: str):
    n = len(target)
    result = [0] * n
    used = [False] * n

    # Pass 1: lock exact matches so they cannot be reused.
    for i in range(n):
        if target[i] == guess[i]:
            result[i] = 2
            used[i] = True

    # Pass 2: spend each unmatched target character at most once.
    remaining = Counter(target[i] for i in range(n) if not used[i])
    for i in range(n):
        if result[i] == 2:
            continue
        c = guess[i]
        if remaining[c] > 0:
            result[i] = 1
            remaining[c] -= 1

    return result

Time complexity: O(n) | Space complexity: O(n)

This one took me about twelve minutes, and I had room to re-read the output contract before moving on. Q1 was the calmest part of the sitting.

Question 2: Nested-Transaction Key-Value Store

Codility OA question 2: Nested-Transaction Key-Value Store

The problem I got: The second task was a key-value store with set, get, and delete, and then transactions layered on top of it: begin, commit, and rollback. The base store was almost nothing. The part that counted was rollback, where everything I had written since begin had to disappear and the committed state from before begin had to come back untouched. Then the follow-up made it nested. Rolling back an inner transaction had to restore what the parent could still see at that moment, and rolling back the parent had to erase the child's writes as well.

My approach: I used a stack of undo logs, one frame per open transaction. Each frame records the first old value it sees for every key that frame touches, and nothing else. That choice is deliberate: a full snapshot per frame copies the whole store, while a delta log only pays for the keys in play. The bug I walked into was the missing key. My first version saved the old value with store.get(key), which returns None, and None is a legal value in the store. I could not tell "this key never existed" from "this key existed and held None," so rollback kept resurrecting keys that should have stayed gone. I switched to a private sentinel object that can never collide with a real value. On top of that, commit folds the top frame's entries into its parent instead of throwing the log away, which is what keeps a parent rollback able to undo a committed child.

class KVStore:
    _MISSING = object()

    def __init__(self):
        self._store = {}
        self._frames = []          # each frame: key -> old value (or _MISSING)

    def set(self, key, value):
        self._record(key)
        self._store[key] = value

    def get(self, key):
        return self._store.get(key)

    def delete(self, key):
        self._record(key)
        self._store.pop(key, None)

    def _record(self, key):
        if not self._frames:
            return
        frame = self._frames[-1]
        if key not in frame:
            frame[key] = self._store.get(key, KVStore._MISSING)

    def begin(self):
        self._frames.append({})

    def commit(self):
        if not self._frames:
            raise RuntimeError("no active transaction")
        frame = self._frames.pop()
        if self._frames:
            parent = self._frames[-1]
            for key, old in frame.items():
                if key not in parent:
                    parent[key] = old

    def rollback(self):
        if not self._frames:
            raise RuntimeError("no active transaction")
        frame = self._frames.pop()
        for key, old in frame.items():
            if old is KVStore._MISSING:
                self._store.pop(key, None)
            else:
                self._store[key] = old

Time complexity: O(1) for get/set/delete; O(k) for commit/rollback, where k is the keys that frame touched | Space complexity: O(k) across the open frames

The None bug cost me a few minutes before the sentinel clicked, but the nested case passed on the first try after the rewrite. Two down, and the clock was still on my side.

Question 3: Timed Task Scheduler

Codility OA question 3: Timed Task Scheduler

The problem I got: The last task was a scheduler that runs tasks at a time I hand it. The base version was simple: give it a target time and a function, and it fires at that time. The extension was the real work. I had to allow new tasks to be added at any moment, including while the scheduler was already running, and a task added with an earlier time than the one currently waiting had to fire first. The statement was explicit that a sketch would not do. They wanted something that actually runs.

My approach: I kept the pending tasks in a min-heap keyed by execution time, with a sequence number as the tiebreaker so two tasks at the same timestamp come out in insertion order. The heap alone is not enough, because the worker has to wait, and a plain sleep would hold it until the old earliest task while a newer, sooner task sat in the heap. I put the heap behind a condition variable. The worker reads the heap's top, and if the time has not arrived it waits with a timeout equal to the remaining delay. Every push calls notify, which wakes the worker so it re-reads the head. If the new task is sooner, the next wait is shorter, or zero. The lock around the heap covers push, pop, and the head read, so two threads calling schedule at once cannot corrupt it. A task whose time has already passed fires on the next loop instead of being dropped.

import heapq
import threading
import time

class TaskScheduler:
    def __init__(self):
        self._heap = []
        self._cv = threading.Condition()
        self._seq = 0
        self._stopped = False

    def schedule(self, run_at, fn):
        with self._cv:
            self._seq += 1
            heapq.heappush(self._heap, (run_at, self._seq, fn))
            self._cv.notify()      # a sooner task preempts the current wait

    def _run(self):
        while True:
            with self._cv:
                while not self._stopped:
                    if not self._heap:
                        self._cv.wait()
                        continue
                    run_at, _, fn = self._heap[0]
                    now = time.time()
                    if run_at <= now:
                        heapq.heappop(self._heap)
                        break
                    self._cv.wait(timeout=run_at - now)
                if self._stopped:
                    return
            fn()

    def start(self):
        self._worker = threading.Thread(target=self._run, daemon=True)
        self._worker.start()

    def stop(self):
        with self._cv:
            self._stopped = True
            self._cv.notify()
        self._worker.join()

Time complexity: O(log n) to schedule or fire a task; O(1) to read the next due time | Space complexity: O(n)

This is where the sitting turned. My first version polled in a loop with a short sleep, and it fired the late task before the sooner one I added while it was already waiting. I could see the test fail and I could not see why my wait never noticed the new task, and I burned close to fifteen minutes rewriting the same loop before the condition variable and the notify call made it click. By the time the third task finally ran green, I had somewhere around ten minutes left on the shared timer.

What broke the loop. I had already ruled out a desktop overlay, because its answer renders on the same screen the proctoring system monitors, kept out of view by a basic OS-layer trick. With ten minutes left, I hit my capture shortcut, the scheduler problem went to my phone, and the check came back on a device outside the platform's screenshot monitoring. The fix it pointed at was the wait itself, which slept past a task added mid-wait instead of waking on it. I re-read the heap head after every notify, and my laptop screen never left the Codility editor.

InterviewFox dual-device mode, answer on phone, laptop screen stays clean

interviewfox.ai

Land offer with Safer AI Interview Assistant

Skip the risky invisible apps. Our dual-device mode keeps it simple and undetectable. You crush the interview, we handle the answers.

Get started. It's freeLoved by 100,000+ candidates

Tesla's Proctoring Policy for Codility

Tesla does not run one fixed Codility setup for every candidate. On Codility, integrity features are per-test toggles.

The recruiter switches them on when the test is built, and the configuration locks once the recruiter invites the first candidate. What follows is what the platform can record, and you can match it to the tier on your own invite.

What Codility Records When Proctoring Is On

Proctoring is off by default on Codility, and a test only gets it if the recruiter turns it on. A later change means duplicating the whole test.

Two signals log with no visual capture at all: a paste into the IDE and an attempt to copy the task description. Codility reads both as AI-tool signals. A logged paste proves less than the label suggests, and how Codility logs a copy and paste event draws that line in full.

Leaving the Codility tab logs as a behavioral event too. That log exists whether or not screen capture is running. Does a tab switch count against you on its own? How the platform treats a lone tab switch is a separate question from what the screen recording sees.

The visual tier adds webcam snapshots at intervals and on flagged events. Codility keeps those images for 30 days. Knowing what one webcam snapshot captures saves you from prepping for a video feed that never arrives.

Screen, video, and audio recording sits in its own optional tier. It is easy to fold into the snapshot tier by mistake. The two capture different surfaces, and what the screen recording actually covers is its own question.

Cheating-Apps and Device Integrity Detection

Codility's desktop app adds a check that reads the machine rather than the candidate. It looks for programs that ask the operating system to keep them out of screen capture.

That is the exact request overlay tools make in order to stay invisible inside a recording. Device Integrity adds a scan for known cheating tools already installed.

Both features are still marked Preview, and the desktop app does not support Linux. The check targets the hiding technique itself rather than one product.

A flag is not an automatic failure. Where the flag goes matters more than the flag itself. How the integrity model routes a flag to a human decision covers that path in full.

3 Other Confirmed Tesla Codility Questions

Not every Tesla screen looks like the SWE sitting I took. Three more programming questions turn up across the roles Tesla hires for. Each one points at a different skill family, and none of these three were on my own test.

Question 1: NumPy Plane Fitting

The ML-role variant. A Tesla ML screen opens with geometry in pure NumPy. Take a list of 3D points and a plane, then return each point's distance to it. A normal vector of zero length has to be rejected rather than divided by.

The follow-up. The next cloud puts about 70% of its points on one plane. The rest are noise or other objects, and the ask is the dominant plane plus every outlier past a threshold. A single fit through all the points drifts off that plane at this outlier rate. The working version samples small groups, keeps the largest set inside the threshold, and refits on the survivors.

import numpy as np

def point_plane_distance(points, plane):
    points = np.asarray(points, dtype=float)
    normal = np.asarray(plane[:3], dtype=float)
    d = float(plane[3])
    norm = np.linalg.norm(normal)
    if norm < 1e-8:
        raise ValueError("degenerate plane: normal has zero norm")
    return np.abs(points @ normal + d) / norm

def fit_dominant_plane(points, threshold, trials=200, seed=0):
    points = np.asarray(points, dtype=float)
    rng = np.random.default_rng(seed)
    best = np.zeros(len(points), dtype=bool)
    for _ in range(trials):
        idx = rng.choice(len(points), size=3, replace=False)
        a, b, c = points[idx]
        normal = np.cross(b - a, c - a)
        norm = np.linalg.norm(normal)
        if norm < 1e-8:            # collinear sample, skip it
            continue
        normal = normal / norm
        d = -float(normal @ a)
        mask = np.abs(points @ normal + d) < threshold
        if mask.sum() > best.sum():
            best = mask
    if best.sum() < 3:
        raise ValueError("no dominant plane at this threshold")
    centroid = points[best].mean(axis=0)
    _, _, vt = np.linalg.svd(points[best] - centroid)
    normal = vt[-1]
    return normal, -float(normal @ centroid), best

Time complexity: O(trials x n) for the sampling loop plus one SVD on the inlier set | Space complexity: O(n)

The SVD refit is what keeps a vertical plane solvable. The normal comes from the smallest singular vector, not from a coordinate someone picked.

Question 2: Data Cleaning and SQL Analytics

The data-role variant. A Tesla data-engineering screen starts with a messy transaction CSV. The columns are date, amount, customer id, payment method, and notes. The dates mix three formats, and the amounts carry currency symbols and commas.

The graded part. Validation discipline decides this one, not the cleaning. Canonicalize the dates, the decimal amounts, and the ids as strings, map the payment aliases, and quarantine whatever will not parse. Three SQL tasks follow, and they are the reproducible half.

-- Task 1: cumulative sales per store, reset at each new month
SELECT store_id,
       date,
       SUM(amount) OVER (
         PARTITION BY store_id, date_trunc('month', date)
         ORDER BY date
       ) AS running_total
FROM sales;

-- Task 2: all direct and indirect reports under manager id 1
WITH RECURSIVE reports AS (
    SELECT employee_id, manager_id, name, 1 AS level,
           name::text AS path
    FROM organization
    WHERE manager_id = 1
    UNION ALL
    SELECT o.employee_id, o.manager_id, o.name, r.level + 1,
           r.path || ' > ' || o.name
    FROM organization o
    JOIN reports r ON o.manager_id = r.employee_id
)
SELECT employee_id, manager_id, name, level, path FROM reports;

-- Task 3: completed revenue, pending and cancelled counts per date, one pass
SELECT date,
       SUM(CASE WHEN status = 'completed' THEN amount ELSE 0 END) AS completed_revenue,
       COUNT(CASE WHEN status = 'pending' THEN 1 END) AS pending_count,
       COUNT(CASE WHEN status = 'cancelled' THEN 1 END) AS cancelled_count
FROM orders
GROUP BY date
ORDER BY date;

Time complexity: one scan per table for the aggregations, plus a single traversal of the reporting tree | Space complexity: O(n) for the recursive result set

Question 3: Speed-Limit RL Reward

The reward variant. Tesla's trajectory work shows up as a [batch, num_waypoint, 2] tensor, and this task turns that tensor into a reward at 10 Hz. The ask is a reward that keeps a car under the speed limit. Two definitions were on the table: total time over the limit, or a penalty that scales with distance above it.

The catch in the follow-up. The limit moves. It runs at 50 mph for the first two seconds and then drops to 30. A reward written against a fixed limit quietly pays the car for speeding through the second window. Per-step speed also comes from the coordinate deltas times the sampling interval, not from the raw positions.

import numpy as np

def per_step_speed(trajectory, hz=10.0):
    deltas = np.diff(trajectory, axis=1)
    return np.linalg.norm(deltas, axis=-1) * hz

def time_over_limit(trajectory, limits, hz=10.0):
    speed = per_step_speed(trajectory, hz)
    over = np.maximum(0.0, speed - np.asarray(limits))
    return -(over > 0).sum(axis=1) / hz

def magnitude_penalty(trajectory, limits, hz=10.0):
    speed = per_step_speed(trajectory, hz)
    over = np.maximum(0.0, speed - np.asarray(limits))
    return -over.sum(axis=1)

Time complexity: O(batch x num_waypoint) per reward | Space complexity: O(batch x num_waypoint)

What Tesla's Codility Test Format Actually Looks Like

My sitting was three programming tasks on one timer, and that format is the standard SWE shape for this role. The chart below lays out the whole format, from the task count down to the compile rule.

The Tesla SWE Codility sitting at a glance (2026)

Three Tasks, One Timer, 85 to 90 Minutes

The shape of the Tesla SWE sitting is three programming tasks on one clock. It holds from 2019 through 2022. One composition splits into two programming questions plus a SQL join instead, which still lands on three tasks.

The timer is the whole assessment. There is no per-task budget, so every minute on the first task comes out of the third. At expiry the code in the editor submits itself. A submission that does not compile never gets evaluated at all.

How Codility Serves the Test

Codility does not pick the length. The recruiter sets the limit when the test is built, and the platform recommends two to three tasks.

Codility's own description of how the timer behaves is blunt about the rest. That clock covers the whole assessment and cannot pause, and solve time never enters the score.

The editor runs in the browser, and each task carries its own language choice. That is the piece worth verifying before test day. A task that reads like Python can still be graded in a compiled language if you never switch it.

How Tesla's Codility Scoring Works

Hidden Correctness Cases Decide the Score

Nothing gets scored until it compiles. A task's score is the share of hidden correctness cases the code passes. Each task hides at least four secret cases, and the example cases you can run before submitting do not count. Codility reports solve time back to the recruiter, and it still does not move the number.

Performance Failures Cost You the Same Task

The correctness set on a Tesla task includes efficiency cases, and they score like a wrong answer. A 2022 Tesla SWE sitting took 100% on two tasks and 30% on the third.

The third lost points to a performance failure plus one missed correctness case. A brute-force solution can return the right answer and still lose most of a task.

There Is No Published Tesla Cutoff

Tesla publishes no pass mark for the Codility stage. Two public results exist, and neither came with a verdict.

Why Candidates Fail the Tesla Codility Assessment

The failures cluster into three shapes, and only one of them is about algorithms.

One Unknown Task Can Zero Your Run

A single unrecognized task category can erase everything else on the paper. In 2021 a SWE sitting scored full correctness on the first two tasks.

Then it took a zero on a web-API design question it had no idea how to approach. The 67% result behind that run never came with an answer about passing.

The lesson is not a missed algorithm. A task category you have never seen costs you the whole task. A zero has no partial credit beside it.

Performance Tests Cost the Same Task

The second shape is the working-but-slow answer. A brute-force solution passes the example cases, then loses the performance portion of a task that was otherwise correct. That is why the refactor has to happen before the clock runs down.

An AI Tool Trips a Background-Process Check

A hotkey-activated invisible app ended an attempt in July 2026. The candidate had moved between the prompt and the code editor when a background-process warning appeared. The coding workspace stopped accepting input, and the test ended early. That cost the only assessment attempt attached to the application.

The mechanism is not exotic. As covered in the proctoring section, the Device Integrity check was the one that caught it, firing on the same technique every desktop overlay relies on.

InterviewFox works differently. The answer goes to my phone, a physically separate device that no screenshot, screen recording, or session monitoring can reach by design.

interviewfox.ai

Land offer with Safer AI Interview Assistant

Skip the risky invisible apps. Our dual-device mode keeps it simple and undetectable. You crush the interview, we handle the answers.

Get started. It's freeLoved by 100,000+ candidates

How to Prepare for the Tesla Codility in 7 Days

My prep ran seven days across three priorities: the confirmed question shapes under a time cap, efficiency drills, and one full simulation on a clean environment.

In the days before the OA, I sent the confirmed question patterns for Tesla to the Prep Agent in InterviewFox over WhatsApp. It sent back a personalized drill plan and a strategy for each shape, which I folded into the schedule below.

A 7-day prep plan for the Tesla Codility OA

Days 1-2: String, Store, and Scheduler Shapes Under a 30-Minute Cap

The first two days went to the three question shapes I actually expected, one per 30-minute timed session. I narrated my approach out loud while I solved, then redid the same problem from scratch the next day.

These are the confirmed SWE categories for Tesla. A wrong output contract zeroes a whole task, however clean the logic is.

The success check was edge cases, not vibes. Passing character exhaustion on the string task, missing-key rollback on the store, and sooner-task preemption on the scheduler counted. Needing to re-read the statement mid-solve meant the shape was not mine yet.

What I skipped. I skipped system-design practice. A seat-booking double-booking prompt sits in Tesla's wider question pool as a design discussion rather than a codeable task. Drilling it would not have touched my three problems.

I skipped SQL and data-pipeline drilling for the same reason. The cleaning-plus-three-queries screen belongs to a data-engineering variant, not to a three-programming sitting.

Days 3-4: Refactor for the Performance Cases

Days three and four were about losing the least when an answer already works. Efficiency cases score as correctness on Tesla, so I refactored every working brute-force solution from the first two days. That meant a single pass for the string task and a heap for the scheduler. Then I reran the original cases against the faster version.

The success check was a stated complexity. Hitting the O(n) or O(log n) target and saying the time and space cost aloud before submitting was the bar. A solution I could not describe that way went back into the drill pile.

Days 5-7: Full 3-Task Simulation on a Clean Environment

Three tasks, 90 minutes, no pauses, and a laptop with every overlay closed before the timer started. Partial solves fail on this test, and an integrity event voids the attempt no matter how many tasks are green.

The mock had to reproduce both pressures. I started the clock with zero background assist tooling running. I finished at least two of the three inside the limit.

What Happens After You Submit the OA

The Codility Report Goes to the Recruiter

Codility hands the recruiter a report rather than a verdict. The report carries the score, the per-task results, and any integrity flags from the session. From there the recruiter or the hiring manager controls the next step.

When the Next-Round Signal Usually Comes

The common window is a few days, not a rule. A 2019 backend sitting heard from a recruiter in a couple of days. A 2026 applicant was auto-rejected in March and re-engaged by a recruiter six days later. No cooldown window is published for a rejected application, so a closed one is not necessarily permanent.

Tesla Selects Codility Questions by Team

The question family changes with the team as much as the format does. That split is the most useful thing I worked out before my own sitting.

Tesla's Codility tests split into role families

The Four Question Families Across Tesla's Roles

Four families cover almost everything in Tesla's question pool. SWE and DSA roles get string, data-structure, and scheduling tasks on the 85-to-90-minute format. ML and research roles get tensors and geometry: plane fitting, trajectory suffix sums, reward shaping. Data roles get the cleaning pipeline and the SQL screen at roughly 45 minutes.

Systems-leaning roles get design prompts instead of code. The teams behind those families are just as varied. Names range from Autopilot, Optimus, and Dojo to data engineering, infotainment, and factory software.

Confirm Your Team's Test Before You Prep

This is the mistake I nearly made. The 85-to-90-minute three-task format is the SWE default, not the company default. The dated range covers a 45-minute SQL sitting for an analyst role and a front-end HTML, CSS, and JavaScript assessment.

A 2019 composition ran two programming questions plus one SQL question. Most guides describe the three-task version as the whole of Tesla's Codility stage. That is true for exactly one role family.

FAQ

How many questions are on the Tesla Codility test?

Three programming tasks is the standard SWE sitting, on one 85-to-90-minute timer. Other roles get different counts and lengths, so the number depends on your team.

What score do you need to pass the Tesla Codility OA?

Tesla publishes no cutoff, so nobody can hand you a reliable number. Two public results exist, one at 67% and one with two perfect tasks and a 30%. Neither came with a verdict.

Is the Tesla Codility test timed?

Yes, and the timer covers the whole assessment rather than each task. You cannot pause it, and the code in the editor submits automatically at zero.

Can I use an AI tool or invisible app during the Tesla Codility OA?

Desktop overlay tools put the AI's answer on your computer screen. The layer that holds it sits above the browser, hidden by a basic OS-layer trick. The answer stays on-screen, the hiding is simple, and proctoring software keeps adding detection capability. So that exposure is not fixed.

InterviewFox pushes the answer to your phone instead. That phone is a separate device that no screenshot, screen recording, or session monitoring can reach by design, and the laptop screen stays on the exam editor. If you plan to use AI assistance during the OA, the dual-device architecture takes the answer off your screen entirely.

interviewfox.ai

Land offer with Safer AI Interview Assistant

Skip the risky invisible apps. Our dual-device mode keeps it simple and undetectable. You crush the interview, we handle the answers.

Get started. It's freeLoved by 100,000+ candidates

Does Tesla let you reapply after a Codility rejection?

There is no published cooldown. A 2026 applicant was auto-rejected in March and a recruiter re-engaged the same month. A closed application can reopen.

Which programming language can I use on the Tesla Codility OA?

The platform gives you a language choice per task, and Python, Java, C++, and JavaScript all work. I stayed in Python because the follow-up questions were easier in code I could rewrite quickly.