Cross-validation trains and evaluates a model multiple times on different subsets of data giving a more reliable estimate of generalization performance especially for small datasets. The most common form is…
#beginner
A generator produces items one at a time using lazy evaluation — it only computes each item when requested. A list computes and stores all items immediately. Generators use far…
‘==’ checks value equality. ‘is’ checks identity — whether two variables point to the exact same object in memory.
Hallucination is when an LLM generates confident-sounding but factually incorrect or fabricated information. It happens because LLMs are trained to produce plausible next tokens based on patterns — not to…
AI is the broad field of making machines intelligent. Machine Learning is a subset of AI where systems learn from data. Deep Learning is a subset of ML using multi-layered…
‘try’ runs code that might fail. ‘except’ catches specific errors. ‘finally’ always runs regardless of whether an error occurred — used for cleanup.
An LLM is a neural network trained on vast amounts of text to predict and generate language. Unlike traditional software with explicit rules LLMs learn statistical patterns from data and…
Prompt engineering is the practice of designing inputs to LLMs to reliably produce desired outputs. It matters in production because the same model with different prompts can produce dramatically different…
‘self’ refers to the specific instance of the class that a method is being called on. It gives each instance access to its own attributes and other methods.
Overfitting is when a model learns the training data too well — including its noise — and performs poorly on new data. Detect it by comparing training and validation accuracy.…
*args collects extra positional arguments as a tuple. **kwargs collects extra keyword arguments as a dictionary. Both allow functions to accept a variable number of arguments.
Supervised learning trains on labeled data (input-output pairs). Unsupervised learning finds patterns in unlabeled data with no predefined outputs.

2,000 Interview Questions & Answers, in one PDF
- Short answers, in-depth explanations, common mistakes and follow-ups
- 89 topics, from Beginner to Architect, with a clickable contents list
- 226 extra questions that are not on this website
- Free Bonus Pack: 30-day study plan, behavioral questions, salary scripts
Get both books for $9.99 (save $2.99):
The material stays free to read online. This is the organised, offline, print-ready PDF edition. Secure payment by PayPal; your personal download link is emailed after payment is confirmed. Digital product, no shipping.