DEV Community

Cover image for Mock Interview Experience - Part 2
Annapoorani Kadhiravan
Annapoorani Kadhiravan

Posted on

Mock Interview Experience - Part 2

Here is my second mock interview experience, where I got an idea of how to learn each concepts and how to understand in different perspective. It was so helpful for me to learn more and grow more. Questions I was being asked in my mock interview are as follows :

1. Self Intro

2. What is Salesforce?

Salesforce is a cloud-based Customer Relationship Management (CRM) platform used by businesses to manage customers, sales, marketing, support, and business processes.

Key Features

  • Customer data management
  • Sales tracking
  • Marketing automation
  • Customer support management
  • Reports and dashboards
  • Cloud-based (accessible from anywhere)

Example

A company can use Salesforce to:

  • Store customer details
  • Track sales opportunities
  • Send marketing emails
  • Handle customer complaints

Benefits

  • No need to install software locally
  • Centralized customer information
  • Automation of business processes
  • Better customer engagement

3. What is JavaScript (JS)?

JavaScript is a programming language used to make web pages interactive and dynamic.

Uses

  • Form validation
  • Image sliders
  • Dropdown menus
  • Animations
  • Fetching data from servers
  • Building web and mobile applications

Example

alert("Welcome!");
Enter fullscreen mode Exit fullscreen mode

When the page loads, a popup message appears.

Why JS?

HTML creates structure, CSS adds design, and JavaScript adds behavior.


4. Alternate for JavaScript?

Several languages can be used instead of JavaScript in certain scenarios.

Language Purpose
TypeScript Superset of JS with type checking
Dart Used with Flutter
CoffeeScript Compiles into JS
Elm Functional front-end language
WebAssembly (WASM) High-performance browser applications

Most Popular Alternative

TypeScript

Example:

let age: number = 25;
Enter fullscreen mode Exit fullscreen mode

It helps catch errors during development.


5. What is a Dynamic Language?

A dynamic language is a language where variable types are determined during execution (runtime), not before execution.

JavaScript Example

let data = 10;      // Number
data = "Hello";     // String
data = true;        // Boolean
Enter fullscreen mode Exit fullscreen mode

The same variable can hold different types of data.

Advantages

  • Flexible
  • Faster development
  • Less code

Disadvantages

  • Type-related bugs may appear at runtime
  • Harder to maintain large applications

JavaScript is a dynamically typed language.


6. Types of Variables in JavaScript

JavaScript provides three ways to declare variables.

1. var

var name = "John";
Enter fullscreen mode Exit fullscreen mode

Characteristics

  • Function scoped
  • Can be redeclared
  • Can be updated
var x = 10;
var x = 20;
Enter fullscreen mode Exit fullscreen mode

2. let

let age = 25;
Enter fullscreen mode Exit fullscreen mode

Characteristics

  • Block scoped
  • Cannot be redeclared
  • Can be updated
let age = 25;
age = 30;
Enter fullscreen mode Exit fullscreen mode

3. const

const PI = 3.14;
Enter fullscreen mode Exit fullscreen mode

Characteristics

  • Block scoped
  • Cannot be redeclared
  • Cannot be reassigned
const PI = 3.14;
// PI = 3.15 ❌ Error
Enter fullscreen mode Exit fullscreen mode

Quick Comparison

Feature var let const
Scope Function Block Block
Redeclare Yes No No
Update Yes Yes No

7. Difference Between Programming and Coding

Coding Programming
Writing instructions in a language Complete software development process
Converts logic into code Includes planning, design, coding, testing
Smaller activity Broader activity
Focus on syntax Focus on problem solving

Coding Example

console.log("Hello");
Enter fullscreen mode Exit fullscreen mode

Programming Example

Building a Student Management System:

  1. Analyze requirements
  2. Design database
  3. Write code
  4. Test application
  5. Deploy system

Programming includes coding, but coding alone is not programming.


8. HTML vs HTML5

HTML HTML5
Older version Latest version
Limited multimedia support Built-in audio and video support
Uses plugins for media No plugins needed
Fewer semantic tags More semantic tags
No local storage Supports local storage

HTML Example

<div>Header</div>
Enter fullscreen mode Exit fullscreen mode

HTML5 Semantic Tags

<header>Header</header>
<nav>Navigation</nav>
<section>Content</section>
<footer>Footer</footer>
Enter fullscreen mode Exit fullscreen mode

New HTML5 Features

  • <audio>
  • <video>
  • <canvas>
  • Local Storage
  • Geolocation
  • Semantic tags

9. What is Ternary Operator?

A ternary operator is a shortcut for a simple if...else statement.

Syntax

condition ? value1 : value2;
Enter fullscreen mode Exit fullscreen mode

Example

Using if-else:

let age = 20;

if(age >= 18){
    status = "Adult";
}else{
    status = "Minor";
}
Enter fullscreen mode Exit fullscreen mode

Using ternary:

let status = age >= 18 ? "Adult" : "Minor";
Enter fullscreen mode Exit fullscreen mode

When to Use

✅ Simple conditions

let result = marks >= 35 ? "Pass" : "Fail";
Enter fullscreen mode Exit fullscreen mode

When Not to Use

❌ Multiple complex conditions

Use if...else if...else instead.


10. What is default in Switch Case?

The default case executes when none of the cases match.

Example

let day = 8;

switch(day){
    case 1:
        console.log("Monday");
        break;

    case 2:
        console.log("Tuesday");
        break;

    default:
        console.log("Invalid Day");
}
Enter fullscreen mode Exit fullscreen mode

Output

Invalid Day
Enter fullscreen mode Exit fullscreen mode

Can default Be Used Between Cases?

✅ Yes, JavaScript allows default anywhere inside a switch.

Example:

switch(day){
    case 1:
        console.log("Monday");
        break;

    default:
        console.log("Invalid Day");
        break;

    case 2:
        console.log("Tuesday");
        break;
}
Enter fullscreen mode Exit fullscreen mode

Best Practice

Place default at the end because:

  • Easier to read
  • Common industry standard
  • Improves code maintainability

11. What is used to find the type of data used in a program?

typeOf();

Example :

typeOf(123);

Output:
Number
Enter fullscreen mode Exit fullscreen mode

Summary

Salesforce: Cloud-based CRM platform used to manage customers, sales, and support.

JavaScript: Programming language used to add interactivity and dynamic behavior to web pages.

Dynamic Language: A language where variable types are determined at runtime.

Variables in JS: var, let, const.

Programming vs Coding: Coding is writing code; programming includes design, coding, testing, and deployment.

HTML vs HTML5: HTML5 is the latest version with semantic tags, audio, video, canvas, and local storage.

Ternary Operator: Short form of if...else using condition ? value1 : value2.

Default in Switch: Executes when no case matches; can be placed anywhere but is usually kept at the end.

Top comments (0)