Thursday, 30 December 2021
IQ
Saturday, 20 November 2021
React JS IQ
- given word last letter should be capital.
- Cloure function
- diff class component, functional component
| Functional Components | Class Components |
| A functional component is just a plain JavaScript function that accepts props as an argument and returns a React element. | A class component requires you to extend from React. Component and create a render function which returns a React element. |
| There is no render method used in functional components. | It must have the render() method returning HTML |
| Also known as Stateless components as they simply accept data and display them in some form, that they are mainly responsible for rendering UI. | Also known as Stateful components because they implement logic and state. |
| React lifecycle methods (for example, componentDidMount) cannot be used in functional components. | React lifecycle methods can be used inside class components (for example, componentDidMount). |
- Error Handling in React.
- how to give generic exception and display the message
- error boundaris
- what is call back hell function
- what is non blocking io---asyncronous call
- what is stright mode
- Differenec Virtual dom and Real dom.
- react life cycle
- what is promise unchining,promise.all-- promise is asyncronous call
- diff let,var,const
- what is closur function,nested function
- basic ES6 features- let and var,promise,iterator
- How to deploy React application
- React Router types how it works,nested routes
- What is Arrow function,uses
- spread operator
- what is generator
- what is hooks- use memo,use context,use effect
- How redux works
- diff element and component
- how to prevent rerendering-- using pure componentd or use memo
- React application performence.
- synthatic events.
- what is controlled components
- how to set initial state in Redux
- Store in Redux
- How many types are Reducers
- what is Data binding
- What is context API
Sunday, 3 October 2021
React JS questions
- Remove duplicate characters in array of elements
- Given word last letter should be capital.
- Closure function
- diff class component, functional component
- Error Handling in React.
- how to give generic exception and display the message
- error boundaris
- what is call back hell function
- what is non blocking io---asyncronous call
- what is stright mode
- Differenec Virtual dom and Real dom.
- react life cycle
- what is promise unchining,promise.all-- promise is asyncronous call
- diff let,var,const
- what is closur function,nested function
- basic ES6 features- let and var,promise,iterator
- How to deploy React application
- React Router types how it works,nested routes
- What is Arrow function,uses
- spread operator
- what is generator
- what is hooks- use memo,use context,use effect
- How redux works
- diff element and component
- how to prevent rerendering-- using pure componentd or use memo
- React application performence.
- synthatic events.
- what is controlled components
- how to set initial state in Redux
- Store in Redux
- How many types are Reducers
- Redux life cycle
- Diff State and props
- what is Data binding
- What is context API
- diff betewen Null and undefined
- typeof(null)
- Event bubling
- Define Json array
- how to detect object like mobile or tab-- using responsiveness media query
- purpose of encoding url
- what is decorater
- copy an object in javascript-- object
- Remove duplicate characters in array of elements
- const uniqueNames = Array.from(new Set(names));
- Given word last letter should be capital.
const cap = str => str .split(' ') .map(x => ( x.length === 1 ? x.toUpperCase() : `${x[0].toUpperCase()}${x.slice(1,-1)}${x[x.length -1].toUpperCase()}`) ) .join(' ') console.log(cap("a quick brown fox"))- diff class component, functional component
There is no render method used in functional components.
React lifecycle methods (for example, componentDidMount) cannot be used in functional components.It must have the render() method returning HTML
React lifecycle methods can be used inside class components (for example, componentDidMount).
Tuesday, 28 September 2021
IQ
- What tecnics are using for generating tokens
- Which one is faster DBfirst or code first
- what is bundle config and CDN
- what is application object and session object and differenece
- abstarct class and interface
- IIS request processing
- status codes-403,200,500
- what render
- web api testing tecnincs
- difference web api,wcf.
- without using try block how to handle exceptions
- verbs in web api
- what are contracts
- diffbetween service contract and message contract
- solid principles
- How to Install certificates in IIS
- Passport authentication works
- Difference between Webservice/WCF
- Webapi Token types
- Code first/DB first approach Which one better
- Where configure endpoints in WCF
- Differenec between XML/JSON
- Bundle config/CDN which one is better
Monday, 20 September 2021
IQ
- What is Base class for Asp.net
- Authentication and Authorization config settings
- Forms Authentication config settings
- Difference between Datareader/Dataset, Handlers/Modules
- How to make web api calls asynchronously.
- How many ways to pass data to View to controller
- Merge key word in sql.
- CTE main purpose
- Solid principles
- What type of code in Pre render
- CI/CD process.
Cons of JavaScript
1. Client-side Security
Since the JavaScript code is viewable to the user, others may use it for malicious purposes. These practices may include using the source code without authentication. Also, it is very easy to place some code into the site that compromises the security of data over the website.
2. Browser Support
The browser interprets JavaScript differently in different browsers. Thus, the code must be run on various platforms before publishing. The older browsers don’t support some new functions and we need to check them as well.
3. Lack of Debugging Facility
Though some HTML editors support debugging, it is not as efficient as other editors like C/C++ editors. Also, as the browser doesn’t show any error, it is difficult for the developer to detect the problem.
4. Single Inheritance
JavaScript only supports single inheritance and not multiple inheritance. Some programs may require this object-oriented language characteristic.
5. Rendering Stopped
A single code error can stop the rendering of the entire JavaScript code on the website. To the user, it looks as if JavaScript was not present. However, the browsers are extremely tolerant of these errors.
Difference between inline query and stored procedure
2.Stored procedures reduces network traffic.
Since Stored procedures are stored in the server, only the name of Stored procedure is required to pass to the server. But in the case of inline queries , the complete query has to be passed to the server. So inline queries will increase network traffic when the queries are very large.
3.Stored procedures support Deferred Name Resolution.That is we can create stored procedures for objects(eg:- tables) which are not yet created ( and will be creating in the near future)
4.Stored procedures prevents SQL Injection Errors.
5.By using Stored procedures we can seperate all the queries from the Business logic code.
Therefore we can create a seperate layer.
But while writing inline queries , all the queries have to be written (mixed up ) with the business logic code. This create problem while debugging.
6.Developers can work simultaneously while using stored procedures.
While a programmer writes business logic, another one can create stored procedures at the same time.
Friday, 19 March 2021
Monday, 15 March 2021
React JS QS
What is React?
React is an open-source frontend JavaScript library which is used for building user interfaces especially for single page applications. It is used for handling view layer for web and mobile apps. React was created by Jordan Walke, a software engineer working for Facebook. React was first deployed on Facebook's News Feed in 2011 and on Instagram in 2012.
What are the major features of React?
The major features of React are:
- It uses VirtualDOM instead of RealDOM considering that RealDOM manipulations are expensive.
- Supports server-side rendering.
- Follows Unidirectional data flow or data binding.
- Uses reusable/composable UI components to develop the view.
What is JSX?
JSX is a XML-like syntax extension to ECMAScript (the acronym stands for JavaScript XML). Basically it just provides syntactic sugar for the React.createElement() function, giving us expressiveness of JavaScript along with HTML like template syntax.
In the example below text inside <h1> tag is returned as JavaScript function to the render function.
class App extends React.Component {
render() {
return(
<div>
<h1>{'Welcome to React world!'}</h1>
</div>
)
}
}
How to create components in React?
There are two possible ways to create a component.
Function Components: This is the simplest way to create a component. Those are pure JavaScript functions that accept props object as first parameter and return React elements:
function Greeting({ message }) {
return <h1>{`Hello, ${message}`}</h1>
}
Class Components: You can also use ES6 class to define a component. The above function component can be written as:
class Greeting extends React.Component {
render() {
return <h1>{`Hello, ${this.props.message}`}</h1>
}
}
When to use a Class Component over a Function Component?
If the component needs state or lifecycle methods then use class component otherwise use function component.However, from React 16.8 with the addition of Hooks, you could use state , lifecycle methods and other features that were only available in class component right in your function component.
What is state in React?
State of a component is an object that holds some information that may change over the lifetime of the component. We should always try to make our state as simple as possible and minimize the number of stateful components.
Let's create an user component with message state,
class User extends React.Component {
constructor(props) {
super(props)
this.state = {
message: 'Welcome to React world'
}
}
render() {
return (
<div>
<h1>{this.state.message}</h1>
</div>
)
}
}
State is similar to props, but it is private and fully controlled by the component. i.e, It is not accessible to any component other than the one that owns and sets it.

