Tesla interview questions
Big tech · 4 questions reported
- junior 1
- mid 0
- senior 3
These are 4 technical questions candidates reported being asked in Tesla interviews for AI engineer, ML engineer and applied AI engineer roles, each with a model answer you can say out loud in a minute or two. They cover attention and training: 1 junior, 0 mid-level and 3 senior questions. Every question comes from a public interview write-up that names Tesla.Updated
Tesla attention and the transformer block questions
Model answer
RNNs carry one hidden state step by step: cheap per step, but sequential, and gradients vanish over long spans. LSTMs add gates and a cell state so information survives longer. Transformers attend over all steps in parallel, train faster and capture long range, at cost quadratic in length; for streaming prediction I'd pick a causal decoder.
MPC is different: it uses a dynamics model to optimise actions over a short horizon, applies the first and replans. A learned sequence model can be that dynamics model or forecaster, while MPC enforces constraints.
Model answer
Have the forward pass cache what the backward pass needs: the softmax probabilities P.
def attn_fwd(Q, K, V): # (T, d) each
S = Q @ K.T / np.sqrt(Q.shape[-1])
S = S - S.max(-1, keepdims=True)
P = np.exp(S)
P /= P.sum(-1, keepdims=True)
return P @ V, P
def attn_bwd(dO, Q, K, V, P):
dV = P.T @ dO
dP = dO @ V.T
dS = P * (dP - (dP * P).sum(-1, keepdims=True))
dS /= np.sqrt(Q.shape[-1])
return dS @ K, dS.T @ Q, dV # dQ, dK, dV
The key line is the softmax backward: each row's gradient is P times dP minus its P-weighted mean. Multi-head attention reshapes into heads around this, and a block adds residuals, LayerNorm and an MLP, each with its own backward. Prove it with a finite-difference gradient check.
Tesla training and optimisation questions
Model answer
Each output channel has one kernel spanning all input channels, so weights are in-channels times out-channels times kernel height times width. Bias adds one per output channel.
Example: 3 in, 64 out, 3 by 3 kernel gives 1,728 weights, 1,792 with bias. Groups divide the weight count.
Model answer
PPO is stable and simple on-policy; SAC is off-policy and more sample-efficient, which matters when simulation is expensive.
Reward progress along the route, penalise speed above the limit with a penalty that grows with the excess, and add small penalties for jerk and harsh braking. Make collisions and red lights terminations or hard constraints, for example via a Lagrangian method, not weights the agent can trade away. Against exploits: reward route progress, not raw speed, so circling earns nothing; bound per-step rewards; and inspect rollouts for reward hacking in adversarial simulated scenarios.
Each question comes from a public interview write-up or video that names Tesla; the answers are ours. Not affiliated with Tesla.