Questions
25 of 30
1What is the purpose of the transform property in CSS?
2What are the different types of CSS transformations?
3What does transform: translate() do?
4What is the difference between translateX() and translateY()?
5How does rotate() work in CSS?
6What is the unit used in rotation?
7What is the difference between scale() and scaleX(), scaleY()?
8What happens when you use negative values in scale()?
9What does the skew() function do?
10Can you combine multiple transform functions together? How? What is the use of the transform-origin property?
11What is the default transform-origin value?
12How does changing transform-origin affect rotation or scaling?
13What is the difference between translate() and using position or margin for movement?
14What is the difference between 2D and 3D transformations?
15What is the difference between 2D and 3D transformations?
16How do you apply a 3D rotation using CSS?
17How do you apply a 3D rotation using CSS?
18What are perspective and perspective-origin in 3D transforms? What is the purpose of transform-style: preserve-3d?
19What is the use of matrix() in CSS transforms?
20What’s the difference between matrix() and matrix3d()?
21How can you center an element using transform and translate()?
22What is the transition property in CSS used for?
23What are the four main components of a transition?
24What does transition-duration specify?
25What are the common timing function values (e.g., ease, linear, ease-in)?
26What is the shorthand syntax for transition?
27Can multiple CSS properties be transitioned simultaneously? How does transition differ from animation in CSS?
28Can you apply a transition to an element’s pseudo-class (like :hover)?
29Can transitions be triggered by JavaScript?
30What happens if transition-duration is set to 0s?
25 / 30

What are the common timing function values (e.g., ease, linear, ease-in)?

Difficulty: 4/10
CSS transitions, animation timing functions, easing curves

Understanding transition-timing-function in CSS

The transition-timing-function property in CSS defines how the speed of a transition changes over its duration. It controls the acceleration curve, making the transition feel more natural or mechanical depending on the chosen value.

Syntax Example
Preset Timing Functions
  1. 1

    ease — starts slow, speeds up, then slows down at the end (default).

  2. 2

    linear — maintains a constant speed from start to finish.

  3. 3

    ease-in — starts slow and speeds up toward the end.

  4. 4

    ease-out — starts fast and slows down at the end.

  5. 5

    ease-in-out — starts and ends slow, with faster movement in the middle.

CSS Example

Each timing function affects how the element moves during the transition, influencing the visual feel of the animation.

For complete control, you can define a custom curve using cubic-bezier(x1, y1, x2, y2). This allows fine-tuning of the acceleration pattern beyond the preset options.

Example: Custom Bezier Curve
Key Takeaways
  1. 1

    transition-timing-function controls the pacing of animations.

  2. 2

    Common values include ease, linear, ease-in, ease-out, and ease-in-out.

  3. 3

    Use cubic-bezier() for custom timing effects that match your design style.

Scenario Questions

0-2 years experience

  1. 1How would you make a button fade in over 0.5 seconds using a linear timing function?
  2. 2If you apply `transition: all 0.3s ease-in;` to an element and then change its width, what animation behavior will you see?
  3. 3What happens if you omit the timing function in a CSS transition?

2-5 years experience

  1. 1You notice that a modal's slide‑down animation feels too abrupt. How would you adjust the CSS to make it start slowly and then speed up?
  2. 2A colleague reports that a CSS animation works in Chrome but not in Safari, and the timing seems off. What could be causing the discrepancy and how would you debug it?
  3. 3When combining multiple transitions on the same element with different timing functions, how does the browser resolve them?

5-8 years experience

  1. 1Our design system defines a set of standard easing curves for all UI animations. How would you implement a reusable CSS utility or token system that ensures consistent timing functions across components, and what trade‑offs would you consider?
  2. 2We need to animate a large list of items with staggered delays. How would you choose timing functions and implement them to avoid jank and keep frame rates high?
  3. 3Explain how using custom cubic‑bezier timing functions could impact performance on low‑end devices, and how you would test or mitigate any issues.

8+ years experience

  1. 1Our legacy web app mixes hard‑coded `ease` values and JavaScript‑driven animations. We're planning a migration to a unified CSS‑only animation framework. What architectural considerations and migration strategy would you propose to standardize timing functions while minimizing risk?
  2. 2When building a cross‑platform design system used by web, iOS, and Android teams, how do you ensure the visual feel of easing curves matches across platforms, and what process would you set up to maintain consistency over time?
  3. 3If a performance team flags that certain CSS transitions cause layout thrashing due to timing function choices, how would you work with them to identify root causes and refactor the animation strategy at the system level?

Follow-up Questions

  • Can you give an example where you’d prefer ease-in over linear?
  • How would you test that your chosen timing function works consistently across browsers?
  • What trade‑offs might you consider when defining a custom cubic‑bezier curve?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.