Questions

- Current working project & flow

- asp.net / asp.net core

- C#

- Sql server

- aws / azure services

- docker

- ci/cd

- jquery

                            

-------------------------------------------

Deloitte :

What is boxing and unboxing? why string is immutable? 

what is garbage collections and where implemented in your project? 

what is sessions in mvc? 

difference between routing and attribute routing? 


Difference between DENSERANK AND DENSE AND ROWNUMBER?

--  denserank har row ko rank deta hai pr yh order ko skip nahi krta like 2 row ki rank same hone pr 3rd row ko yh 2nd rank de dega

-- rank har row ko rank deta hai pr 2 row ki value same hone pr yh dono ko same rank dekr 2nd rank ko skip kr dega or 3rd row ko 3rd rank de dega

-- row number har row ko number assign krne k kaam aata hai



How do you implement security on web api

what is .net and how the code is being complied in .net. 

dependency injection, why we use it , in how many ways we can use it. 

Indexs , SP vs Functions 

What is application life cycle

What are the different caching techniques available in .NET?

OOPS Concepts Difference between for and while loops? 

Types of Cache What is API? 

Page lifecycle

Indexing, Store procedure and functions Middleware

Describe different types of authentication and how they work.

Oops, .net basic, MVC, c#, Web API,angular , current and past projects work

CTX or ROW_NUMBER

States in mvc

Garbage collection?

Session in mvc

Stored procedure and function differentiate

Run time polymorphism

Boxing unboxing

Role based authentication

Mutable immutable difference

What is Render body, render view

Oops concepts

How will you find the last inserted record of the table which doesn't contain any primary key, id or dates?

What are different types of SQL Query languages

Write a program to identify Duplicates in a list 2.Write a program to print 'X' using for loop and *

Difference between soap and rest web services

Difference between Value type and reference type

write a program to show polymorphism. write a program to find 5 factorial.

-------------------------------------------


Questions ---------------------------


- Security in web api's without jwt

- Filters in mvc , action and result filter



1. What is dependency injection


- Dependecy injection is software design pattern that allow us to develop lossely coupled application


-  in our application if change any module so other not be effected or we don't need to check other modules 

that is lossely coupled, this module are using each other but not depended on each other


1.1 Why to use dependency injection and what problem dependency injection solve

- Dependency injection help to implement decoupled architecuture where you can chnage at one place and changes are reflected at

many places


- suppose we have a coaching project where math student are studing , so we create a Object of math students, now in future

math class is replaced by science students so we need to change this to science student, it's ok for 1 or 2 controller and in big 

enterprise project we have many controller on that case it's is very big task and every module need testing that problem will occur


- we can implement dependency injection in three ways (Types of DI) ::

a. Constructor injection   

b. property injection  

c. Method injection



1.2 how to use dependency injecction in views

- A service can be injected into a view using the @injective directive.

example : @inject WebApplicationn1.IStudent _student


1.3 What is inversion of control

- Inversion of control is a concept that is say any kind of un nesesary thing what is code doing is delegate to some one else

and that code should focus on his task  not other's task , dependency ijection help on this



2. What is singleton , tranisent and scopped


2.1 what is service lifetime 

- Service life times describe for how long the instance of any class/object wll presist

Three type of service lifetime

a. AddSingleton   b. AddScoped   c. AddTransient


a. AddSingleton : Only one instance of object is created for the whole web application , on the server, it's global 

suppose we create guid in instance then this guid wil be same on every request


b. AddScopped : For every request new instance will be injected

suppose my instance will create guid so everytime even i hit or another user hit the request every time guid will be generated

- if i use Dependecy injection multiple time so in same request same instance is injected

Like if we use di multiple time in same request then sam e guid is used for all of them 



c. AddTransient : For every request new instance will be created same as scopped

but if we use dependency injection multiple time then every time new instance will be created 

like if we use multiple dependency injection in single request then every time new guid will created for every instance


Important :

What is delegate and event 

- delegates :- delegates is hold the reference of method, for this method return type & parameter should be same, 

it can refer more than one parameters

When we need to pass method as a parameter we can use delegates.

- A multicast delegates in c# is a delegates that holds the reference of more than one function.

- Delegate pointing methods without name are called anonymous delegates.

- event : event is notification machinesm that is depent on delegates, it's can not be created without delegates

event is like a wrapper over delegates to improve it's security



3. abtract class vs interface

- An abstract class can have both method declarations and definitions, but an interface only has method declarations 

(though starting with C# 8.0, interfaces can also include default implementations).

- An abstract class does not support multiple inheritance, but an interface does.

- We can create constructors in abstract classes, but not in interfaces.

- An abstract class uses the `abstract` keyword, while an interface uses the `interface` keyword.



4. viewbag/viewdata and temp data

- Viewdata and viewbag are used to transfer the from controller to view 

- Tempdata is used for transfer the data from one action to another action


- viewbag does not required typecasting where as viewdata required typecasting 



5. asp.net project structure

6. About appsettings & startup file

7. what is middleware and how to create middleware

- middleware is a component that will executed on every request in the asp.net core application

- in startup class configure method we can set middleware

- some prebuild middlewares are app.UseRouting, app.UseStaticFiles, app.UseAuthorization, app.UseExceptionHandler


- For creating custom middleware we need to add class in project in that class we inherit the IMiddleware interface

after that we need to create a InvokeAsync Method on that metod we can write our custom logic

now we need to configure this class in startup class configureService method using service.addscope/transient/or singleton

after that we need to add app.useMiddleware<middlewarename> in our startup configure method.


8. strongly type views


9. how to prevent class from inherting

10. net core support multple inheritence ? , how?

11. What is JIT

12. What is BCL & FCL

13. Value type & Reference type

14. boxing & unboxing


Value type : int , bool , char , decimal , byte

Reference Type : string , array, class, object


- Boxing is the process of converting from value type to reference type

like int a = 100;

Object obj = a;


- Unboxing is the process of converting reference type to value type , explicit casting is required in unboxing

Like : int i = (int)Obj;



15. api type (get, post, put, delete) & uses

16. What is JWT and JWT structure

17. Action Filter

- Action filter are used to run before or after running the action 

- Action filter are custom filters which can run before & after an action method is executed.

- Example : OnActionExcuting(Run Before) & OnActionExecuted (Run After)

- Filters in .net core : Authorization filter, Resource filter, Action filter, Exception filter, result filter 

(note : excution of this filter are same as write)


a. Authorization filter : Authorization filters are used to enforce authentication and authorization rules for your action methods.

Example : 

[Authorize(Role equal "Admin")] //jiska role admin hoga wahi access kr skta hai

public ActionResult Create()

{

//Logic

}


b. 



18. oops concept in C#

19. asp.net core life cycle

20. .net lastest version and in which version you worked


21. Constructor

- Constructor is a special method of the class that is automatically invoked when an instance of the class is created.

- The name of the constructor should be same as of the class name, otherwise it will be hard to identify it from other methods

- Every class require a constructor to be present init if we want to create the instance of that class.

- Every class contains an implicit constractor if not defined explicitily and with the help of that implicit constructor intanse of that class

can be created.


What is the need of defining a constructor explicitily again ?

- Implicit constructor of a class will initialize variable of a class with the same value even if we create multiple instance of that class.

- If we define contructor explicitly with parameters then we get a change of initializing the field or variables of that class with a new value 

every time we are going to create instance of that.


Note : Generally every class requires some values for execution and the values that are required for a class to execute are always sent to that 

class by using constructor only.


Type Of Constructor :

1. Default Constructor : A constructor without having any parameter is default constructor

2. Parameterized  Constructor : A constructor With at least one parameter is a parameterized constructor

3. Copy Constructor : The constructor which creates an object by copying variables from another object is called a copy constructor.

4. Static Constructor : Static constructor is used to be called before any static member of a class is called.

5. Private Constructor  : When a constructor is created with a private specifier , it is not possible for other classes to derived from this class,

neither it is possible to create an instance of this class




22. Caching and session

23. Solid principle

24. design pattern

25. Collections

26. partal class

27. how to return to view / way of returning data to view

28. abstraction real time example

29. polymorephism and it's type

- Polymorephism is the abiity of variable, method or function to take multiple form

  Like add int number with Add() function and add string with Add() function

  

- Polymorephism have two type 

a. Method overloading(compile Time)  b. Method OverRiding(Run Time)


a. Method Overloading (Compile Time) : Compile time means when you build your project then compiler will give you error

- Method overloading is type of polymorephism in which we can create multiple methods of the same name in the same class 

and all methods work in different ways

- we can achieve method overloading in three ways 

1. Number of parameter are different

2. data types of parameters are different

3. Order of parameters is different



b. Method OverRiding(Run Time) : Runt time means when your build is completed and browser will show your application 

- In Method OverRiding we need base class and derived class where base class using virtual keyword and 

derived class used override keyword 

- In method overriding methods of same name are in different class, Inheritenance is used in this

- Both methods have same signature

- It's RunTime polymorephism


[Note] : OverRiding is not mendatory of virtual class




** Method Hiding

- In method hiding , we can completely hide the implementation of the methods of a base class from the derived class 

using the new keyword



30. action result

31. use of mvc

32. how many web.config will be there for application

33. which data type used to store images

34. page life cycle

35. bubble sort

36. sorting code in c#

37. view state

38. app.config

39. optional parameters

40. struct, object vs var ( very important)

41. palindrome code in c#

42. how many session can have in application

43. what is async-await and working flow


44. What is routing? Explain attribute routing in asp.net core ?

- Routing is used to handel incomming http request based on the url 

- It will check the request and then mapped that request to controller and their action method.

Types of routing : a). Conventional Routing  b). attribute based routing


a). Conventional routing :- Conventional routing uses predefined patterns to map URLs to controller actions. 

It's best suited for typical applications with well-defined, consistent URL structures (like websites with static sections).


Conventional Routing----

- Defined centrally in the Startup.cs file.

- Limited to predefined patterns.

- Applications with a standard and predictable URL structure.


app.UseEndpoints(endpoints =>

{

    endpoints.MapControllerRoute(

        name: "default",

        pattern: "{controller=Home}/{action=Index}/{id?}");

});



b). Attribute routing :- Attribute routing allows you to define routing directly in the controller or action methods using route attributes. 

It provides more control and flexibility, especially for APIs or custom URL structures.


- Attribute based routing is the ability to manipulate the behaviour of url by route attribute

Like [Route("NewIndex")] but our action name will be index so when any one hit newindex index action will run so here we manipulate 

the behaviour of url


[Route("products")]

public class ProductsController : Controller

{

    [Route("details/{id}")]

    public IActionResult Details(int id)

    {

        return Content($"Product ID: {id}");

    }

}


Attribute Routing----

- Defined directly in controllers and actions.

- Fully customizable at the action level.

- APIs and scenarios with custom or RESTful URL structures.



45. which principle or method you are using for develop apllication (agile)

46. cookies and type

47. Overloading & OverRiding

48. Reverse words in a string

49. What is Reflection?

50. Delegate


51. What is Use() , Run() & Map() extension method

- Use() method is used to run first then pass the control to next method

Like app.UseStaticFiles(); app.UseAuthorization();


- Run() : run method will terminate the chain

no other middleware will run after this

should be place at end of the pipeline


Map() : it will your parameter with the url

The map extension method is used to match the request delegates based on a request's url path.


52. What is Request delegates

- Requet delegates are used to build the request pipeline.

- Request delegates handel request pipeline by using use(), run(), & map extension method


53. Difference between Encapsulation & Abstraction

- Encapsulation means wrapping of data & method/properties into a single unit 

- Abstraction means show only required things and hide the background details like string.substring() method


54. Delegate vs Event

55. Static vs singleton

56. Ref vs Out

- By using ref and out keyword we can pass parameters by reference

- When you want to return more than one value from a method then you can use out and ref parameter


- No need to initialize out parameter before passing it. 

- Must initializ the ref parameter before passing it.


- Out parameter must be initialized before returning

- Initialization is not neccessary for ref parameter before returning it.



57. String vs stringBuffer

- String is immutable in C# , It means if you define one string then you could'nt modify it.

Every time you will assign some value on it , it will create a new string


- String Builder is Mutable in C# , this means if any manipulatation will be done on string , 

then it will not create a new instance every time.


- String is lite weight compare to string builder so you no need to change string again & again so string is good choice



58. IEnumerable vs IQueryable

59. Thread vs Task

---- multithreading refer to the abiity to execute multiple threads or multiple task of code concurrently or simultaneously within

a single process.


- Thread & Task are two different ways for doing multithreading only.

- Thread is general programming concept for all programming language

- Microsoft created Task in .Net to simplify the use of threads.

- Tasks are likely a wapper over threads and internally task uses threads only


Advantages of task over threads :

1. Simplified Code

2. Exception handling

3. A Task can return a result, but there is no proper way to return a result from thread

4. We can apply chaining and parent/child on multiple tasks, but it can be very difficult in threads.

5. Task support multiple processor running at the same time but thread not 


60. Constant vs Readonly , how many time we can change the value of constant and readonly

61. == vs Equal


62. var vs dynamic ( important)

- var determine things during compile time , it's statically typed. it will give us suggestions when we perform some action

- While dynamic determines type during runtime . it's dynamically typed, it will not give us any suggestions.


63. Lazy vs Eager Loading

64. Array vs ArrayList

65. Concurrent vs Parallel

66. Normal collection vs Generics

67. Struct vs Class

68. Filters vs Middleware

69. Property vs Variable

70. Throw vs Throw ex

- Throw ex will change the stack trace , Where as throw will preserve the whole stack trace

Like : some cases throw ex will change the error line number with catch block line number 

but throw will show complete line number


71. What is the difference between Finally & Finalize ?


- Finally is used in exception handling

- Finalize is a method which is automatically called by the garbage collector to dispose the no longer needed objects.


72. What is difference between synchrous  & asynchronous programming

- synchrous process is waiting for execution of fist method while asynchronous is not wait for the execution of fist task



SQL Server -----------------


1. Difference between function and stored procedure


a. Function must be return a value but stored procedure may or may not be return  a value

b. We can't call store procedure from function , while we can call function from stored procedure

c. Functions has only input parameter , but store procedure can have input and output both parameters

d. We can use function in select, insert, update , delete statement but we can't use stored procedure with them

e. We can't use try catch exception handling in function but we can use exception handling in stored procedure

f. We can't use transaction inside function but we can use transaction inside SP


1.1 How to optimize a stored procedure


a. Use SET NOCOUNT On

b. Avoid * from select statement instead of this use column name which is required

c. Use Exists() instead of Count()

d. Use schema name before objects or tablenames Ex : Select EmpId, Name From dbo.Employee

e. Don't use dynamic query, they are vulnerable to sql injections

f. Use transaction when required only


2. char & varchar , nchar & nvarchar (sql server)

- Char have fixed length if we insert small length then other length will be wastage of memory

char(10) = "Hello" so 5 spaces is waste

- varchar : it fexisable in length , it don't waste memory , it's not accept unicode value

- nvarchar : as a varchar also it's unicode values 


3. Trriger


- Trigegr are stroed programs which are automatically run or execute when some event(select, update, delete) occur.

- Trigger are two types 

1. Instead of trigger : An instead of trigger is a trigger that is allow you to skip an update, 

delete , insert statement to a table and execute other statement that will define in trigger

2. After Trigger : In after trigger , update on a table will executed first then trigger will run.


4. Joins and self join (sql server)

- A join clause is used to combine rows from two or more tables, based on a releated column between them 


- Types of join 

a. Inner Joins : give the common values

b. Left join : perfer the left table values

c. Right Joins : perfer the right table values

d. Full outer join : give complete values form both tables


- Self join is join of a table to itself 

Example : Select employee with manager name

Select e.FirstName as EmployeeName, m.FirstName as ManagerName

From Employee as e left join Employee as m on m.employeeId = e.managerId

order by manager;



5. find N max salary

- Select Top 1 salary From (Select Distinct Top 3 Salary 

From Employee

Order by salaryalary desc) Result

Order by salary asc

6. primary key and foriegn key (sql server)

7. normilazation de in sql (sql server)

8. Select second salary in db by query (sql server)

9. composite key, inverse propsoition ,ef db first table change what Will happen.

10. Primary key vs Unique key

- Primary key should be single in a table , Unique key can be one or more than one in a table

- Primary key can not accept null value , unique key can accept only one null value

- Primary key create clustered index  , Unique key create non-clustred index



11. What is index & Clusterd vs nonclustred index

- Index are used in relational database to retrieve data very fast

it's similar to the index at the start of the book, which purpose is to find topics quickly


- Types of index

a. Clusterd index : A clustered index define the order in which data is physically stored in a table, 

only one clustred index in a table, primary key will automatically create a clustered index

Clusterd index is fast as compare to non-clustred index

for example : dictionary

For create clustered index

Create Clusterd index <index_name>

on <table_name>(<column_name> asc/desc)


b. non-clustred index :  A non-clustred index is stored at one place and data is stored in another place. 

So this index is not physically stored similar to book index, 

a table can have multiple non-clustred index, unique key can create non-clustred index,

it's slower than clustered index

For create non clustred index

Create NonClustered Index <index_name>

on <table_name>(<column_name> asc/desc)

 



12. Delete vs Truncate vs Drop

- Delete is used for delete the row with filter, it's DML (data manipulatation language), it can be rollback

- Truncate : It's used to delete all rown from table but not schema, it's DDL type & can be rollback

- Drop : It's used for delete the complete table schema with data, it's DDL type & cannot be rolled back.

 

13. == vs Equal

- == Compare object reference, .Equals() compare object contents, string datatype always does content comparison


14. Union vs unionAll (important)

- Union will return all result from tables but not duplicate records means it will give duplicate records single records

- Union All will return all result from tables include duplicate records it will give duplicate records multiple entry

- union all is faster than union so when you ensure no duplicate data you have in table then use union all 


15. Temp Table vs CTE

- CTE is common table expression which is used for temporary result set

- CTE is good for breaking down complex query into managablep pieces

- CTE is used With keyword


Temp table 

- It's used when we need to perform multiple operations on large data set

- When we need to reuse the data multiple times in a same session


16. What is cursor ? Why to avoid them


- A database cursor is control which enables travesal/iteration over the rows or records in the table

- It's a 5 step process for creating a cursor

1. Declare (Declare cursor_product Cursor)

2. Open (Open cursor_product)

3. fetch using while loop (Fetch next from cursor_product into @productname;)

4. Close (close cursor_product)

5. Deallocate (Deallocate cursor_product)



17. What is Constraint in sql server ? what are it's types

- Sql Constraint are used to specify rules for the data in table

- Constraint are used to limit the type of data that can go into a table

Example : Primary key, Foriegn key, not null, check, unique , default


18. What is the difference between Having clause & Where Clause 


- Where Clause is used before group by and it filter rows before aggregation

Select Count(CustomerID, Country From customer

where country = "India"

Group by country

Having Count(CustomerID) > 5;


- Having clause is used before group by & filter groups after aggregation.

Select  empName from Employee

Group by empName

Having sum(EmpSalary) > 50000;


19. What is subquery or nested query or Inner query

- A subquery or Inner query or nested query is a query within another query and embedded within the where clause

Example : Select Id From Employee

  Where OfficeCode in (Select OfficeCode From Offices Where Country = "USA")

  

20. What are index in sql server





-------------------------------------------------------------------

-------------------------------------------------------------------


### 1. Why do we need a constructor when we can perform the same operation with a function?


A constructor is needed because:


- It **initializes** an object **at the time of creation** automatically.

- Unlike a function, a constructor is called only **once per object**.

- It ensures that an object is always in a **valid state** before use.


---


### 2. What checklist do you follow for unit testing?


- Write **test cases** for all methods/functions.

- Use **mocking frameworks** (like Moq in C#) to isolate dependencies.

- Ensure each test is **independent**.

- Use **assertions** to validate expected outputs.

- Test **edge cases, exceptions, and boundary conditions**.

- Run tests **automatically in CI/CD pipelines**.


---


### 3. How can you optimize code, and what is the use of SonarQube?


#### **Code Optimization Techniques**


- **Use caching** (e.g., Redis) to reduce DB calls.

- **Use efficient algorithms & data structures**.

- **Remove unnecessary loops & reduce database queries**.

- **Use async programming** to improve performance.

- **Refactor duplicated code (DRY principle)**.


#### **SonarQube**


- It analyzes **code quality, security vulnerabilities, and performance issues**.

- Helps enforce **coding standards** and prevents technical debt.


---


### 4. How to optimize a stored procedure?


- **Use proper indexes** to speed up queries.

- **Avoid SELECT *** (fetch only required columns).

- **Use table variables instead of temp tables** (when possible).

- **Avoid cursors** (use set-based operations).

- **Use proper JOINs instead of nested queries**.

- **Optimize WHERE conditions** (avoid functions in WHERE clauses).


---


### 5. What is normalization?


Normalization is the process of organizing a database to:


- **Remove redundancy** (duplicate data).

- **Ensure data integrity**.

- **Improve efficiency** by dividing tables into smaller, related tables (1NF, 2NF, 3NF, etc.).


---


### 6. How do you secure your APIs?


- Use **JWT (JSON Web Token)** or OAuth for authentication.

- Implement **rate limiting** to prevent DDoS attacks.

- Validate **all inputs** to prevent SQL Injection & XSS.

- Use **HTTPS** instead of HTTP.

- Enable **CORS policy** securely.


---


### 7. What type of storage is S3 & how to secure S3 data while fetching?


✅ **S3 is an object storage service** (used for storing files, images, logs, backups).


#### **Security Measures**


- Use **IAM roles & policies** for access control.

- Enable **S3 bucket encryption** (AES-256).

- Use **signed URLs** for temporary access.

- Enable **bucket versioning** to protect against accidental deletion.


---


### 8. What is Authorization and Authentication?


✅ **Authentication:** Verifying "Who you are" (Login with Username/Password, OTP, etc.).

✅ **Authorization:** Verifying "What you can do" (Access control like Admin/User permissions).


---


### 9. In which case does the finally block not execute?


- When `Environment.Exit()` is called.

- If the program crashes due to an unhandled exception.

- When the system shuts down unexpectedly.


---


### 10. Can a parent try-catch block handle an exception occurring in a child try block?


Yes, the parent `catch` block can handle exceptions thrown in the child `try` block **if the child block does not catch the exception**.


Example:

```csharp

try {

    try {

        throw new Exception("Child Exception");

    } catch (FormatException ex) {

        Console.WriteLine("Caught in child: " + ex.Message);

    }

} catch (Exception ex) {

    Console.WriteLine("Caught in parent: " + ex.Message);

}

```


---


### 11. Can we create multiple non-clustered indexes in a table? How does it affect CRUD operations?


Yes, multiple **non-clustered indexes** can be created, but:


- They improve **read (SELECT) performance**.

- They **slow down INSERT, UPDATE, DELETE operations** due to index maintenance.

- Too many indexes increase **storage cost**.


---


### 12. What is an Object? (Explain like I am a kid)


An object is like a **toy car**:

- It has **properties** (color, size, brand).

- It can **do things** (move, honk).

- It is created from a **blueprint** (a class).


---


### 13. What is a Class? (Explain like I am a kid)


A class is like a **blueprint for a toy**:

- You can make **many objects** from it (different toy cars of the same type).

- It defines **how the objects should behave**.


---


### 14. What is Dynamic Polymorphism?


Dynamic polymorphism means **method overriding** (deciding method execution at runtime).


Example:

```csharp

class Animal {

    public virtual void Speak() {

        Console.WriteLine("Animal speaks");

    }

}

class Dog : Animal {

    public override void Speak() {

        Console.WriteLine("Dog barks");

    }

}

```


---


### 15. What is the use of an abstract class?


- **Defines common behavior** that subclasses must implement.

- Can contain **implemented and unimplemented methods**.


Example:

```csharp

abstract class Animal {

    public abstract void MakeSound();

    public void Sleep() {

        Console.WriteLine("Sleeping...");

    }

}

```


---


### 16. Why do we need an interface when we can create a class for the same action?


- **Interfaces allow multiple inheritance**.

- **They enforce a contract** without defining behavior.

- **Decouples implementation** from definition.


---


### 17. What is the flow of execution in a stored procedure?


1. **Check syntax**.

2. **Execute pre-compiled plan**.

3. **Use parameters** (if any).

4. **Execute queries inside procedure**.

5. **Return results**.


---


### 18. Can I achieve the same result from INNER JOIN and nested queries? Which is better?


Yes, **INNER JOIN is usually better** because:


- It is **faster** than nested queries.

- The **query plan is optimized** by the database engine.

- Nested queries can be **harder to read and maintain**.


---


### 19. What is a selector in jQuery?


jQuery selectors help **select and manipulate** elements.

```javascript

$("#myId"); // Select element by ID

$(".myClass"); // Select element by class

$("div"); // Select all div elements

```


---


### 20. What is the difference between document.ready() and window.onload?


✅ `$(document).ready()` fires **when DOM is ready**.

✅ `window.onload` fires **after everything (including images) loads**.


---


### 21. What is the difference between class and ID in jQuery?


✅ `#id` is **unique**.

✅ `.class` applies to **multiple elements**.


---


### 22. What is the difference between attr() and prop() in jQuery?


✅ `.attr()` gets/sets **HTML attributes**.

✅ `.prop()` gets/sets **DOM properties**.


Example:

```javascript

$("input").attr("checked");

$("input").prop("checked");

```


Comments

Popular posts from this blog

Text Mining In Python For Beginners to Advance

Docker Tutorial For Beginners: Basic Commands of Docker

Object oriented programming interview questions

Stock Buy and Sell to earn Maximize Profit programme in Python