Assistant Software Developer
Assistant Software Developer Interview Questions and Answers
Q1. How to add style using javascript
Styles can be added to HTML elements using JavaScript by manipulating the element's style property.
Access the element using document.getElementById() or document.querySelector()
Use the style property to set CSS styles, e.g. element.style.color = 'red'
Styles can also be set using CSS classes, e.g. element.classList.add('my-class')
Q2. What are promises in javascript
Promises are a way to handle asynchronous operations in JavaScript.
Promises represent a value that may not be available yet.
They have three states: pending, fulfilled, or rejected.
Promises can be chained together using .then() and .catch() methods.
They help avoid callback hell and make code more readable.
Example: new Promise((resolve, reject) => {...}).then(result => {...}).catch(error => {...})
Q3. What is the artisan in php?
Artisan is a command-line interface in Laravel PHP framework for performing repetitive tasks.
Artisan provides a set of helpful commands for developers to speed up their development process.
It can be used to generate boilerplate code, run database migrations, and perform other tasks.
Developers can also create their own custom commands using Artisan.
Example commands include 'php artisan make:model', 'php artisan migrate', and 'php artisan serve'.
Q4. Binary tree and dimeter of BST
A binary tree is a data structure where each node has at most two children. Diameter of a binary tree is the longest path between any two nodes.
Binary tree is a tree data structure where each node has at most two children.
Diameter of a binary tree is the longest path between any two nodes.
In a binary search tree (BST), the diameter is the number of nodes on the longest path between two leaves.
Q5. types of errors in php
There are three types of errors in PHP: syntax errors, runtime errors, and logical errors.
Syntax errors occur when the code is not written correctly, such as missing semicolons or parentheses.
Runtime errors occur during the execution of the code, such as trying to access an undefined variable or function.
Logical errors occur when the code runs without errors, but produces unexpected results, such as a miscalculation in a formula.
Examples of syntax errors include missing semic...read more
Interview Questions of Similar Designations
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month