DEV Community

Cover image for Sharing my Mock Interview Experience - Part 1
Annapoorani Kadhiravan
Annapoorani Kadhiravan

Posted on

Sharing my Mock Interview Experience - Part 1

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>
Enter fullscreen mode Exit fullscreen mode

Span Example

<p>Hello <span style="color:red">World</span></p>
Enter fullscreen mode Exit fullscreen mode

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>
Enter fullscreen mode Exit fullscreen mode

3.Latest HTML Version

The latest version is: HTML5

Features of HTML5:

  1. Audio and video support
  2. Semantic tags (header, footer, section)
  3. Local storage
  4. Better forms
  5. Canvas and SVG graphics
  6. 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">
Enter fullscreen mode Exit fullscreen mode

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

  1. Displays text if image fails to load
  2. Helps visually impaired users
  3. Improves SEO

Example

<img src="flower.jpg" alt="Red flower">
Enter fullscreen mode Exit fullscreen mode

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

  1. Google Drive
  2. AWS
  3. 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:

  1. OS
  2. CPU
  3. Memory
  4. Storage
  5. Uses
  6. Testing software
  7. Running multiple operating systems
  8. 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:

  1. Source code
  2. Project files
  3. Commit history
  4. Branches
  5. 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

  1. Stores history
  2. Supports teamwork
  3. Allows rollback
  4. Prevents data loss

Types

  1. Centralized VCS
  2. Distributed VCS (Git)

1. Centralized Version Control System (CVCS)

In Centralized VCS, there is:

  1. one central server
  2. all files stored in one location
  3. developers connect to that server

All Developers depend on one central server

Developer 1  ----\
Developer 2  ----- Central Server
Developer 3  ----/
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Each developer has:

  1. full code
  2. complete history
  3. all branches

11. Git Add, Commit and Push Process

Step 1: git add

git add .
Enter fullscreen mode Exit fullscreen mode

Adds files to staging area.

Step 2: git commit

git commit -m "Initial commit"
Enter fullscreen mode Exit fullscreen mode

Saves snapshot of changes.

Step 3: git push

git push
Enter fullscreen mode Exit fullscreen mode

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");
   }
}
Enter fullscreen mode Exit fullscreen mode

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){}
}
Enter fullscreen mode Exit fullscreen mode

Advantages

  1. Improves readability
  2. Reusability
  3. 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{
}
Enter fullscreen mode Exit fullscreen mode

Dog inherits eat() method from Animal.

Benefits of Inheritance

  1. Code reusability
  2. Reduces duplication
  3. Supports hierarchy
  4. Easier maintenance

Top comments (1)

Collapse
 
karthika_jasinska_443e83f profile image
karthika jasinska

nice !!