Untitled
Untitled
Untitled
● They are all hoisted to the top of their scope. But while
callback:a callback is a function that you pass into another function as an argument
for. const message = function() {
setTimeout(message, 3000)
Node js:node js is an open source cross platform runtime environment which is created
on chrome’s v* engine and it is used for creating server side web applications and also
at the same time it is used for right pick the data for real time application.and by nature
it is an asynchronous non blocking event driven model.
eventloop:A programming structure that continually tests for external events and
calls the appropriate routines to handle them. An event loop is often the main
loop in a program that typically waits for the user to trigger something
Its environment variables file. In simple terms, it is a variable text file. In this file
we set a variable with value and that you wouldn't want to share with anyone, but
the file is kept as secret and secure because in . env file we store our database
password, username, API key etc.
What is websocket?
The WebSocket API is an advanced technology that makes it possible to open a two-
way interactive communication session between the user's browser and a server.
Docker is a containerization platform that packages your application and all its
dependencies together in the form of a docker container to ensure that your
application works seamlessly in any environment
In today’s world all are means all the things aare depended on the data.wit the
help of data we can access any thing what ever we we want its make our life
easy but the day by day data is becoming more bigger and complex we need to
main the complex data in this scenario no sql provides a efficient and scalable
way that we can easily maintain the complex data.
What is aggregation?
Aggregation is grouping our documents and doing some mathematical
operations. With this operation he gives us output whatever we want like
maximum minimum or employees total salary etc.
BSON simply stands for “Binary JSON,” BSON’s binary structure encodes type
and length information, which allows it to be parsed much more quickly.
Since its initial formulation, BSON has been extended to add some optional non-
JSON-native data types, like dates and binary data, without which MongoDB
would have been missing some valuable support.
Languages that support any kind of complex mathematics typically have different
sized integers (ints vs longs) or various levels of decimal precision (float, double,
decimal128, etc.).
In MongoDB, indexes help in efficiently resolving queries. What an Index does is that it
stores a small part of the data set in a form that is easy to traverse. The index stores
the value of the specific field or set of fields, ordered by the value of the field as
specified in the index.
Indexes look at an ordered list with references to the content. These in turn allow
MongoDB to query orders of magnitude faster. To create an index, use the
createIndex collection method.
For example:
> db.users.find({"username":
"user101"}).explain("executionStats")
Difference between “ == “ and “ === “ operators.
Both are comparison operators. The difference between both the operators is
that,“==” is used to compare values whereas, “ === “ is used to compare both value
and types.
Example:
var x = 2;
var y = "2";
(x === y) // Returns false since the typeof x is "number" and typeof y is "string"
=>A Stack is a widely used linear data structure in modern computers in which
insertions and deletions of an element can occur only at one end, i.e., top of the Stack. It
is used in all those applications in which data must be stored and retrieved in the last.
Application of stack
● Backtracking
● Delimiter Checking
● Reverse a Data
The size of a call stack depends on various factors. It is usually defined at the
start of a program. Its size can depend on the architecture of the computer on
which the program runs, the language in which the program is written, and the
total amount of available memory in the system. When a stack overflow
occurs as a result of a program's excessive demand for memory space, that
program (and sometimes the entire computer) may crash.
Ans)While Git is a tool that's used to manage multiple versions of source code edits that
are then transferred to files in a Git repository, GitHub serves as a location for uploading
copies of a Git repositor
5.sort an Array so that all zero moved to words right [3,2,0,4, 0,5,6,0]?
let n = arr.length-1;
console.log(arr);
=>In synchronous operations tasks are performed one at a time and only when one is
completed, the following is unblocked. In other words, you need to wait for a task to
finish to move to the next one. In asynchronous operations, on the other hand, you
can move to another task before the previous one finishes.
=>JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact
and self-contained way for securely transmitting information between parties as a
JSON object. This information can be verified and trusted because it is digitally signed.
In stack, the track of the last element present in the list is tracked with a pointer
called top. Below is the diagrammatic representation of the same: Tree: A Tree tree is
a finite set of one or more nodes such that: There is a specially designated node called
root.
=>eventloop?
An event loop is something that pulls stuff out of the queue and places it onto the
function execution stack whenever the function stack becomes empty.
The only difference is the order of operations between the increment of the variable and
the value the operator returns. So basically ++i returns the value after it is
incremented, while i++ return the value before it is incremented. At the end, in both
cases the i will have its value incremented.
=>what is redis?
=>what is mongodb?
data model and a non-structured query language. It is one of the most powerful NoSQL
deploy fully managed MongoDB across AWS, Google Cloud, and Azure.
It also ensures availability, scalability, and compliance with the most stringent data
security and privacy requirements. MongoDB Cloud is a unified data platform that
includes a global cloud database, search, data lake, mobile, and application services.
Is JavaScript single thread or multi-threaded? Explain how.
=>An asynchronous function is any function that delivers its result asynchronously
– for example, a callback-based function or a Promise-based function. An async
function is defined via special syntax, involving the keywords async and await . It is also
called async/await due to these two keywords
=>synchronous
=>The biggest problem with callbacks is that they do not scale well for even
moderately complex asynchronous code. The resulting code often becomes hard to
read, easy to break, and hard to debug
=>
Explain caching.?
=>What makes caching memory faster than permamnet memory when both has equal
amt of data?
Cache memory allows for faster access to data for two reasons: cache uses Static
RAM whereas Main Memory (RAM) uses dynamic RAM. cache memory stores
instructions the processor may require next, which can then be retrieved faster than if
they were held in RAM.
A cache miss occurs either because the data was never placed in the cache, or because
the data was removed (“evicted”) from the cache by either the caching system itself or
an external application that specifically made that eviction request. Eviction by the
caching system itself occurs when space needs to be freed up to add new data to the
cache, or if the time-to-live policy on the data expired.
=>An execution policy is part of the PowerShell security strategy. Execution policies
determine whether you can load configuration files, such as your PowerShell profile, or
run scripts. And, whether scripts must be digitally signed before they are run.
Explain authenticaton & authorisation?
=>repeated
=>JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact
and self-contained way for securely transmitting information between parties as a JSON
object. This information can be verified and trusted because it is digitally signed. JWTs
can be signed using a secret (with the HMAC algorithm) or a public/private key pair
using RSA or ECDSA.
=>An Express application can use the following types of middleware: Application-level
middleware. Router-level middleware. Error-handling middleware.
how to push.
1) git add.
https://docs.google.com/spreadsheets/d/1qqgRWdi5FWsw8L80tUQBWFeuPnkv6OHemRnNJ
9AABDI/edit#gid=887086757
Q1. Are you ready to learn new tech stack related to data science?
The event loop got its name because of how it's usually implemented.JavaScript has a
runtime model based on an event loop, which is responsible for executing the code,
collecting and processing events, and executing queued sub-tasks.
In JavaScript, Hoisting is the default behavior of moving all the declarations at the
top of the scope before code execution. Basically, it gives us an advantage that no
matter where functions and variables are declared, they are moved to the top of their
scope regardless of whether their scope is global or local.
Both GET and POST method is used to transfer data from client to server in
HTTP protocol but Main difference between POST and GET method is that GET
carries request parameter appended in URL string while POST carries request
parameter in message body which makes it more secure way of transferring data
from client to server.
This function
return x * y;
can be written as
// using arrow functionslet x = (x, y) => x * y;
https://www.tutorialspoint.com/nodejs/nodejs_event_emitter.htm
In simple terms, authentication is the process of verifying who a user is, while
authorization is the process of verifying what they have access to
what is jwt,
JSON Web Token (JWT) is an open standard ( RFC 7519) that defines a compact and
self-contained way for securely transmitting information between parties as a JSON
object.
payload,
The second part of the token is the payload, which contains the claims. Claims are
statements about an entity (typically, the user) and additional data. There are three
types of claims: registered, public, and private claims.
aws,
AWS for beginners offers database storage options, computing power, content
delivery, and networking among other functionalities to help organizations scale
up. It allows you to select your desired solutions while you pay for exactly the services
you consume only.
Classes– Classes are blueprint of an Object. A class can have many Object,
because class is a template while Object are instances of the class or the concrete
implementation.
Inheritance – It is a concept in which some property and methods of an Object is
being used by another Object. Unlike most of the OOP languages where classes
inherit classes, JavaScript Object inherits Object i.e. certain features (property and
methods)of one object can be reused by other Objects.
Object– An Object is a unique entity that contains property and methods. For
example “car” is a real life Object, which has some characteristics like color, type,
model, horsepower and performs certain action like drive. The characteristics of an
Object are called as Property, in Object-Oriented Programming and the actions are
called methods. An Object is an instance of a class. Objects are everywhere in
JavaScript almost every element is an Object whether it is a function, array, and
string.
Synchronous code runs in sequence. This means that each operation must wait
for the previous one to complete before executing. Asynchronous code runs in
parallel. This means that an operation can occur while another one is still being
processed.
It is used to store in the local memory.Cashing is a common technique for making our
application faster.It let’s avoid slow operation’s.
Types of cashing
2. Miss : Didn’t find the data in cache than we can call to the db to search the data &
return the data to the client.
Open your projects in local system and run that , show me your postman
https://app.tactiq.io/api/2/u/m/r/SqLYOFNer9g3r1famMCl?o=sl
Node. js is primarily used for non-blocking, event-driven servers, due to its single-threaded
nature. It's used for traditional web sites and back-end API services, but was designed with real-
time, push-based architectures in mind.
Express
use is a method to configure the middleware used by the routes of the Express
HTTP server object. The method is defined as part of Connect that Express is based
upon.
and mongo db
What is promisify
Redis is a super fast and efficient in-memory, key–value cache and store. It's also
known as a data structure server, as the keys can contain strings, lists, sets, hashes
and other data structures. Redis is best suited to situations that require data to be
retrieved and delivered to the client as quickly as possible.
What is time complexity
What is middle ware why you use middle ware in your project
Middleware is software which lies between an operating system and the applications
running on it.
The event loop allows Node.js to perform non-blocking I/O operations despite the
fact that JavaScript is single-threaded. It is done by assigning operations to the
operating system whenever and wherever possible
· Event loop is an endless loop, which waits for tasks, executes them and then
sleeps until it receives more tasks.
· The event loop executes tasks from the event queue only when the call stack
is empty i.e. there is no ongoing task.
· The event loop executes the tasks starting from the oldest first.
Express advantages
Given some kind of conditions and asked regarding approach how to solve this. Like
authorization possess regarding and accessibility to change profile etc.
Some other question regarding approach discussion like array and stack and queue etc
where do you see yourself after 5 years
what is ur faviourate data structure,gave some scenarios and asked real world
why functionup?
Scope - The place in which a variable can be accessed. Scope Chain - A stack of
currently accessible scopes, from the most immediate context to the global
context. Global Scope - A globally scoped variable can be accessed anywhere in the
program.
In using async and await, async is prepended when returning a promise, await is
prepended when calling a promise. try and catch are also used to get the rejection
value of an async function.
1. Tell me about your favourite project & the challenges you faced in that project.
4. Write a function to calculate the max sum of three cosecutive elements in an array.
5. Write a function to merge these two arrays & result should be like this -
let array1 = [
];
let array2 = [
];
// result: [
// ];
In C++, there are different types of variables (defined with different keywords), for
example: int - stores integers (whole numbers), without decimals, such as 123 or -123.
double - stores floating point numbers, with decimals, such as 19.99 or -19.99. char -
stores single characters, such as 'a' or 'B'.
Mongodb is not installed on replit so you need to find an external place for a mongodb database.
You can achieve this with mongodb atlas which has a free tier.
MongoDB is consistent by default: reads and writes are issued to the primary
member of a replica set. Applications can optionally read from secondary replicas,
where data is eventually consistent by default.
Which method is used to Isolate the cursors from intervening with the write
Snapshot() method
Ans. Snapshot() method is used to isolate cursors from intervening the write operation. By using
this method it negotiates the index and makes sure that each query comes to an article only once.
May contains redundancy as we break up the This approach contains less redundancy if
problem into smaller fragments, then build that the data encapsulation and data hiding are
section separately. being used.
There are three major features in object-oriented programming that makes them
different than non-OOP languages: encapsulation, inheritance and polymorphism.
What is Mongoose?
Mongoose is a Node. js-based Object Data Modeling (ODM) library for MongoDB. It
is akin to an Object Relational Mapper (ORM) such as SQLAlchemy for traditional SQL
databases. The problem that Mongoose aims to solve is allowing developers to enforce
a specific schema at the application layer.
Ans.
1- Array.sort(a,b=>{return a-b});
for(i=0;i<array.length;i++)
for(j=i+1;j<array.length;j++)
1- Uniform Interface.
2-Stateless.
3-Cacheable.
4-Client-Server.
5-Layered System.
6- Code on Demand.
Ans. Middleware is software which lies between an operating system and the applications
running on it. Essentially functioning as hidden translation layer, middleware enables
communication and data management for distributed applications.
Ans. Node.js is a popular framework for building backend systems (network applications) which
can scale very well. Node.js is a JavaScript runtime based on Chrome V8 engine. It is use to
perform non-blocking activities.
Ans. A JSON Web Token (JWT) is an access token standardized according to RFC 7519, which
makes it possible for two parties to securely exchange data. It contains all important
information about an entity, meaning that no database queries are necessary and the session
doesn’t need to be saved on the server. JWT is especially popular in authentication
processes.Its short messages can be encrypted and securely convey who the sender is and
whether they have the necessary access rights.
Header
The header usually contains two parts and provides important information about the token. It
contains the type of the token and the signing/encryption algorithm being used.
Pay-Load
The header usually contains two parts and provides important information about the token. It
contains the type of the token and the signing/encryption algorithm being used.
Signature
The signature of a JSON Web Token is created using the Base64 coding of the header and
payload and the indicated signing algorithm. The structure is determined by the JSON Web
Signature (JWS).
220) Create API to get data from another API and send into JSON format?
Ans. Promises in Node JS makes it simple for the developers to write asynchronous code in a
manner that it is almost like the synchronous coding. It allows the async call to return a value
just like the synchronous function. Itdon’t need to run extra checks or try/catch for the error
handling.
Ans. An async function is a function that is declared with the async keyword and allows the
await keyword inside it. The async and await keywords allow asynchronous, promise-based
behaviour to be written more easily and avoid configured promise chains. The async keyword
may be used with any of the methods for creating a function.
JavaScript Await function is used to wait for the promise. It could only be used inside the async
block. It instructs the code to wait until the promise returns a response. It only delays the async
block. Await is a simple command that instructs JavaScript to wait for an asynchronous action to
complete before continuing with the feature. It's similar to a "pause until done" keyword.
227) BST
https://www.educba.com/binary-tree-javascript/
Ans. Find returns an array, while remaining two returns an object. Find returns the list of the matching
data, while findOne returns only the 1st matching data, and findOneAndUpdate returns the singl data after
updating it.
● NoSQL is Non-relational
● NoSQL is Low Cost
● Scalability is Easier
Disadvantages of NoSQL
· Standardization
Advantages of SQL
● Speed
● No Coding
● Retrieving Information
● Analytical Queries
Disadvantages of SQL
● Interfaces
● Complex Interface
● Implementation
● Expense
238) What are maps(), filter() and closure?
Ans. Map and filter are higher order functions, which can take functions are an input, are returns
in the form of array. Map function is use to iterate all the elements of the input array and do
some operations and returns a new array, while filter function is use to iterate all the elements
and with a condition filter out the things, condition returns the Boolean, if it is true then the filter
function will push that element in to the new array else not.
When the inner nested functions read the variables which are declared outside the function or
inside the outer functions (lexical/ inheritance) this concept is called as closure.
241) Hoisting?
Ans. When we declare the functions or a variable then JS first reserve some memory for them
Ans. In the Code Execution Phase, JavaScript being a single thread language again runs
through the code line by line and updates the values of function and variables which are stored
in the Memory Allocation Phase in the Memory Component. So, in the code execution phase,
whenever a new function is called, a new Execution Context is created.
Ans. CORS stands for “Cross-Origin Resource Sharing” and is a way for a website to use
resources not hosted by its domain as their own. This became an W3C recommendation in
2014 and has been adopted by all major browsers. The purpose is to prevent scripts from
Ans. The amount of space occupied by a code while executing is called it space complexity.
While Strict mode was introduced by ECMAScript 5 to JavaScript. Using strict mode JavaScript
silent errors can be easily detected as they would throw an error. This makes JavaScript
Pros of Express JS
Cons of Express JS
· Does not have an inbuilt ORM system or any other way to interact with
databases.
Pros of NodeJS
Node.js advantages are numerous and beneficial to all kinds of apps whether you are building a
payment system or a video streaming app. Some benefits are identified below. NodeJS:
· Has unmatchable speed due to its non-blocking architecture and event loop
feature.
Cons of NodeJS
· Lacks support for some databases, like relational ones. In any case, developers
can solve this challenge using frameworks such as Express.js.
Ans. Node.js is a popular framework for building backend systems (network applications) which
can scale very well. Node.js is a JavaScript runtime i.e. it runs the JavaScript codes. JavaScript
has long been used in webpages and run by the browsers. But now the JavaScript can also run
without a browser. This was made possible via Node.js which uses Chrome's V8 JavaScript
engine.
Ans.
Authentication Authorization
Authentication is the process of identifyingAuthorization
a is the process of giving permission
user to provide access to a system. to access the resources.
Data is provided through the Token Ids. Data is provided through the access tokens.
Ans. A call-back function always has a specific action which is bound to a specific circumstance.
Therefore, a call-back function is only called once a clearly defined operation has been
performed. Event handlers are a good example of a type of call-back function. These are used
in HTML elements such as buttons.
Ans. Software that acts as a bridge between an operating system or database and applications,
especially on a network.
Ans Callback is a function that is passed as an argument to another function and its execution is
delayed until that function in which
it is passed is executed. Meaning, if I pass a function, let's say function1 to another function, i.e.,
function2 ,then function1 will
Example:
// function
callback();
// callback function
function callMe() {
greet('Peter', callMe);
Output:
Hi Peter
I am callback function
The benefit of using a callback function is that you can wait for the result of a previous function
call and then execute another function call.
function greet() {
console.log('Hello world');
}
function sayName(name) {
setTimeout(greet, 2000);
sayName('John');
Output
Hello John
Hello world
Ans: Callback hell, also known as the pyramid of doom, is the result of intensively nested,
unreadable, and unmanageable callbacks,
Ans: Middleware functions are functions that have access to the request object (req), the response
object (res), and the next middleware function
in the application’s request-response cycle. The next middleware function is commonly denoted
by a variable named next.
1. As name suggests it comes in middle of something and that is request and response cycle
Ans: Node.js, all request are handled in a single thread with shared resources. Then how does
Node.js handle concurrent traffic or requests?
It follows “Single Threaded Event Loop Model” architecture that runs on top of single V8 engine
instance.
JavaScript can run in different programming environments, and Node.js being among the most
popular environments using JavaScript. Therefore,
how the programming environment operates rather than how the language in itself.
Ans: Each thread will use the same Node.js architecture which is single-threaded based.
You can achieve multithreading by generating multiple nodes or Node.js V8 engines which in
isolation are single-threaded.
Ans: The event loop is a constantly running process that monitors both the callback queue and the
call stack.
If the call stack is not empty, the event loop waits until it is empty and places the next function
from the callback queue to the call stack.
291. What is Assert and its syntex?
If the expression evaluates to 0, or false, an assertion failure is being caused, and the program is
terminated.
Synatx:
assert(expression, message);
message Optional. Specifies the error message to be assigned to the AssertionError. If omitted, a
default message is assigned
Ans: The S3 object storage cloud service gives a subscriber access to the same systems that
Amazon uses to run its own websites.
S3 enables customers to upload, store and download practically any file or object that is up to 5
terabytes (TB) in size -- with
Ans: Quicksort. Quicksort is one of the most efficient sorting algorithms, and this makes of it one of
the most used as well.
The first thing to do is to select a pivot number, this number will separate the data, on its left are
the numbers smaller
Ans: A promise is an object which can be returned synchronously from an asynchronous function. It
will be in one of 3 possible states:
});
myPromise.then(
);
Ans: SQL (Structured Query Language) is a powerful and standard query language for relational
database systems.
We use SQL to perform CRUD (Create, Read, Update, Delete) operations on databases along
with other various operations.
SQL is used to
create databases
delete databases
b) Mongodb Query
Ans: MongoDB Query is a way to get the data from the MongoDB database. MongoDB queries
provide the simplicity in process of fetching data
from the database, it’s similar to SQL queries in SQL Database language.
In other words, the $eq operator is used to specify the equality condition.
Syntax:
Example:
db.article.find({author:{$eq:"devil"}})
Here, we are going to display the documents that matches the filter query(i.e., {author : {$eq :
“devil”}}) from the article collection.
To get the specific numeric data using conditions like greater than equal or less than equal use
the $gte or $lte operator in the find() method.
Syntax:
or
Example:
db.article.find({length:{$gte:510}})
Here, we are querying to get documented data which has the length attribute value greater than
510. So, we pass a filter query that is
Ans: Node.js accepts the request from the clients and sends the response, while working with the
request node.js handles them with a single thread.
To operate I/O operations or requests node.js use the concept of threads. Thread is a sequence
of instructions that the server needs to perform.
It runs parallel on the server to provide the information to multiple clients. Node.js is an event
loop single-threaded language.
It can handle concurrent requests with a single thread without blocking it for one request.
Non-blocking I/o:
Non-blocking i/o means working with multiple requests without blocking the thread for a single
request. I/O basically interacts with external
systems such as files, databases. Node.js is not used for CPU-intensive work means for
calculations, video processing because a single thread
Asynchronous:
Asynchronous is executing a callback function. The moment we get the response from the other
server or database it will execute a callback
function. Callback functions are called as soon as some work is finished and this is because the
node.js uses an event-driven architecture.
The single thread doesn’t work with the request instead it sends the request to another system
which resolves the request and it is accessible
Ans: Single Thread refers to executing an entire process from begining to end without interruption
by a thread.
Multi Thread refers to allowing multiple threads within a process such that they execute
independently but share their resources.
Shallow copy is a bit-wise copy of an object. A new object is created that has an exact copy of the
values in the original object.
If any of the fields of the object are references to other objects, just the reference addresses are
copied i.e., only the memory address
is copied.
Example.
Shallow Copy: It makes a copy of the reference to X into Y. Think about it as a copy of X’s
Address. So, the addresses of X and Y will be
the same i.e. they will be pointing to the same memory location.
Deep copy
A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by
the fields. A deep copy occurs when an object
Example.
Deep copy: It makes a copy of all the members of X, allocates different memory location for Y and
then assigns the copied members to Y to
achieve deep copy. In this way, if X vanishes Y is still valid in the memory.
Ans. A higher order function is a function that takes a function as an argument, or returns a function.
Higher order function is in contrast to
first order functions, which don’t take a function as an argument or return a function as output.
.map() and .filter(). Both of them take a function as an argument. They're both higher order
functions.
Example:
callback function.
////////////////////////////////////////////////////////////////////////////
})
console.log(announcements)
The .filter() method executes a callback function on each element in an array. The callback
function for each of the elements must return
either true or false. The returned array is a new array with any elements for which the callback
function returns true.
///////////////////////////////////////////
return n > 5;
});
i) Most Effective Sorting Algorith?
Ans: Quicksort is one of the most efficient sorting algorithms, and this makes of it one of the most
used as well. The first thing to do is to
select a pivot number, this number will separate the data, on its left are the numbers smaller than
it and the greater numbers on the right
Ans: Quick sort is one of the most important sorting methods in javascript. It takes a pivot value(a
random value) from an array. All the other
elements in the array are split to two categories.They may be less than the pivot value and greater
than the pivot value.
After that each of the categories(less than the pivot and greater than the pivot) are subjected to
the same procedure that is a pivot is chosen
then each category is divided in to sub-categories(less than the pivot and greater than the pivot).
The sub-categories are divided in such a way that they may contain an element or no element if
there are no more elements to compare.
The rest of the values will be denoted as a pivots at some previous points and did not trickle
down to this lowest sub category
property called prototype to the created function. This prototype property is an object (called as
prototype object) has a constructor
property by default. This constructor property points back to the function object on which the
prototype object is a property
Example
// constructor function
function Person () {
this.name = 'John',
this.age = 23
// creating objects
Person.prototype.gender = 'male';
console.log(Person.prototype);
// inheriting the property from prototype
console.log(person1.gender);
console.log(person2.gender);
Ans No.
Ans: Key:
A “key” is a special string attribute you need to include when creating lists of elements in React.
Keys are used to React to identify which
items in the list are changed, updated, or deleted. In other words, we can say that keys are used to
give an identity to the elements in the
lists
ref:
Refs provide a way to access DOM nodes or React elements created in the render method. In the
typical React dataflow, props are the only way
that parent components interact with their children. To modify a child, you re-render it with new
props
or
ref gives access to the DOM element. Whereas key identifies which item has been changed,
added or removed.
d) what is express?
Ans: Express is a node js web application framework that provides broad features for building web
and mobile applications.
It's a layer built on the top of the Node js that helps manage servers and routes.
Ans PUT handles updates by replacing the entire entity, while PATCH only updates the fields that you
give it.
PATCH does not change any of the other values. If you use the PUT method, then everything will
get updated.
Ans: An async function is a function declared with the async keyword, and await keyword is
permitted within it.
The async and await keywords enable asynchronous, promise-based behavior to be written in a
cleaner style, avoiding the need to
explicitly configure promise chains.
Ans: Non-blocking means that if an answer can't be returned rapidly, the API returns immediately
with an error and does nothing else.
synchronous mean you call the API, it hangs up the thread until it has some kind of answer and
returns it to you.
501. what is node.js and how have you implemented node.js in your
projects.
Step 2: Make sure Node and NPM are installed and their PATHs defined.
Redis is a super fast and efficient in-memory, key–value cache and store.
It's also known as a data structure server, as the keys can contain strings, lists, sets,
hashes and other data structures. Redis is best suited to situations that require data to
be retrieved and delivered to the client as quickly as possible.
503. what is aws and why do we perticularly use aws only and not any
other server.
1. pwd 2. ls — Use the "ls" command to know what files are in the directory
you are in. You 3. cd — Use the "cd" command to go to a directory.4. mkdir &
rmdir — Use the mkdir command when you need to create a folder or a directory. 5. rm -
Use the rm command to delete files and directories6. touch — The touch command is
used to create a file.7. man & --help — It shows the manual pages of the command. For
example, “man cd” shows the manual pages of the cd command. Typing in the
command name and the argument helps it show which ways the command can be used
(e.g., cd –help).8. cp — Use the cp command to copy files through the command line. It
takes two arguments: The first is the location of the file to be copied, the second is
where to copy.9. mv — Use the mv command to move files through the command line.
We can also use the mv command to rename a file.
Event loop is an endless loop, which waits for tasks, executes them and then
sleeps until it receives more tasks. The event loop executes tasks from the event
queue only when the call stack is empty i.e. there is no ongoing task. The event
loop allows us to use callbacks and promise
506.what is async and await and write the syntax of async await
Async await makes it easier to write promises.The keyword ‘Async’ before a
function makes the function return a promise always,It makes sure that your
code passed through a promise. Await is used inside async functions,which
makes the programme wait untill the promises resolves.Basically It maintain a
request parallaly by non blocking.
Promise lets asynchronous methods return values like synchronous methods: instead
of immediately returning the final value, the asynchronous method returns a promise to
supply the value at some point in the future.
508.what is caching
Caching is the concept of saving commonly / frequently used data in memory and use
them on behalf of the actual data source when the same types of operations or data are
requested. Benefits: 1.Reduce data cost,reduce the load on the backend.
509.MongoDb
An asynchronous function is any function that delivers its result asynchronously – for
example, a callback-based function or a Promise-based function. An async function is
defined via special syntax, involving the keywords async and await . It is also called
async/await due to these two keywords.
511.what is non-blocking
It refers to the program that does not block the execution of further operations. Non-
Blocking methods are executed asynchronously. Asynchronously means that the
program may not necessarily execute line by line.
Constants are block-scoped, much like variables declared using the let keyword. The
value of a constant can't be changed through reassignment , and it can't be redeclared .
513.hoisting?
In JavaScript, Hoisting is the default behavior of moving all the declarations at the top
of the scope before code execution. Basically, it gives us an advantage that no matter
where functions and variables are declared, they are moved to the top of their scope
regardless of whether their scope is global or local
map() creates a new array from calling a function for every array element. map() calls a
function once for each element in an array. map() does not execute the function for
empty elements. map() does not change the original array.
515.Closure
In JavaScript, a closure is a function that references variables in the outer scope from
its inner scope. The closure preserves the outer scope inside its inner scope. To
understand the closures, you need to know how the lexical scoping works first.
516.Callstack
The call stack is used by JavaScript to keep track of multiple function calls. It is
like a real stack in data structures where data can be pushed and popped and
follows the Last In First Out (LIFO) principle. We use call stack for memorizing
which function is running right now.
Step 1:
Step 2
Step 3
Add repository layer project to implement Repository layer interfaces and
Business layer project to implement Business layer interfaces.
554. REPL
The Node. js Read-Eval-Print-Loop (REPL) is an interactive shell
that processes Node.js expressions. The shell reads JavaScript
code the user enters, evaluates the result of interpreting the line
of code, prints the result to the user, and loops until the user
signals to quit.
555. WRITE SERVER CODE
557.Promise.all()
does is that it stores a small part of the data set in a form that is easy to
traverse. The index stores the value of the specific field or set of fields,
indexes.
For example:>db.users.find({"username":
"user101"}).explain("executionStats")
Here, executionStats mode helps us understand the effect of using an index
to satisfy queries.
NoSQL stands for “not only SQL” rather than “no SQL” at all. This
means a NoSQL JSON database can store and retrieve data using
literally “no SQL.” Or you can combine the flexibility of JSON with the
your data.
our node app. Commonly used modules are:os, fs, __dirname etc.
You can find two types of API functions in Node. js, namely
functions.
descending order.
Why we use: bcoz it improve the user usability and some other benefits are:
Data structure is a storage that is used to store and organize data. It is a way of
arranging data on a computer so that it can be accessed and updated efficiently.
What is algorithms??
A programming algorithm is a procedure or formula used for solving a
problem. It is based on conducting a sequence of specified actions in
which these actions describe how to do something, and your computer
will do it exactly that way every time. An algorithm works by following a
procedure, made up of inputs.
What is redis??
‘Redis’, which stands for Remote Dictionary Server. According to Redis official,
Redis is an open-source (BSD licensed), in-memory data structure store, used as a
database, cache, and message broker. On the other hand, AWS says that
Redis is a fast, open-source, in-memory key-value data store for use as a database,
cache, message broker, and queue’.
What is output??
Programs require data to be input. This data is used (processed) by the program,
and data (or information ) is output as a result.
What is non-blocking??
Non-Blocking: It refers to the program that does not block the execution of further
operations. Non-Blocking methods are executed asynchronously. Asynchronously
means that the program may not necessarily execute line by line.
What are the bitwise operators??
SQL databases are used to store structured data while NoSQL databases like
MongoDB are used to save unstructured data. MongoDB is used to save
unstructured data in JSON format. MongoDB does not support advanced analytics
and joins like SQL databases support
SQL NoSQl
The only difference is , setTimeout() triggers the expression only once while
setInterval() keeps triggering expression regularly after the given interval of time.
(unless you tell it to stop). To stop further calls, we should call
clearInterval(timerId)
Why nodejs is asynchronous??
What is Scope?
Scope is the area of code where a variable (or function) exists and is accessible.
There are a few different types of scopes in JavaScript: Global Scope, Function Scope
Global Scope
have global scope meaning that they can be accessed anywhere in the JavaScript
program
Function Scope
A variable declared within a function is considered to be part of the function’s scope.
This scope is referred to as function scope. You will sometimes see function scope
Variables declared inside a function scope can be accessed from within the function
Block Scope
Block scope was introduced in ES2016 along with the let and const variable
declaration keywords. Block scope only applies to variables created with either the
Block scope is the scope defined within a set of curly brackets { }. The curly brackets
A block scoped variable cannot be accessed outside of the block that it was defined
in.
Lexical Scope
language). You will also see Lexical Scoping defined as Static Scoping. So what does
Lexical scoping means that the scope is defined at the location where the variable
map creates a new array by transforming every element in an array individually. filter
filter()
The filter method is called on an array and returns a new array and selects the
Function useFilter(arr){
Return arr.filter((element)=>{
})
useFilter([1,2,3,4,5])
Return [2,4]
In the example above the condition is element % 2 === 0. Therefore only even
numbers satisfy this condition which are 2 and 4 in the example above.
map()
The map method is used when we want to change each element inside of an array and
function doubler(arr) {
return arr.map((element) => {
return element * 2
})
The simple function above returns a new array in which all the elements are
doubled.
In computer science, a linked list is a linear collection of data elements whose order is
not given by their physical placement in memory. Instead, each element points to the
next. It is a data structure consisting of a collection of nodes which together represent
a sequence.
or
A linked list is a linear data structure consisting of a group of nodes where each node
points to the next node through a pointer. Each node is composed of data and a
reference (in other words, a link) to the next node in the sequence.
In computer science, a doubly linked list is a linked data structure that consists of a set
of sequentially linked records called nodes. Each node contains three fields: two link
fields (references to the previous and to the next node in the sequence of nodes) and
one data field.
or
A Doubly linked list is a linear data structure in which each node consists of three
fields viz., the data field, previous, and the next field. The previous and the next are the
address fields that store the address of the previous element and the next element
respectively.
Difference between circular and doubly linked list??
https://www.geeksforgeeks.org/difference-between-singly-linked-list-and-doubly-
linked-list/
What is git??
Git is a version-control system for tracking changes in computer files and coordinating
work on those files among multiple people. Git is a Distributed Version Control
System.
Git is a version control system used for tracking changes in computer files, making it a
top-rated utility for programmers world-wide. Git can handle projects of any size.
Git is used to coordinate the workflow among project team members and track their
progress over time. It also benefits both programmers and non-technical users by
keeping track of their project files. Git allows multiple users to work together without
disrupting each other’s work.
Importance:It is free, open-source software that lowers the cost because developers
can use Git without paying money. It provides support for non-linear development. Git
enables multiple developers or teams to work separately without having an impact on
the work of others.
Github??
GitHub helps every team member work together on a project from any location while
facilitating collaboration.
Git commands:-
1. git clone
This command is used for downloading the latest version of a remote project and
copying it to the selected location on the local machine.
git fetch
2.This Git command will get all the updates from the remote repository, including new
branches.
git init
3.This is the command you need to use if you want to start a new empty repository or
to reinitialize an existing one in the project root.
git pull
4.Using git pull will fetch all the changes from the remote repository and merge any
remote changes in the current local branch.
Quicksort
Quicksort is a popular sorting algorithm that is often faster in practice compared to
other sorting algorithms. It utilizes a divide-and-conquer strategy to quickly sort data
items by dividing a large array into two smaller arrays.
Mergesort
Merge sort is a sorting algorithm based on the Divide and conquer strategy. It works
by recursively dividing the array into two equal halves, then sort them and combine
them. It takes a time of (n logn) in the worst case
AWS enables you to select the operating system, programming language, web
application platform, database, and other services you need. With AWS, you receive a
virtual environment that lets you load the software and services your application
requires.
benefits:
It is a cost-effective service that allows you to pay only for what you use,
without any up-front or long-term commitments.
You will not require to spend money on running and maintaining data
centers.
Offers fast deployments
Git stash
Git stash saves the uncommitted changes locally, allowing you to make
changes, switch branches, and perform other Git operations. You can then
reapply the stashed changes when you need them. A stash is locally scoped
and is not pushed to the remote by git push
Ans:- SQ
● Use SQL (Structured Query Language) for defining and manipulating the data.
● A good fit for the complex query intensive environment
NoSQL
● Follow the Brewers CAP theorem (Consistency, Availability and Partition tolerance
● Examples include: MongoDB, BigTable, Redis, RavenDb, Cassandra, Hbase, Neo4j and
CouchDb.
Ans:- ECMAScript 2015 (or ES6) is the sixth and major edition of the ECMAScript language
specification standard. It defines the standard for the JavaScript implementation.
ES6 comes with significant changes to the JavaScript language. It brought several new features like,
let and const keyword, rest and spread operators, template literals, classes, modules and many
other enhancements to make JavaScript programming easier and more fun
What is NodeJs?
Ans:-
● Node.js is free
Ans:-
let var
let is block-scoped. var is function scoped.
let does not allow to redeclare variables. var allows to redeclare variables.
Ans:- Webpack is a free and open-source module bundler for JavaScript. It is made primarily for
JavaScript, but it can transform front-end assets such as HTML, CSS, and images if the
corresponding loaders are included. Webpack takes modules with dependencies and generates
static assets representing those modules.
661.what is DOM?
Ans:- The Document Object Model (DOM) is a programming interface for web documents. It
represents the page so that programs can change the document structure, style, and content. The
DOM represents the document as nodes and objects; that way, programming languages can interact
with the page.
Ans:- A callback function is a function passed into another function as an argument, which is then
invoked inside the outer function to complete some kind of routine or action.
663.what is hoisting?
Ans:- JavaScript Hoisting refers to the process whereby the interpreter appears to
move the declaration of functions, variables or classes to the top of their scope, prior
to execution of the code. Hoisting allows functions to be safely used in code before
they are declared.
Ans:- Data Structures are the programmatic way of storing data so that data can be
used efficiently. Almost every enterprise application uses various types of data
structures in one or the other way. This tutorial will give you a great understanding on
Data Structures needed to understand the complexity of enterprise level applications
and need of algorithms, and data structures.
● Pending
● Fulfilled
● Rejected
Ans:- This is a big issue caused by coding with complex nested callbacks. Here,
each and every callback takes an argument that is a result of the previous
callbacks. In this manner, The code structure looks like a pyramid, making it
difficult to read and maintain.
git config
Usage: git config –global user.name “[name]”
This command sets the author name and email address respectively to be used
with your commits.
git init
Usage: git init [repository name]
git clone
Usage: git clone [url]
git add
Usage: git add [file]
This command adds a file to the staging area.
git commit
Usage: git commit -m “[ Type in the commit message]”
This command records or snapshots the file permanently in the version history.
This command commits any files you’ve added with the git add command and
also commits any files you’ve changed since then.
git diff
Usage: git diff
This command shows the file differences which are not yet staged.
This command shows the differences between the files in the staging area and
the latest version present.
This command shows the differences between the two branches mentioned.
git reset
Usage: git reset [file]
This command unstages the file, but it preserves the file contents.
This command undoes all the commits after the specified commit and preserves
the changes locally.
Usage: git reset –hard [commit] This command discards all history and
goes back to the specified commit.
git status
Usage: git status
git rm
Usage: git rm [file]
This command deletes the file from your working directory and stages the
deletion.
git log
Usage: git log
This command is used to list the version history for the current branch.
This command lists version history for a file, including the renaming of files
also.
git show
Usage: git show [commit]
This command shows the metadata and content changes of the specified
commit.
git tag
Usage: git tag [commitID]
git branch
Usage: git branch
This command lists all the local branches in the current repository.
git checkout
Usage: git checkout [branch name]
git merge
Usage: git merge [branch name]
This command merges the specified branch’s history into the current branch.
git remote
Usage: git remote add [variable name] [Remote Server Link]
This command is used to connect your local repository to the remote server.
git push
Usage: git push [variable name] master
This command sends the committed changes of master branch to your remote
repository.
git pull
Usage: git pull [Repository Link]
This command fetches and merges changes on the remote server to your
working directory.
git stash
Usage: git stash save
Ans:- Function Scope: When a variable is declared inside a function, it is only accessible
within that function and cannot be used outside that function.
Block Scope: A variable when declared inside the if or switch conditions or inside for or
while loops, are accessible within that particular condition or loop.
alert(name);
return displayName;
myFunc();
677.event loop?
Ans:- JavaScript has a runtime model based on an event loop, which is responsible for
executing the code, collecting and processing events, and executing queued sub-tasks.
This model is quite different from models in other languages like C and Java.
Ans:-
685.setTimeout function?
Ans:- The setTimeout() method executes a block of code after the specified time. The
method executes the code only once. The commonly used syntax of JavaScript
setTimeout is: setTimeout(function, milliseconds);
687.Lexical scope?
Ans:- A lexical scope in JavaScript means that a variable defined outside a function
can be accessible inside another function defined after the variable declaration. But
the opposite is not true; the variables defined inside a function will not be accessible
outside that function.
Ans:- Node.js accepts the request from the clients and sends the response, while
working with the request node.js handles them with a single thread. To operate
I/O operations or requests node.js use the concept of threads. Thread is a
sequence of instructions that the server needs to perform. It runs parallel on the
server to provide the information to multiple clients. Node.js is an event loop
single-threaded language. It can handle concurrent requests with a single thread
without blocking it for one request.
● Non-blocking I/O
Ans:- The comparison is made by == and === operators in javascript. The main
difference between the == and === operator in javascript is that the == operator does
the type conversion of the operands before comparison, whereas the === operator
compares the values as well as the data types of the operands.
697.what is redis?
699.what is controller?
Ans:- In addition to the views and routes the diagram shows "controllers" — functions
that separate out the code to route requests from the code that actually processes
requests.
6. what is promises
=> A promise is an object that may produce a single value some time in the future : either a
resolved value, or a reason that it's not resolved (e.g., a network error occurred). Promises are used
to handle asynchronous operations in JavaScript. They are easy to manage when dealing with
multiple asynchronous operations where callbacks can create callback hell leading to unmanageable
code.
=> event loop is a loop that take some task and perform the operation and wait for another task.
Event loop which makes javascript single threaded. The event loop allows us to use callbacks and
promises.
The async and await keywords enable asynchronous, promise-based behavior. await only
blocks the code execution within the async function. It only makes sure that the next line is
executed when the promise resolves. So, if an asynchronous activity has already started, await will
not have any effect on it.
Async/Await makes it easier to write promises. The keyword 'async' before a function makes the
function return a promise, always. And the keyword await is used inside async functions, which
makes the program wait until the Promise resolves
=> We can avoid the callback hell with the help of Promises. Promises in javascript are a way to
handle asynchronous operations in Node. js. It allows us to return a value from an asynchronous
function like synchronous functions.
print(i);}
function print(i){
setTimeout(function(){
console.log(i)
},2000);
12 what is http protocol ? any other way to transferring data than http?
● It is a protocol used to access the data on the World Wide Web (www).
● The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
● This protocol is known as HyperText Transfer Protocol because of its efficiency
that allows us to use in a hypertext environment where there are rapid jumps
from one document to another document.
● HTTP is similar to the FTP as it also transfers the files from one host to another
host. But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no
control connection to transfer the files
14 what is hosting
JWT is jsonwebtoken and it is a way to transmitting secure information between third parties with
JSON object.
JWT can typically used to pass identity of authenticated users between an identity provider and
a service provider, or any other type of claims as required by business processes. JWT is
created with a secret key and that secret key is private to you which means you will never
reveal that to the public or inject inside the JWT token. When you receive a JWT from the
client, you can verify that JWT with this that secret key stored on the server.
16 what is AWS
=> Amazon web service is an online platform that provides scalable and cost-effective cloud
computing solutions. AWS is a broadly adopted cloud platform that offers several on-demand
operations like compute power, database storage, content delivery, etc., to help corporates scale
and grow.
AWS provides servers, storage, networking, remote computing, email, mobile development,
and security.
17 can we upload images in database without using AWS
=>No in database like mongodb we can’t upload images. That why we use AWS
18 benefits of AWS
ð Provides security
ð Easy to use
function findSecondLargestElem(arr){
{ second = arr[i];
} console.log(second);
findSecondLargestElem(arr);
19 middleware => A middleware is a function, that basically takes request
response and next objects as the parameters
If the middle ware gets successfully executed the next function is called
and the next operation starts getting executed that is scheduled to run.
why do you need them- Middleware is very helpful in code reusability and
to provide checks to the codes and authentication,authorisation.
20 what is controller?
● In addition to the views and routes the diagram shows "controllers" — functions that
separate out the code to route requests from the code that actually processes
requests. Controller functions to get the requested data from the models, create an HTML
page displaying the data, and return it to the user to view in the browser.
21 what is route ?
A route is a section of Express code that associates an HTTP verb (GET, POST, PUT,
DELETE, etc.), a URL path/pattern, and a function that is called to handle that pattern.
"Routes" to forward the supported requests (and any information encoded in request
URLs) to the appropriate controller functions.
=> A callback is a function which is called when a task is completed, thus helps
in preventing any kind of blocking and a callback function allows other code to run in
the meantime. Callback is called when task get completed and is asynchronous
equivalent for a function
dependencies are the package references that are used by your library without which it cannot
work and to be installed along with your library installation automatically.
"devDependencies" : Packages that are only needed for local development and testing.
=>
function getThirdSmallest( a) {
let temp;
temp = a[i];
a[i] = a[j];
a[j] = temp;
return a[2];
p tag is paragraph tag and span tag is in-line and usually used for a small chunk of
HTML inside a line
Span tag It can be used for style purposes and p tag used for writing paragraph
=>Block elements are a kind of blocks where there are many elements in a line itself.
While inline elements take up the space of an entire line and there will be only one line
within the space width.Inline elements do not respect the top and bottom margins but
only the left and right and also consider the padding. While block elements respect left,
right, top, bottom margins and padding. The width and height sets are not included in
inline elements. There are width and height elements in block elements
space-evenly : items are distributed so that the spacing between any two adjacent
alignment subjects, before the first alignment subject, and after the last alignment
subject is the same. Items will have equal space around them
space-between : items are evenly distributed in the line; first item is on the start line, last
item on the end line. Items will have space between them
The float CSS property places an element on the left or right side of its container, allowing text and
inline elements to wrap around it. The element is removed from the normal flow of the page, though
still remaining a part of the flow (in contrast to absolute positioning)
Ex: if we want a picture to left side and infront of it we want pargraph so we can use float :left
property to picture.
Syntax:
Img {
float:left
What is justify content flex-start: Default value. Items are positioned at the beginning of the
container
1. Call invokes the function and allows you to pass in arguments one by one.
2. Apply invokes the function and allows you to pass in arguments as an array. The apply() method
takes arguments as an array.
3. Bind returns a new function, allowing you to pass in a this array and any number of arguments. It
is called with a particular this value.
Objects represent a special data type that is mutable and can be used to store a collection of data
(rather than just a single value).
Arrays are a special type of variable that is also mutable and can also be used to store a list of
values.
this inside arrow functions is that they cannot be used as constructors. Using new
with an arrow function results in a TypeError.
They don’t have their own arguments
Regular function
Return a*a }
33 . What is Express,NodeJs.
Express is node js framework which provides set for web and mobile application developing.
express provides mechanisms to: Write handlers for requests with different HTTP verbs at
different URL paths (routes).
Nodejs is used on client as well as server side language and it is single threaded
Redis actually stands for Remote Dictionary Server. It is basically a data-structure store that
stores the data in the primary memory of a computer system. It uses key-value pairs to store
the data,
All the cache data will be stored in the memory of the server provided to the config of running
redis server. The clients do not hold any data, they only access the data stored by the redis server.
A cache's primary purpose is to increase data retrieval performance by reducing the need to
access
=> A middle ware is a function, that basically takes request response and
next objects as the parameters
If the middle ware gets successfully executed the next function is called
and the next operation starts getting executed that is scheduled to run.
why do you need them- Middleware is very helpful in code reusability and
to provide checks to the codes and authentication,authorisation.
=> Route level api are route based which code is written in the controller
file and it connect with route file. const router = express. Router() Load router-level
middleware by using the router.
37 What is meant by authentication. Try to give a real life example of the same? Show in your code
where authentication is being implemented.
=> it is process of verifying users identification through the credentials and using those credentials
to confirm the user identity. ex: when user login into fb with her credentials then this data saved
into cookies so user dose not need to enter credentials again and again . if credentials are valid then
user verified as valid user. then user logged into her fb account. In out project we implement the
authentication in middleware file.
38 What is meant by authorization. Give a real life example for authorization too. Again, show in your
code where authorization is being implemented.
=>The HTTP Authorization request header can be used to provide credentials that authenticate a
user agent with a server, allowing access to a protected resource. ex: when valid user logged into fb
then only that user allowed to change, edit, delete something in her account.
=> we are using middleware for particular user so when we are going to hit the API and we write the
auth code in middleware so we don't need to write code again and again and our code will be short n
nice. and it will not be time consuming .
- Where should the auth middleware be called? At application level or route level
=>route level
40 what is hoisting
console.log(test); // undefined
var test;
41 what is clouser
a closure gives you access to an outer function's scope from an inner function. In JavaScript,
closures are created every time a function is created, at function creation time. A closure is a
function having access to the parent scope, even after the parent function has closed.
Fastify is a NodeJS framework for building fast NodeJS servers. With this
wonderful tool, you can create a server with NodeJS, create routes
(endpoints), handle requests to each endpoint, and lots more. Fastify is an
alternative to Express (L express) which you must have heard of if you are
familiar with NodeJS before.
Quicksort is one of the efficient and most commonly used algorithms. Most
of the languages used quicksort in their inbuild “sort” method
implementations.
reverse string
how u will traverse large object and access key value pair and
print it?
'use strict';
// ECMAScript 2017
console.log(key, value);
}
aptitude and coding test
1. find anagrams
Find all pairs of numbers from the list that sum to a given no.
Find all the possible elements in one or two pairs from the given
array which is equal to the kth sum value.
find the substring present in the first string how many times
without repeating any element.
how many the number of rotations of left and right to complete
360 degrees.
https://drive.google.com/file/d/1SzQ45Mu4KUXmbJZkcT0fs98jehbbzatu/
view?usp=sharing
queue management
A JavaScript Promise object contains both the producing code and calls to
the consuming code: When the executing code obtains the result, it should
call one of the two callbacks: The Promise object supports two properties:
state and result. While a Promise object is "pending" (working), the result is
undefined.
Alternative-Async-await
· SSR is more suitable for the · CSR is more appropriate for web
website development as a cache of applications as this type of rendering
the newly opened tab takes care of ensures in fast speed of loading which is
load speed crucial for web apps
· SSR takes less time for the first · CSR has a slower initial load but it
load of the page has a privilege for the next loadings
compared to SSR
let &var&const
webpack
The webpack is a type of application that is used for compiling JavaScript modules.
Using this user can bundle up the different modules into one single module.
spread operator
JavaScript objects including arrays are deeply nested, the spread operator
only copies the first level with a new reference, but the deeper values are still
linked together.