5 comparisons in C# Object Oriented Programming you must revise before a Technical Interview — Part 1

Sriram Kumar Mannava
2 min readJul 25, 2023

Object oriented programming is core to modern day application development and design, and it is one of the major areas where you will be tested for your exposure and knowledge.

The following are some key comparisons that are too important that it is a crime if you go to any technical interview without knowing about.

Constructor vs Method

Constructors and Methods are core to a Class in Object Oriented Programming.

Although a constructor and a method seem to look alike, these structures serve different purposes in functionality.

Comparison — https://referbruv.com/programming-questions/what-are-the-differences-between-the-constructors-and-methods/

Local Variables vs Instance Variables

Class Variables and Local Variables are two types of variables you can define in an object oriented programming language.

These are identifiers defined to store values as required for the business logic.

Comparison — https://referbruv.com/programming-questions/what-is-the-difference-between-a-local-variable-and-an-instance-variable/

Abstract Class vs Interface

The word abstract means — existing in thought or as an idea but not having a physical or concrete existence. Both abstract classes and interfaces can be used to define contracts to be extended or implemented in Object Oriented Programming.

Comparison — https://referbruv.com/programming-questions/what-are-the-differences-between-abstract-class-and-interface/

Class vs Struct

Classes and Structs are two logical structures available to store data in C#.

Classes are reference types that are used for complex behavior and objects, while structs are simple data structures that can be used when you want to store lightweight data with a value type behavior.

Comparison — https://referbruv.com/programming-questions/what-are-the-differences-between-a-class-and-a-struct/

Sealed Class vs Static Class

Sealed Classes and Static Classes serve special purposes in C#, and are used in different scenarios.

The primary feature of a Sealed class is its behavior with inheritance while a Static class is meant for encapsulating utility or helper behavior, which don’t maintain any state.

Comparison — https://referbruv.com/programming-questions/what-is-the-difference-between-a-sealed-class-and-a-static-class/

--

--

Sriram Kumar Mannava

I make Full Stack Development Easy for You | Full Stack .NET Dev | 3× AWS Certified | Blogger