Posts

Showing posts from 2023

Object oriented programming interview questions

Question 1: Why Object Oriented Programming? Answer: Object-oriented programming helps us think in terms of real-world objects. Example: Doctor attending the patient, so a particular patient has a doctor class Patient { public string name { get; set; } public string address { get; set; } public Doctor doctorDetails { get; set; } } class Doctor { public string name { get; set; } } Question 2: What are the important pillars in OOP? Answer: Abstraction: Show only what is necessary Polymorphism: Objects act differently under different conditions Inheritance: Parent-Child relations Encapsulation: Hide complexity

SQL Server

Question 1: What is redundancy? Answer: Redundancy occurs when the same piece of information is stored in the database multiple times. Normalization helps remove redundancy. Three major problems arise due to redundancy: Insertion anomaly: When the same information is entered in the database multiple times. Deletion anomaly: When deleting information from the database may lead to unintended deletions. Modification anomaly: When updating one piece of information requires updating multiple instances of the same data. Example: Consider a scenario where a doctor attends to a patient, creating a relationship between a particular patient and a doctor. Table Example: Patient Information PatientID PatientName DoctorID DoctorName 1 John Doe 101 Dr. Smith 2