Posts

Showing posts from 2025

.NET Interview Questions:

.NET Interview Questions: Encapsulation What is encapsulation, and how is it implemented in object-oriented programming? How can private data members be accessed in the context of encapsulation? Polymorphism What are the different types of polymorphism? Can you explain real-time use cases of polymorphism? Constructor What is a constructor, and what are its different types? Static Keyword What is the use of the static keyword in C#/.NET? HTTP Methods What is the difference between HTTP GET and PUT methods? SQL Operations What is the difference between TRUNCATE and DELETE in SQL? What is a ROLLBACK in SQL, and when is it used? Filters What are filters in ASP.NET MVC/Core, and how do they work? Routing How does routing work in ASP.NET MVC/Core? Authentication and Authorization What is the difference between authentication and authorization? How are authentication and authorization implemented in .NET? ...

Common Tech Stack in Digital Clinics

  1. Frontend (Used on Tablets, PCs, or Browsers): Web App (Doctor & Reception): Angular / React / Vue.js – For modern, responsive UIs. Flutter – If they're using a single app across iOS & Android tablets. HTML5/CSS3/JavaScript – Lightweight interfaces for browser-based UIs. 2. Backend (Core Logic & APIs): Node.js / Express.js .NET Core / ASP.NET MVC – Popular in enterprise clinics. Python (Django / Flask) – For startups or AI-based diagnostics. Java Spring Boot – For high-scale hospital systems. 3. Database: PostgreSQL / MySQL – Widely used for structured patient & appointment data. MongoDB – For flexible medical records, prescriptions, notes. Firebase (Firestore) – If using a Google-based mobile solution. 4. Hosting/Cloud: AWS / Azure / GCP – Hosting, databases, file storage (X-rays, reports). Firebase / Supabase – Used in simpler mobile-first apps. 5. Prescription Generation (Print at Reception): ...

Deploy a .NET Core application on Hostinger

You can deploy a .NET Core 9 (ASP.NET Core) application on Hostinger — but only using their Linux VPS (not shared or Windows hosting). Here's how it works and what plan you'd need: ✅ Supported? Hostinger doesn’t support classic ASP.NET on Linux. Instead, you deploy ASP.NET Core apps on their Ubuntu 22.04 VPS via terminal and reverse-proxy (NGINX) ( support.hostinger.com ). 🛠 Recommended VPS Plans for .NET Core 9 Hostinger offers four KVM-based VPS tiers optimized for ASP.NET Core deployments ( hostinger.in ): Plan vCPU  RAM NVMe SSD Bandwidth Price (India, 24‑mo) KVM 1 1 4 GB 50 GB 4 TB ₹429/month (renews ₹699) KVM 2 2 8 GB 100 GB 8 TB ₹599/month (renews ₹949) KVM 4 4 16 GB 200 GB 16 TB ₹799/month (renews ₹1,999) KVM 8 8 32 GB 400 GB 32 TB ₹1,699/month (renews ₹3,999) (Prices from Hostinger India, 24‑month term) ( hostinger.in ) ⚙ Which Plan Should You Choose? Small/personal apps → KVM 1 (1 vCPU, 4 GB RAM) is ...

GATE EXAM

## 🧠 What is GATE? The **GATE exam** is a national-level test conducted to evaluate the **understanding of various engineering and science subjects**. It is primarily used for: * **Postgraduate admissions** (M.Tech/M.E./Ph.D.) in IITs, NITs, IIITs, and other top institutes. * **Recruitment to PSUs** (Public Sector Undertakings) like IOCL, NTPC, ONGC, etc. * **Higher studies abroad** in some countries (like Germany and Singapore). * **Fellowships and scholarships** (like in CSIR labs and research institutes). --- ## 📌 GATE 2025 Highlights | Feature | Details | | -------------------- | ---------------------------------------------------- | | **Conducting Body** | IISc Bangalore or one of the IITs (rotational basis) | | **Eligibility** | Bachelor's degree in Engineering/Technology/Science | | **Exam Mode** | Online (Computer-Based Test) | | **Duration** | 3 Hours ...

Consume API in MVC Application

Image
 To map the response from API ( https://localhost:7264/api/Product ) to a .NET MVC Web App , you need to call the API from your controller and deserialize the response into a model, which you can then pass to a view. 1: Create the Product Model 2: Call API from MVC Controller 3: Register HttpClient in Program.cs (or Startup.cs ) 4: Create the Razor View ( Views/Product/Index.cshtml ) 5: Route to Controller Step 1: Create the Product Model public class Product {     public int Id { get; set; }     public string Name { get; set; }     public decimal Price { get; set; } } Step 2: Call API from MVC Controller using Microsoft.AspNetCore.Mvc; using ProductManagementMVC.Models; using System.Net.Http.Headers; using System.Text.Json; namespace ProductManagementMVC.Controllers {     public class ProductController : Controller     {         private readonly HttpClient _httpClient;         public Pro...

API development using .NET Core - ProductManagmentCRUD

Image
 1) Create Database and Table as mentioned below queries create table products(ProdId int Primary key, ProductName varchar(20), Price int ) insert into products (ProdId, ProductName, Price ) values (1,'Laptop','45000'); insert into products (ProdId, ProductName, Price ) values (2,'Mouse','500'); insert into products (ProdId, ProductName, Price ) values (3,'Router','1800'); select * from products; 2) Create ASP.NET Core API Project Install NuGet Packages  3)  AppSettings.json {   "Logging": {     "LogLevel": {       "Default": "Information",       "Microsoft.AspNetCore": "Warning"     }   },   "ConnectionStrings": {     "DbConnection": "Server=Server_name; Database=ProductManagementCrud; User Id=sa; password=oj#$kdfn; TrustServerCertificate=True;"   },   "AllowedHosts": "*" } 4) Model -  Product.cs namespace ProductManagmentCRUD.Mo...

Reverse String using C#

 using System; //Input- My name is Sachin //Expected output- yM eman si nihcaS public class HelloWorld {     public static void Main(string[] args)     {         string input = " My name is Sachin ";         string[] words = input.Split(' ');         string result = "";         foreach (string word in words)         {             char[] chars = word.ToCharArray();             Array.Reverse(chars);             result += new string(chars) + " ";         }         // Trim the extra space at the end         result = result.TrimEnd();         Console.WriteLine(result);     } }

Singleton Design Pattern Realtime Example of banking

Image
Logger Utility in a Banking System using Singleton In a banking application, you might have a logger that logs important events like transactions, errors, and user activities. You want to ensure that only one instance of the logger exists throughout the application to maintain a consistent log format and avoid file access conflicts. 1) Why Singleton? A logging class doesn't need multiple instances. One instance is sufficient and more efficient. 2) Consistency: All log messages are centralized through one instance. 4) Resource Management: Avoids file access conflicts and redundant memory usage. using System; public sealed class Logger {     private static Logger instance;     // Private constructor to prevent instantiation from outside     private Logger()    {         Console.WriteLine(" Logger Initialized. ");     }     // Public method to get the single instance     public static Logger ...

Coding Round

 using System; using System.Linq; using static System.Runtime.InteropServices.JavaScript.JSType; class Program {     public static void Main()     {         ProblemStatementOne.ArrayHeights();         ProblemStatementTwo.RearrangeArray();                     } } public static class ProblemStatementOne {     public static void ArrayHeights()     {         int[] heights = { 10, 6, 8, 5, 11, 9 }; //exp op [3,1,2,1,0]         List<int> result = new List<int>();         for (int i = 0; i < heights.Length; i++)         {             int count = 0;             for (int j = 0; j < i; j++) // look only to the left             {             ...

Angular Questions and Answers

List of commonly asked Angular interview questions along with clear, concise answers.  Core Angular Concepts 1. What is Angular? Angular is a TypeScript-based front-end web framework developed by Google for building single-page applications (SPAs) with MVC architecture. 2. What is a Component in Angular? A component controls a part of the UI. It consists of: A class ( .ts ) for logic An HTML template Optional CSS styles 3. What is a Module? An Angular module ( NgModule ) is a container for a set of related components, services, and other modules. Example: AppModule , SharedModule 4. What are Directives? Directives modify DOM behavior or structure. Structural: *ngIf , *ngFor Attribute: ngClass , ngStyle 5. What is Data Binding? Mechanism to bind data between component and view. Types: One-way (Interpolation, Property binding) Two-way ( [(ngModel)] ) Advanced Angular Features 6. What is Dependency Injection (DI)? A design pattern in Angular for injecting ...

React Interview Questions and answers

React + JavaScript Technical Interview Questions and Answers 1. What is Callback Hell? Callback Hell is a pattern of deeply nested callbacks that make asynchronous code hard to read and maintain. Solutions: Promises, async/await , and modularizing logic. 2. What is React Fiber? React Fiber is the internal engine that enables React to handle rendering more efficiently with incremental rendering , prioritization , and pausing/resuming work . 3. What is the render() function? In class components, render() returns JSX that describes what the UI should look like. It’s a pure function based on props and state. 4. What are Higher-Order Components (HOCs)? Functions that take a component and return a new one, used to add reusable logic (e.g., logging, data fetching). Example: withAuth(Component) . 5. What is a React Portal? A way to render children into a DOM node outside the main component hierarchy (e.g., modals). Use: ReactDOM.createPortal(child, container) . 6. What is memo in React?...

.NET Interview Questions and Answers for .NET, Web API, and SQL:

1. What is the use of Startup.cs and Program.cs in .NET? Program.cs : Entry point of the application. Builds and runs the host. Startup.cs : Configures services (via ConfigureServices ) and the HTTP request pipeline (via Configure ). 2. What is middleware in .NET Core? Middleware is software that handles requests and responses in the HTTP pipeline. Examples: authentication, routing, exception handling. 3. What is the difference between Authentication and Authorization? Authentication : Verifies who the user is. Authorization : Determines what the user can access. 4. How to authenticate Web API? Common methods include: JWT (JSON Web Token) OAuth2 API Keys Cookie-based (less common for APIs) Use [Authorize] attribute with appropriate schemes. 5. What are HTTP verbs in Web API? GET : Retrieve data POST : Create data PUT : Update/replace data PATCH : Update part of data DELETE : Remove data 6. How to make Web API accept onl...

.NET Interview Questions with Answers

What is Polymorphism? Answer : Polymorphism is the ability of a method, function, or object to take on different forms. It allows objects of different types to be treated as objects of a common supertype, and the correct method is invoked depending on the object’s actual type. What is Method Overloading? Answer : Method overloading is when multiple methods in the same class have the same name but different parameters (either in type, number, or both). The appropriate method is chosen based on the method signature. What is the difference between ref and out? Answer : ref : The variable must be initialized before being passed to the method. out : The variable does not need to be initialized before being passed to the method but must be assigned a value inside the method. What is the static method? Answer : A static method belongs to the type itself rather than an instance of the class. It can be called without creating an instance of the class. Why...