Skip to content

HMS (Hospital Management System) is a Spring Boot microservices-based full stack application for managing hospital operations. It uses Spring Cloud Gateway, Eureka, REST APIs, JPA/Hibernate, MySQL,React js and follows layered architecture with Dockerized deployment. Built to demonstrate real-world enterprise backend design and scalability.

Notifications You must be signed in to change notification settings

raushansingh7033/HMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ TypeScript Notes for Interview Preparation

πŸ“Œ What is TypeScript?

TypeScript is a superset of JavaScript that adds:

  • Static Typing
  • Interfaces
  • Classes
  • Compile-time Error Checking
  • Modern ES Features

TypeScript code is compiled into JavaScript using:

tsc filename.ts

πŸš€ Why Use TypeScript?

JavaScript TypeScript
Dynamically Typed Statically Typed
Runtime Errors Compile-time Errors
Hard to Debug Easy to Debug
No Interfaces Supports Interfaces

βœ” Large Scale Applications βœ” Code Maintainability βœ” Better IntelliSense βœ” Refactoring


πŸ”Ή Basic Types

let id: number = 101;
let name: string = "Raushan";
let isActive: boolean = true;
let data: any = 10;
let list: number[] = [1,2,3];
let tuple: [number, string] = [1,"Hello"];

πŸ”Ή Special Types

Any

let value: any = 10;
value = "Hello";

Unknown

let userInput: unknown;

Void

function greet(): void {
   console.log("Hello");
}

Never

function error(): never {
   throw new Error("Error");
}

πŸ”Ή Type Inference

let num = 100; // inferred as number

πŸ”Ή Functions

function add(a:number, b:number): number {
   return a+b;
}

Optional Parameter

function show(name:string, age?:number){}

Default Parameter

function greet(name:string="Guest"){}

πŸ”Ή Interfaces

interface Employee {
   id:number;
   name:string;
}

let emp:Employee = {
   id:1,
   name:"John"
}

πŸ”Ή Type Alias

type User = {
   id:number;
   name:string;
}

πŸ”Ή Union & Intersection Types

Union (|)

let id: number | string;

Intersection (&)

type Admin = User & {
   role:string;
}

πŸ”Ή Enums

enum Role {
   Admin,
   User,
   Guest
}

πŸ”Ή Classes

class Person {
   name:string;

   constructor(name:string){
      this.name=name;
   }
}

Access Modifiers

  • public
  • private
  • protected
  • readonly

⭐ Generics (Very Important)

function getData<T>(value:T):T {
   return value;
}

πŸ”Ή Modules

Export

export class Test{}

Import

import {Test} from './test';

πŸ”Ή Type Assertions

let value:any="Hello";
let length:number=(value as string).length;

πŸ”Ή Decorators

function Log(target:any){}

πŸ”Ή Interface vs Type

Interface Type
Used for Object Structure Used for anything
Extendable Flexible
Less Complex More Powerful

πŸ”Ή tsconfig.json

{
 "target": "ES6",
 "module": "commonjs",
 "strict": true,
 "outDir": "./dist"
}

πŸ“Œ Most Asked Interview Topics

βœ” Interfaces βœ” Generics βœ” Union Types βœ” Enums βœ” Type vs Interface βœ” Any vs Unknown βœ” Access Modifiers βœ” Type Inference βœ” Modules βœ” Decorators βœ” tsconfig.json


About

HMS (Hospital Management System) is a Spring Boot microservices-based full stack application for managing hospital operations. It uses Spring Cloud Gateway, Eureka, REST APIs, JPA/Hibernate, MySQL,React js and follows layered architecture with Dockerized deployment. Built to demonstrate real-world enterprise backend design and scalability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages