How AI Works — AI Technical Interview Questions & Answers
How AI Works
How AI Works
- Loop: collect data → pick a representation (features or pixels) → train or write rules → test on held-out examples → deploy → watch errors → update. Training means adjusting weights so predictions match labels (supervised) or find structure (unsupervised).
- Board: 100 ham / spam emails. Split 80 train / 20 test. Learn. Score the 20. If test is weak, you overfit. That loop is “how AI works” for a fresher — not a 50-layer diagram on day one.
- How AI Works — output: train has 4 labels, test has ['spam']. You score only on test.
data → train / test split
│
▼
model
│
▼
predict → monitorTechnical Interview Tip: The loop + why a test set exists.
Code Examples for How AI Works
Example
# How AI works — split first
rows = ["spam", "ham", "spam", "ham", "spam"]
train, test = rows[:4], rows[4:]
print("train", train)
print("test ", test)
print("never tune on test")
How AI Works — output: train has 4 labels, test has ['spam']. You score only on test.
How to Explain How AI Works to an Interviewer
Explain How AI Works as if you are teaching a junior — definition, then one example.
data → train/rules → test → deploy → monitor. Always hold out a test set.
What does the example print, and what does that prove?
How AI Works — output: train has 4 labels, test has ['spam']
What mistake do freshers make with How AI Works?
Train accuracy only.