Though I have attended many interviews, but always my heart, beats faster whenever I hear the term "Interview" , I will go complete blank with so much anxiety 😅 I hope many people can feel it. After a long gap, I am preparing myself to compete in the race of developer and had a mock interview experience, starting with self-intro. I realized that, if we learn any topics, should be strong with all "Wh" questions.
Let me share the list of questions asked to me along with answers :
1. Difference Between Div and Span Tag
| Div Tag | Span Tag |
|---|---|
| Block-level element | Inline element |
| Takes full width | Takes only required width |
| Starts in new line | Stays in same line |
| Used for large sections | Used for small text styling |
Div Example :
<div>
<h1>Welcome</h1>
</div>
Span Example
<p>Hello <span style="color:red">World</span></p>
2. What is HTML?
HTML stands for HyperText Markup Language.
It is the standard language used to create webpages and structure content on the internet.
HTML is used to:
Create headings
Add paragraphs
Insert images
Create links
Build forms and tables
Design webpage structure
Example
<h1>Hello World</h1>
<p>This is HTML</p>
3.Latest HTML Version
The latest version is: HTML5
Features of HTML5:
- Audio and video support
- Semantic tags (header, footer, section)
- Local storage
- Better forms
- Canvas and SVG graphics
- Mobile-friendly support
4. HTML Attributes
Attributes provide extra information about HTML elements.
They are written inside the opening tag.
Syntax :
Example :
<img src="image.jpg" alt="Nature">
Here:
src → image path
alt → alternative text
Common HTML Attributes
| Attribute | Purpose |
|---|---|
| id | Unique identification |
| class | Group elements |
| href | Link address |
| src | File/image path |
| alt | Alternative text |
| style | Inline CSS |
| title | Tooltip text |
5. IMG Tag ALT Attribute
The alt attribute provides alternative text for an image.
Purpose
- Displays text if image fails to load
- Helps visually impaired users
- Improves SEO
Example
<img src="flower.jpg" alt="Red flower">
If image is missing, "Red flower" text appears.
6. Benefits of Cloud Computing
Cloud Computing allows storing and accessing data through the internet instead of local computers.
Benefits
1. Cost Saving - No need to buy expensive hardware.
2. Scalability - Resources can increase or decrease easily.
3. Accessibility - Access data from anywhere.
4. Data Backup - Cloud providers maintain backups.
5. Security - Provides encryption and protection.
6. Faster Deployment - Applications can be launched quickly.
Examples
- Google Drive
- AWS
- Microsoft Azure
7. Virtual Machine (VM)
A Virtual Machine is a software-based computer running inside another computer.
It behaves like a real computer with:
- OS
- CPU
- Memory
- Storage
- Uses
- Testing software
- Running multiple operating systems
- Server virtualization
Example
Running Linux inside Windows using VirtualBox.
8. What is Repository in Git?
A repository (repo) is a storage location where project files and version history are maintained.
Git repository contains:
- Source code
- Project files
- Commit history
- Branches
- Documentation
9. What Stuff is Available Inside Repository?
Inside a Git repository:
| Item | Purpose |
|---|---|
| Source code | Project program files |
| Commit history | Saved changes |
| Branches | Multiple development versions |
| README file | Project explanation |
| Configuration files | Project settings |
| Images/Documents | Supporting files |
10.What is Version Control System?
A Version Control System (VCS) tracks changes made to files and source code over time.
Advantages
- Stores history
- Supports teamwork
- Allows rollback
- Prevents data loss
Types
- Centralized VCS
- Distributed VCS (Git)
1. Centralized Version Control System (CVCS)
In Centralized VCS, there is:
- one central server
- all files stored in one location
- developers connect to that server
All Developers depend on one central server
Developer 1 ----\
Developer 2 ----- Central Server
Developer 3 ----/
2. Distributed VCS:
- every developer has full repository copy
- history stored locally
- no dependency on single server
Developer 1 <----> Remote Repository
Developer 2 <----> Remote Repository
Developer 3 <----> Remote Repository
Each developer has:
- full code
- complete history
- all branches
11. Git Add, Commit and Push Process
Step 1: git add
git add .
Adds files to staging area.
Step 2: git commit
git commit -m "Initial commit"
Saves snapshot of changes.
Step 3: git push
git push
Uploads code to remote repository like GitLab or GitHub.
12. What is Constructor in Java?
A constructor is a special method used to initialize objects.
Features
- Same name as class
- No return type
- Automatically called when object is created
Example
class Student{
Student(){
System.out.println("Constructor called");
}
}
Uses
- Initialize variables
- Allocate resources
- Set default values
13. What is Method Overloading in Java?
Object-Oriented Programming concept where multiple methods have same name but different parameters.
Example
class Math{
void add(int a,int b){}
void add(int a,int b,int c){}
}
Advantages
- Improves readability
- Reusability
- Flexibility
14. What is Inheritance in Java?
Inheritance allows one class to acquire properties and methods of another class.
Parent Class → Superclass
Child Class → Subclass
Example
class Animal{
void eat(){
System.out.println("Eating");
}
}
class Dog extends Animal{
}
Dog inherits eat() method from Animal.
Benefits of Inheritance
- Code reusability
- Reduces duplication
- Supports hierarchy
- Easier maintenance
Top comments (1)
nice !!