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

Calculus and optimisation interview questions

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

  1. What is a derivative, in one sentence, and how would you compute one numerically?

    The rate at which a function's output changes per unit change in its input at a point: the slope of the tangent, the limit of Δy/Δx. Numerically, a central difference (f(x + h) − f(x − h))/(2h) with h around 10⁻⁶; for x³ at 2 it gives 12.

  2. Why not make the finite-difference step as small as possible?

    Because of floating point. The formula's error shrinks with h, but f(x + h) and f(x) agree in most of their sixteen significant digits, so the difference keeps few correct ones, and dividing by h magnifies the rounding, roughly ε/h. For a forward difference of x² at 1, the best step is 10⁻⁸ and at 10⁻¹⁶ the estimate is exactly 0.

  3. State the chain rule and use it on the sigmoid.

    d/dx f(g(x)) = f′(g(x)) · g′(x). For σ(z) = 1/(1 + e⁻ᶻ) it gives e⁻ᶻ/(1 + e⁻ᶻ)² = σ(1 − σ), at most 0.25, at z = 0, and small in both tails: 0.0177 at z = 4.

  4. You set the derivative to zero and found a point. What else do you need to check?
  5. Which single number minimises squared error, and which minimises absolute error?
  6. What is the gradient, and why does gradient descent step against it?
  7. What are the gradients of aᵀx, xᵀx and xᵀAx?
  8. How do you choose a learning rate for gradient descent on a quadratic loss?
  9. What is Newton's method, and why is it not used to train neural networks?
  10. What does the AUC measure?
  11. Why does convexity matter, and is logistic regression's loss convex?
  12. What is a saddle point, and why do they matter in deep learning?
  13. Explain backpropagation.
  14. Derive the gradient of logistic regression's log loss.
  15. What does a Lagrange multiplier mean, and how does it relate to ridge and lasso?