Class 8

What is “callback hell” and how can it be avoided?

“Callback hell” is coding with complex nested callbacks. JavaScript provides an easy way of escaping from a callback hell. This is done by event queue and promises.

What are “stubs” in Node.js?

Stubs are functions or programs that affect the behavior of components or modules. Stubs are dummy objects for testing. Stubs implement a pre-programmed response.

What are “streams” in Node.JS?

Streams are one of the fundamental concepts that power Node. js applications. They are data-handling method and are used to read or write input into output sequentially. Streams are a way to handle reading/writing files, network communications, or any kind of end-to-end information exchange in an efficient way.

What does “chaining” mean in Node.JS?

Function chaining is a pattern in JavaScript where multiple functions are called on the same object consecutively. Using the same object reference, multiple functions can be invoked. It increases the readability of the code and means less redundancy.

Explain “console” in Node.JS.

Node. js console is a global object and is used to print different levels of messages to stdout and stderr. There are built-in methods to be used for printing informational, warning, and error messages.

Explain exit codes in Node.JS. List out some exit codes.

Exit codes are the specific codes that can be used to end a process. Some of the examples of exit codes are, Uncaught Fatal Exception, Fatal Error, Non-function Internal Exception Handler, Internal Exception handler Run-Time Failure, and Internal JavaScript Evaluation Failure.

What is the difference between cluster and non-cluster Index?

A Clustered index is a type of index in which table records are physically reordered to match the index. A Non-Clustered index is a special type of index in which logical order of index does not match physical stored order of the rows on disk.

What are user defined functions? What are all types of user defined functions?

Like functions in programming languages, SQL Server user-defined functions are routines that accept parameters, perform an action, such as a complex calculation, and return the result of that action as a value. The return value can either be a single scalar value or a result set.

Scalar Function
User-defined scalar functions return a single data value of the type defined in the returns clause. For an inline scalar function, the returned scalar value is the result of a single statement. For a multi-statement scalar function, the function body can contain a series of Transact-SQL statements that return the single value. The return type can be any data type except text, ntext, image, cursor, and timestamp.

Table-Valued Functions
User-defined table-valued functions return a table data type. For an inline table-valued function, there is no function body; the table is the result set of a single select statement.

System Functions
SQL Server provides many system functions that you can use to perform a variety of operations. They cannot be modified.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store