DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
TypeScript Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
TypeScript
A Robot class and a Dog class both happen to have a bark() method, with no inheritance relationship between them. Can a function typed to accept Dog also accept a Robot instance?
A
No, never — they're unrelated classes
B
Yes — TypeScript's structural typing only checks that the Robot instance has a compatible bark() method, regardless of class hierarchy
C
Only if Robot explicitly extends Dog
D
Only in non-strict mode
Check Answer