Home / Sushil Kumar (page 2)

Sushil Kumar

Javascript code snippets for interview with Answer

Certainly! Here are a few JavaScript code snippets that are commonly used in interviews, along with their explanations: Reverse a String: Question:Write a function to reverse a string. Answer:javascript function reverseString(str) { return str.split('').reverse().join(''); } Check for Palindrome: Question:Write a function to check if a given string is a palindrome. …

Read More »

Here are some common interview questions and answers related to microservices:

Q1: What are microservices? A1: Microservices are a software architecture pattern where an application is built as a collection of small, loosely coupled, and independently deployable services. Each service is responsible for a specific business capability and can be developed, deployed, and scaled independently. Q2: What are the benefits of …

Read More »

Top Javascript Interview Questions and answer

1.) What is JavaScript? JavaScript is a high-level, interpreted programming language primarily used for building interactive web pages and web applications. It provides dynamic functionality, enables client-side and server-side scripting, and can be used alongside HTML and CSS to create dynamic web content. 2.) What are the different data types …

Read More »

Simple JavaScript code in promises.

function promiseExample(){ const promise = new Promise((resolve, reject) =>{ resolve('successfully!'); }) .then((resolve) => console.log(resolve)) .catch((reject) => console.log(reject)); return promise; } promiseExample() I have a create simple code example for promises. you can easily check. how to resolve is working? and how to reject is working?

Read More »

How to fetch API Data from API in React Using useEffect?

import React, { useState, useEffect } from "react"; // Use can use css from this file: import "./styles.css"; const url = "https://jsonplaceholder.typicode.com/posts"; function App() { const [userData, setUserData] = useState({}); const getUserData = async () => { const response = await fetch(url); const jsonData = await response.json(); setUserData(jsonData); }; useEffect(() …

Read More »

Given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[i] and a[j] are digit anagrams.

Given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[i] and a[j] are digit anagrams. Two integers are considered to be digit anagrams if they contain the same digits. In other …

Read More »

Add static content in Magento Checkout address form

If you are reading this, you are probably looking for an easy way to add static content to the Checkout address fieldset. If you open the Magento Checkout module, you will notice technology complexity of the Magento Checkout. When you consider Knockout, HTML, PHTML, XML, JS – such a mix …

Read More »

SEO vs. PPC: Structured data markup for product variants

You did it – you finally did it! You’ve implemented all recommended schema.org types and properties throughout your Magento store only to see Google Merchant Center warning you for “Insufficient match of microdata price information”. Let’s admit it – we’ve all been there at least once. Although we don’t usually …

Read More »

Schema Markup for eCommerce Websites

Each time someone searches a particular product online, they end up on a SERP that (in most cases) includes a gazillion results. Since the chances of browsing through all of these links are little to none, it’s essential to make your business stand out. The best way to do it …

Read More »