Perplexity interview questions
AI startup · 3 questions reported
- junior 0
- mid 3
- senior 0
These are 3 technical questions candidates reported being asked in Perplexity 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 tools & constraints, training and ml system design: 0 junior, 3 mid-level and 0 senior questions. Every question comes from a public interview write-up that names Perplexity.Updated
Perplexity tool calls and constrained sampling questions
Model answer
Try providers in preference order, and bench one for its retry-after time when it rate-limits or errors.
import random, time
class RateLimited(Exception):
retry_after = None
class Pool:
def __init__(self, providers, cooldown=30.0):
self.ps = providers # in preference order
self.until = {p.name: 0.0 for p in providers}
self.cooldown = cooldown
def call(self, req, rounds=3):
for r in range(rounds):
for p in self.ps:
now = time.monotonic()
if self.until[p.name] > now:
continue
try:
return p.complete(req)
except RateLimited as e:
wait = e.retry_after or self.cooldown
self.until[p.name] = now + wait
except (TimeoutError, ConnectionError):
self.until[p.name] = now + self.cooldown
time.sleep(2 ** r + random.random())
raise RuntimeError("all providers failed")
Interviewers look for jittered backoff, never retrying a bad request, timeouts on every call, and no silent failover mid-stream once tokens reach the user.
Perplexity training and optimisation questions
Model answer
Put preprocessing inside the pipeline, so cross-validation fits imputers and scalers on training folds only.
from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import (
StratifiedKFold, cross_val_score)
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import (
OneHotEncoder, StandardScaler)
prep = ColumnTransformer([
("num", make_pipeline(SimpleImputer(strategy="median"),
StandardScaler()), num_cols),
("cat", OneHotEncoder(handle_unknown="ignore"),
cat_cols),
])
model = make_pipeline(
prep, LogisticRegression(class_weight="balanced",
max_iter=1000))
cv = StratifiedKFold(5, shuffle=True, random_state=0)
scores = cross_val_score(model, X, y, cv=cv,
scoring="average_precision")
From this baseline, try gradient boosting and tune with the same CV. For imbalance, class weights or threshold tuning beat blind oversampling. Report PR-AUC, plus precision and recall at a threshold chosen on validation data, then read the errors.
Perplexity mL system design questions
Model answer
Log impressions, clicks, dwell, follow-up questions and shares, with position, so you know what was shown and ignored. Retrieve candidates from embeddings of the user's past queries, trending stories and editorial picks, and rank with a model predicting engaged reads, not clicks alone. Add freshness and diversity rules.
Guard against feedback loops: reserve a little traffic for exploration and correct for position. Evaluate offline on time-split logs, then A/B test retention.
Each question comes from a public interview write-up or video that names Perplexity; the answers are ours. Not affiliated with Perplexity.