Storybook interview questions

9 questions from the Storybook: Component-Driven UI Development course, each with the correct answer and an explanation. Try to answer before you open the answer.

Module 11: Review & Summary

1. What is the primary purpose of Storybook?

  1. To replace unit testing
  2. To manage project dependencies
  3. To develop and test UI components in isolation
  4. To bundle JavaScript for production
Show answer

Answer: To develop and test UI components in isolation

Storybook provides an isolated environment for component development and testing, complementing rather than replacing other testing approaches.

Lesson: Key Concepts Review

2. What does a story represent in Storybook?

  1. A database table
  2. A build pipeline
  3. One state of a component
  4. A route in the app
Show answer

Answer: One state of a component

Each story renders a component in a specific state.

Lesson: Key Concepts Review

3. Which addon lets you change props live in the UI?

  1. Docs
  2. Viewport
  3. Backgrounds
  4. Controls
Show answer

Answer: Controls

Controls edits args in real time.

Lesson: Key Concepts Review

4. What is a decorator used for?

  1. Wrapping stories with providers, themes or layout
  2. Compiling TypeScript
  3. Deploying Storybook
  4. Generating screenshots
Show answer

Answer: Wrapping stories with providers, themes or layout

Decorators add shared context around every story.

Lesson: Key Concepts Review

5. Where does a `play` function run?

  1. Before the build
  2. After the story renders, simulating user actions
  3. Only in production
  4. Inside the Figma plugin
Show answer

Answer: After the story renders, simulating user actions

Play functions drive interactions and assertions on a rendered story.

Lesson: Key Concepts Review

6. Which tool catches unexpected visual changes between builds?

  1. ESLint
  2. Prettier
  3. Chromatic or Percy
  4. npm audit
Show answer

Answer: Chromatic or Percy

Visual testing compares screenshots of each story.

Lesson: Key Concepts Review

7. What does the a11y addon check?

  1. Bundle size
  2. Network speed
  3. Git history
  4. Accessibility violations such as missing labels and low contrast
Show answer

Answer: Accessibility violations such as missing labels and low contrast

It runs axe checks against each story.

Lesson: Key Concepts Review

8. How do you write rich documentation pages in Storybook?

  1. MDX with DocsPage
  2. Plain JSON
  3. SQL scripts
  4. Shell aliases
Show answer

Answer: MDX with DocsPage

MDX mixes Markdown with live component examples.

Lesson: Key Concepts Review

9. Why run Storybook tests in CI?

  1. To replace code review
  2. To catch component regressions on every commit
  3. To minify CSS
  4. To rename stories
Show answer

Answer: To catch component regressions on every commit

Automated interaction, a11y and visual tests protect UI quality.

Lesson: Key Concepts Review

← Back to the course