Backend testing interview questions
The test pyramid, fakes and mocks, real-database tests, contract tests, time and randomness, flaky tests, fixtures, migrations, property-based tests and chaos experiments.
– interview-ready · 10 questions in this topic
– of 10 tried
Saved on this device. Interview-ready means you got it right on two different days. Guesses and hints count for less.
Questions
- The test pyramid for a backendPick the fix
- Fakes, stubs and mocksPredict
- Integration tests with a real databasePredict
- Contract testing between servicesOrder the steps
- Testing code that uses time and randomnessPredict
- Flaky testsPick the fix
- Test data and fixturesPredict
- Testing database migrationsPick the fix
- Property-based testingPredict
- Chaos experiments and failure testingOrder the steps
Practise this topic
Flashcards · 14
Flip, then say if you knew it. Needs JavaScript; every answer is also on its question page.
Quick quiz · 10 questions
One exercise per question, checked as you go. Needs JavaScript.
Mock interview · 2 sets
Timed, out loud, then tick what you covered. Needs JavaScript.
Quick facts
Recall the answer first, then tap Show to check.
Postgres now()
Returns the transaction's start time, so it's the same for every statement in one transaction.
Template databases
CREATE DATABASE … TEMPLATE copies an existing database, a quick way to give each test worker a migrated copy.
Row order
Without ORDER BY, SQL doesn't guarantee the order of rows.
Hypothesis
Python's property-based testing library; it shrinks failing inputs to a minimal example.
Printable cheat sheet · Review your weak spots in this topic
Share your progress
Sources: Topic outline informed by System Design Primer by Donne Martin and the Zalando RESTful API Guidelines, both licensed under CC BY 4.0. Every question and answer is written by Best Latest Apps. Credits and license