Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

InterviewQuestionJS-React-CSS-html

The document covers various JavaScript concepts, including primitive and non-primitive data types, string manipulation using regular expressions, random song selection from an array, and recursive functions. It also discusses React features like Virtual DOM, code splitting, and the differences between React versions, along with Redux principles and usage. Additionally, it touches on CSS selectors, semantic HTML elements, and the importance of CI/CD pipelines in software development.

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

InterviewQuestionJS-React-CSS-html

The document covers various JavaScript concepts, including primitive and non-primitive data types, string manipulation using regular expressions, random song selection from an array, and recursive functions. It also discusses React features like Virtual DOM, code splitting, and the differences between React versions, along with Redux principles and usage. Additionally, it touches on CSS selectors, semantic HTML elements, and the importance of CI/CD pipelines in software development.

Uploaded by

Pavan Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

javascript:

----------------------------------------------------------------
1. What are non primitive data types and primitve data types
Ans: Non-primitive: array, object, functions
Primitive : string, number, null, undefined, boolean
2. how do you extract only alphabets from the below string using regular expresion
or tell him his wish?
var str = "Wel34#%*com5e" // Welcome
Ans: str.replace(/[^a-zA-Z]/gi, '') or diff solutions
3. using below data how do you play random song from below array list?
var data = ["song1.mp3", "song2.mp3", "song3.mp3", "song4.mp3", "song5.mp3"]
Ans: data[Math.floor(Math.random() * data.length)]
4. how to increment and decrement a value. open below link write a program with out
using
any global variable (give below link to candidate)
https://codesandbox.io/s/increment-decrement-in-js-forked-pfvzhc?file=/
index.html
5. reverse string with out using any predefined methods like split reverse join-
using prototype develop program
Ans: String.prototype.rev = function() {
var str = "";
for(var i=this.length-1; i>=0 ; i--) {
str += this[i]
}
return str;
}
//"govind".rev() // dnivog

6. What is recursive function and using recurisve strategy how do you add one or
more disabled parameter to the below data
(if you want create in react js also)
var data = [
{
name: "General",
children: [
{
name: "Account",
children: []
}
]
},
{
name: "Category",
children: [
{
name: "Subject",
children: []
}
]
}
]
output:
var outputdata = [
{
name: "General",
disabled: false,
children: [
{
name: "Account",
disabled: false,
children: []
}
]
},
{
name: "Category",
disabled: false,
children: [
{
name: "Subject",
disabled: false,
children: []
}
]
}
]
Ans:
function recursive(data) {
return data.map(x=> {
return ({
...x,
disabled: false,
children: x.children ? recursive(x.children) : []
})
})
}
OR diff solution using for loop ...etc
7. How to detect user in online or ofline using javascript

var data - [""]


React JS
------------------------------------------------------
What is Virtual DOM?
Virtual DOM is technique to optimize the performance of an application, basically
it compares two render trees to know what exactly changed
and only updates what is necessary on the actual DOM In React, for every DOM
object, there is a corresponding “virtual DOM object.”
A virtual DOM object is a representation of a DOM object

1. what is current version of react js including version number


2. Difference between react 18 and 17
3. What is React DOM Client (introduced in react 18)
4 -in react 18 what methods replaced by ReactDOM.render and ReactDOM.hydrate
OR What are new root api's in react 18
Ans: createRoot and hydrateRoot
5. what is code splitting
Ans: React.laz() and React.suspense() using this we can reduce the inital
loading bundle size that mean it load component based on demand
6. diff between useMemo and useCallback and write syntax diference
Ans:
const table = useMemo(() => (<TableComponent data={list} />), [list])// it
will re-render only when there is change in data list
const handleChange = useCallback(()=> {
//your code here
});
7. Open Note pad and write a reusable collapsible accordion component in reactjs
(if candiate reaches min 70% code then consider)
var data = [
{
name: "General",
content: "General text goes here"
},
{
name: "Category",
content: "text goes here"
}
]
8. create custom hook in react js
9. what is render props feature in react js
10. What are the usage of interceptors

Redux:
---------------------------------------
1. What are the Redux Three Principles
- Single source of truth (store.getState())
- state is readonly (dispatch) - The only way to change the state is to emit an
action using dispatch,
- changes happen through pure functions (reducers)
2. what is usage of batch method in redux
Ans: for grouping multiple dispatch events to improve performance
3. how to handle api call using
Ans: dispatch(action1)
const action1 =() {
return (dipatch) => {
axios.get(url).then((res)=> {
dispatch({type: "actionname", payload: res})
})
}
}
4. diff between redux and redux toolkit

CSS:
---------------------------
1. What are the available combinators (important selectors)
Ans:
descendant selector (space)
child selector (>)
adjacent sibling selector (+)
general sibling selector (~)
2. css browser prefixes
Ans: -webkit-, -moz-, -ms-, -o-
3. diff between flex-shrink and flex-basis

HTML:
-What are the semantic and non-semantic elements
Ans: Semantic: article, main, section, header, footer, nav ...etc
Non-semantic:div, span
-What are available new form control elements
-What are the availble web storages
Ans: local storage and session storage
-what is diff between session and local storages

https://www.workfall.com/learning/blog/how-to-build-a-hybrid-app-using-react-
native/
4 and below
JS
---------------
-What is implicity type conversion and explicity type conversion
Ans: implicity is done by javascript like alert(8.2); cancatenaton, substraction
tow strings, modululo(%)
Explicity is done by using inbuilt methods like toString, Number, parseInt,
String ..etc
-data types
-increment and decrement program
-string methods
-remove duplicates array using for loop
-array strings random value print
-string reverse with out prdefined methods
-self invoking function
-diff between for IN and for OF
-how to iterate object
-how to

UI Developer What you do: • Demonstrate development skills in front-end development


of application using Angular 8+.
• Experience in working with frameworks like REDUX. • Proficient in writing and
executing unit test cases using Karma and Jasmine. •
Use UI best practices and design patterns such as MVC, MVVM to build highly
scalable solutions.
• Experience in developing Headless architecture based UI applications.
• Build solutions for UI modernization and Migrations of Large Scale Application
Portfolios including patterns and approaches for move to cloud.
• Integrate Identity management and modern authentication and authorization
protocols such as OIDC, OAuth 2.0.
• Integrate with Serverless Functions, Logic Apps for event driven processes and
integrations
• Integrate CI/CD and continuous testing practices with ESLint into the engineering
lifecycle.
• Proficiency in working with tools for agile delivery like JIRA.
• Proficient in writing and executing unit test cases using Karma and Jasmine.
Skills you have: Must Have Should have knowledge of Angular 8+, HTML5, CSS3,
JavaScript,
jQuery, Bootstrap Must Have Should have knowledge of Typescript & ES (latest
version)
Must Have Familiarity with Popular JavaScript Libraries such as React and REDUX
Must Have
Should be able to debug on Developer Tools of the browser and Working with Cross
Browser UI
Must Have Should have good understanding in Agile Software Development projects
Preferred Good understanding and experience with Object-Oriented concepts
Preferred Knowledge of unit testing tools such as Zest, Enzyme etc.
Preferred Knowledge of Angular 8+, HTML5, CSS3, JavaScript, jQuery,
Bootstrap, Material Design Preferred Knowledge of Typescript & ES6 and ES7

function pnt(n) {
for(var row=1; row<=n; row++) {
for(var col=1; col<=row; col++) {
console.log("* ")
}
console.log("")
}
}
event-listner-dmk95p

function isEmptyInputValue(value: any): boolean {


// we don't check for string here so it also works with arrays
return value == null || value.length === 0;
}

CICD pipe line:

A continuous integration and continuous deployment (CI/CD) pipeline


is a series of steps that must be performed in order to deliver
a new version of software. CI/CD pipelines are a practice focused on improving
software delivery
throughout the software development life cycle via automation.

By automating CI/CD throughout development, testing, production,


and monitoring phases of the software development lifecycle,
organizations are able to develop higher quality code, faster.
Although it’s possible to manually execute each of the steps of a CI/CD pipeline,
the true value of CI/CD pipelines is realized through automation.

const mockAxios = axios as jest.Mocked<typeof axios>

Custom hook
const useBoolean = () => {
const [state, setState] = React.useState();

const handleTrue = () => setState(true);


const handleFalse = () => setState(false);
const handleToggle = () => setState(!state);

return [
state,
{
handleTrue,
handleFalse,
handleFalse,
},
];
};

You might also like