← Questions
RNNs, LSTMs, Transformers and model predictive control
0
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI/ML design interview question asked in Tesla's technical phone screen, last asked Sep 2025. It tests sequence models, transformers and control.
A technical conversation about the sequence models in your own projects, followed by control theory:
- How did you use RNNs, LSTMs and Transformers in your project? Compare them for sequence modeling: what each can capture, how each trains, and when you would choose each.
- Which Transformer architecture did you use (encoder-only, decoder-only or encoder-decoder), and why?
- Explain the basics of model predictive control (MPC): the cost function, the constraints, the prediction and control horizons, and how it runs in a loop.
- How could MPC be combined with learned models?
Requirements
- Clear, correct explanations tied to decisions you made in your own work.
- Trade-offs stated, not just definitions.
Clarifying questions
- Should I focus on one project in depth or compare several?
- For MPC, is the setting vehicle control (trajectory tracking) or something else?
What a strong answer covers
- RNNs: hidden state carried step by step, vanishing and exploding gradients, sequential training.
- LSTMs: gates and a cell state that keep gradients alive over longer spans; still sequential, still limited for very long contexts.
- Transformers: self-attention over the whole sequence, parallel training, quadratic cost in sequence length, positional encodings; better at long-range dependencies with enough data.
- Choosing: small data or streaming with tight latency may favour an LSTM; long context and large data favour a Transformer. Why your project used the architecture it did (encoder-only for classification or encoding, decoder-only for autoregressive generation, encoder-decoder for sequence-to-sequence).
- MPC: at every step, solve an optimization over a horizon of future controls that minimizes a cost (tracking error, effort, comfort) under dynamics and constraints (actuator limits, safety bounds), apply only the first control, repeat.
- Combining: a learned dynamics model inside MPC, a learned cost or terminal value, MPC as a safety layer over a learned policy, or a policy trained to imitate MPC to save compute.
Follow-ups
- What would change if your sequence were 100 times longer?
- How do you make MPC run in real time on a vehicle?
- A learned dynamics model is wrong in some regions. How does MPC behave, and how do you protect against it?
Where it's asked
- Tesla · Technical phone screen · Last asked Sep 202545 min · 10 to 20 minutes on your background, then one compact coding, debugging or design task in CoderPad that must run
What it tests
sequence models · transformers · control
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
