SchoolWhool
Quizzes and saved progress, freeSign in freeSign in
Maths · Module 1Module material

Functions and logarithms interview questions

15 questions interviewers ask on functions, logarithms and notation, from first principles to the follow-ups. The first 3 model answers are free to read; Pro opens the rest.

  1. What makes a rule a function?

    Every input gives exactly one output. f(x) = 2x + 1 is a function: 2 always gives 5. A rule that could give two outputs for one input is not. In machine learning the loss is a function of the weights: one set of weights, one loss.

  2. How can you tell a linear, a quadratic and an exponential relationship apart from a table?

    From the rate of change between equally spaced rows. A linear table's steps are constant (2, 2, 2, 2); a quadratic's steps change by the same amount (−3, −1, 1, 3); an exponential's steps change by the same factor (0.25, 0.5, 1, 2, each double the last).

  3. What does f(x − 3) do to a graph, and how do you remember the direction?

    It moves the graph right by 3. Find the input that makes the bracket zero: x = 3, so the point that was at zero is now at three. f(x) + 3 moves it up and 3 f(x) stretches it.

  4. Your straight line passes through the middle of the data. How do you check that it is the right shape?
  5. Why is e the base used in machine learning?
  6. State the product rule for logarithms and the most common mistake with it.
  7. Why do we work with log-probabilities instead of probabilities?
  8. What are odds and log-odds, and why does logistic regression use the log-odds?
  9. An email scores 5.872 in spam-minus-ham log-probability. What is the probability it is spam?
  10. You log-transform a column and get -inf. What happened and what do you do?
  11. What do ŷ, x̄ and w* mean?
  12. Write ŷᵢ = Σⱼ wⱼ xᵢⱼ in NumPy, and explain the index shift.
  13. What is the difference between min and argmin?
  14. scikit-learn's Ridge and a paper both use a regularisation strength. Can you copy the paper's value?
  15. Ridge's penalty is λ Σⱼ wⱼ². On the shop data, promotion's weight is 99.48% of that sum. Is that a problem?