MockReal Logo
Home
BlogPricing
For Employers →
  1. Home
  2. Questions
  3. What’s the difference between `interface` and `type` in TypeScript?

What’s the difference between `interface` and `type` in TypeScript?

TechnicalFrontend DeveloperFrontend Angular developerTypeScript DeveloperWeb Developer

The main difference between interface and type in TypeScript is that interfaces are primarily used for defining the shape of objects, while types can define a wider range of structures, including unions and intersections.

Interfaces support declaration merging, allowing multiple declarations to be combined, which is useful for extending existing interfaces. On the other hand, types are more flexible with complex types but do not support merging.

More Questions

  • When would you choose one over the other for a component props definition, and why does your decision change if the props type needs to be composed from multiple sources?
  • Explain the difference between `grid` and `flexbox` and when you’d choose each.
  • Explain the javascript event loop.
  • Given this code, predict the output order and explain why: console.log('1'); setTimeout(() => console.log('2'), 0); Promise.resolve().then(() => console.log('3')); console.log('4');
  • How do you create a service in Angular?
  • How do you handle a situation where your page has an LCP of 6.2 seconds?
  • How do you make a custom dropdown component accessible?
  • How do you use AI code generation tools in your development workflow?
  • If AI can generate a React component from a description, what’s the frontend developer’s job?
  • Should I learn React, Vue, or Angular for frontend interviews?
MockReal Logo

Spoken interview practice for technical professionals

Product

  • Pricing
  • Questions
  • Positions
  • Resumes
  • For Employers →

Company

  • Careers
  • About Us
  • Contact
  • Blog

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2025 MockReal. Spoken interview practice. All rights reserved.