Reviewed by Aditya Kumar · Last reviewed 2026-03-24
S: Single Responsibilityâone reason to change. O: Open/Closedâextend via traits. L: Liskovâsubtypes substitutable. I: Interface Segregationâsmall traits. D: Dependency Inversionâdepend on abstractions. Example: trait DataSource { def read(): DataFrame }; class S3Source extends...
S: Single Responsibilityâone reason to change. O: Open/Closedâextend via traits. L: Liskovâsubtypes substitutable. I: Interface Segregationâsmall traits. D: Dependency Inversionâdepend on abstractions. Example: trait DataSource { def read(): DataFrame }; class S3Source extends DataSource; class Pipeline(ds: DataSource). WHY: Maintainability, testability. Prefer composition; use implicits sparingly.
Red Flag: Definitions without code. Pro-Move: 'Our ETL uses DataSource trait; swap S3/Kafka without changing Pipeline; DIP enables testing with mocks.'
According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.