Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

February 10, 2021

Top 20 JavaScript Interview Questions and Answers

 

Ques. 1): What is JavaScript?

Answer: 

JavaScript is different from Java language. It is a scripting language. It is object-based, lightweight, cross-platform translated language. It is widely used for client-side validation. The JavaScript Translator, which is embedded in the browser, is responsible for translating the JavaScript code for the web browser.

AngularJS Interview Questions and Answers

Ques. 2): What are the differences between Java and JavaScript?

Answer: 

JavaScript is a coded program that can be introduced to HTML pages. In contrast, Java is a complete programming language. These two languages are not at all inter-dependent and are designed for the different intent. Java is an object - oriented programming (OOPS) or structured programming language like C++ or C whereas JavaScript is a client-side scripting language.

AJAX interview Questions and Answers

Ques. 3): What are the main advantages of JavaScript?

Answer: 

The main advantages of using JavaScript are as follows:

  • Less server interaction − You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server.
  • Immediate feedback to the visitors − They don’t have to wait for a page reload to see if they have forgotten to enter something.
  • Increased interactivity − You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard.
  • Richer interfaces − You can use JavaScript to include such items as drag-and-drop components and sliders to give a Rich Interface to your site visitors.

Node.js Interview Questions and Answers

Ques. 4): Which is faster, JavaScript or an ASP script?

Answer: 

JavaScript is a client-side language and thus it does not need the assistance of the web server to execute. On the other hand, ASP is a server-side language and hence is always slower than JavaScript. Javascript now is also a server-side language (nodejs). So the JavaScript is faster.

JQuery Interview Questions and Answers

Ques. 5): What is the use of history object?

Answer: 

The history object of a browser can be used to switch to history pages such as back and forward from the current page or another page. There are three methods of history object.

1.         history.back() - It loads the previous page.

2.         history.forward() - It loads the next page.

3.         history.go(number) - The number may be positive for forward, negative for backward. It loads the given page number.

Advance Java interview Questions and Answers

Ques. 6): What are global variables? How are these variables declared and what are the problems associated with using them?

Answer: 

Global variables are those that are available throughout the length of the code, that is, these have no scope. The var keyword is used to declare a local variable or object. If the var keyword is omitted, a global variable is declared.

Example:

// Declare a global globalVariable = "GLO_VAR";

The problems that are faced by using global variables are the clash of variable names of local and global scope. Also, it is difficult to debug and test the code that relies on global variables.

 

Ques. 7): What is the difference between ViewState and SessionState?

Answer: 

'ViewState' is specific to a page in a session.

'SessionState' is specific to user specific data that can be accessed across all pages in the web application.

 

Ques. 8): How can you convert the string of any base to integer in JavaScript?

Answer: 

The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter, and the second parameter is the base of the given string.

In order to convert 5F (of base 16) to integer, the code used will be -

parseInt ("5F", 16);

 

Ques. 9): What are undefined and undeclared variables?

Answer: 

Undefined variables are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.

Undeclared variables are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.

 

Ques. 10): What is this [[[]]]?

Answer: 

This is a three-dimensional array.

var myArray = [[[]]]; 

 

Ques. 11): Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?

Answer: 

Timers are used to execute a piece of code at a set time or also to repeat the code in a given interval of time. This is done by using the functions setTimeout, setInterval and clearInterval.

The setTimeout(function, delay) function is used to start a timer that calls a particular function after the mentioned delay. The setInterval(function, delay) function is used to repeatedly execute the given function in the mentioned delay and only halts when cancelled. The clearInterval(id) function instructs the timer to stop.

Timers are operated within a single thread, and thus events might queue up, waiting to be executed.

 

Ques. 12): What is the use of Void(0)?

Answer: 

Void(0) is used to prevent the page from refreshing and parameter "zero" is passed while calling.

Void(0) is used to call another method without refreshing the page.

 

Ques. 13): What is the main disadvantage of using innerHTML in JavaScript?

Answer: 

The main disadvantages of using innerHTML in JavaScript are:

  • Content is replaced everywhere
  • We cannot use like "appending to innerHTML"
  • Even if you use +=like "innerHTML = innerHTML + 'html'" still the old content is replaced by html
  • The entire innerHTML content is re-parsed and build into elements, therefore its much slower
  • The innerHTML does not provide validation and therefore we can potentially insert valid and broken HTML in the document and break it

 

Ques. 14): What are the different types of errors in JavaScript?

Answer: 

There are three types of errors in JavaScript:

  • Load time errors: Errors which come up when loading a web page like improper syntax errors are known as Load time errors and it generates the errors dynamically.
  • Run time errors: Errors that come due to misuse of the command inside the HTML language.
  • Logical Errors: These are the errors that occur due to the bad logic performed on a function which is having different operation.

  

Ques. 15): What is the requirement of debugging in JavaScript?

Answer: 

JavaScript didn't show any error message in a browser. However, these mistakes can affect the output. The best practice to find out the error is to debug the code. The code can be debugged easily by using web browsers like Google Chrome, Mozilla Firebox.

To perform debugging, we can use any of the following approaches:

•     Using console.log() method

•     Using debugger keyword

 

Ques. 16): What is the 'Strict' mode in JavaScript and how can it be enabled?

Answer: 

Strict Mode adds certain compulsions to JavaScript. Under the strict mode, JavaScript shows errors for a piece of codes, which did not show an error before, but might be problematic and potentially unsafe. Strict mode also solves some mistakes that hamper the JavaScript engines to work efficiently.

Strict mode can be enabled by adding the string literal "use strict" above the file. This can be illustrated by the given example:

function myfunction() {

    "use strict";

    var v = "This is a strict mode function";

}

 

Ques. 17): What is the purpose of ‘This’ operator in JavaScript?

Answer: 

The JavaScript this keyword refers to the object it belongs to. This has different values depending on where it is used. In a method, this refers to the owner object and, in a function, this refers to the global object.

 

Ques. 18): What is Callback in JavaScript?

Answer: 

A callback is a plain JavaScript function passed to some method as an argument or option. It is a function that is to be executed after another function has finished executing, hence the name ‘call back‘.

In JavaScript, functions are objects. Because of this, functions can take functions as arguments, and can be returned by other functions.

 

Ques. 19): What are JavaScript Cookies?

Answer: 

Cookies are the small test files stored in a computer and it gets created when the user visits the websites to store information that they need. Example could be User Name details and shopping cart information from the previous visits.

 

Ques. 20): Explain what is pop()method in JavaScript?

Answer: 

The pop() method is similar as the shift() method but the difference is that the Shift method works at the start of the array. Also the pop() method take the last element off of the given array and returns it. The array on which is called is then altered.

Example:

var cloths = ["Shirt", "Pant", "TShirt"];

cloths.pop();

//Now cloth becomes Shirt,Pant

 

Ques. 21): Define event bubbling?

Answer: 

JavaScript allows DOM elements to be nested inside each other. In such a case, if the handler of the child is clicked, the handler of parent will also work as if it were clicked too.

 

Ques. 22): How are event handlers utilized in JavaScript?

Answer: 

Events are the actions that result from activities, such as clicking a link or filling a form, by the user. An event handler is required to manage proper execution of all these events. Event handlers are an extra attribute of the object. This attribute includes event's name and the action taken if the event takes place.

 

Ques: 23): Explain the role of deferred scripts in JavaScript?

Answer: 

By default, the parsing of the HTML code, during page loading, is paused until the script has not stopped executing. It means, if the server is slow or the script is particularly heavy, then the webpage is displayed with a delay. While using Deferred, scripts delays execution of the script till the time HTML parser is running. This reduces the loading time of web pages and they get displayed faster.

 

 

 

December 27, 2019

Top 20 SQL Server Interview Questions and Answers



Ques: 1. What is SQL server agent?

Ans: 

The SQL Server agent plays a vital role in day to day tasks of SQL server administrator (DBA). Server agent's purpose is to implement the tasks easily with the scheduler engine which allows our jobs to run at scheduled date and time.


Oracle Fusion Applications interview Questions and Answers


Ques: 2. What is a Trigger?

Ans: 

Triggers are used to execute a batch of SQL code when insert or update or delete commands are executed against a table. Triggers are automatically triggered or executed when the data is modified. It can be executed automatically on insert, delete and update operations.


Oracle Accounts Payables Interview Questions and Answers

 

Ques: 3. What is the use of SET NOCOUNT ON/OFF statement?

Ans: 

By default, NOCOUNT is set to OFF and it returns number of records got affected whenever the command is getting executed. If the user doesn't want to display the number of records affected, it can be explicitly set to ON- (SET NOCOUNT ON).


Oracle ADF Interview Questions and Answers

 

Ques: 4. What is SQL injection?

Ans: 

SQL injection is an attack by malicious users in which malicious code can be inserted into strings that can be passed to an instance of SQL server for parsing and execution. All statements have to checked for vulnerabilities as it executes all syntactically valid queries that it receives.


Oracle Access Manager Interview Questions and Answers

 

Ques: 5. What will be the maximum number of index per table?

Ans: For SQL Server 2008 100 Index can be used as maximum number per table. 1 Clustered Index and 999 Non-clustered indexes per table can be used in SQL Server.

1000 Index can be used as maximum number per table. 

1 Clustered Index and 999 Non-clustered indexes per table can be used in SQL Server.


Oracle Fusion HCM Interview Questions and Answers


Ques: 6. What is Filtered Index?

Ans: 

Filtered Index is used to filter some portion of rows in a table to improve query performance, index maintenance and reduces index storage costs. When the index is created with WHERE clause, then it is called Filtered Index

 

Oracle SCM Interview Questions and Answers


Ques: 7. List the different index configurations possible for a table?

Ans: 

A table can have one of the following index configurations:

  • No indexes 
  • A clustered index 
  • A clustered index and many non-clustered indexes 
  • A non-clustered index 
  • Many non-clustered indexes


Oracle Financials Interview questions and Answers


Ques: 8. What is sub query and its properties?

Ans: 

A sub-query is a query which can be nested inside a main query like Select, Update, Insert or Delete statements. This can be used when expression is allowed. Properties of sub query can be defined as

  • A sub query should not have order by clause.
  • A sub query should be placed in the right hand side of the comparison operator of the main query. 
  • A sub query should be enclosed in parenthesis because it needs to be executed first before the main query. 
  • More than one sub query can be included.


Oracle Cloud Interview Questions and Answers


Ques: 9. What is Mirroring?

Ans: 

Mirroring is a high availability solution. It is designed to maintain a hot standby server which is consistent with the primary server in terms of a transaction. Transaction Log records are sent directly from the principal server to a secondary server which keeps a secondary server up to date with the principal server.

 

Oracle PL/SQL Interview Questions and Answers


Ques: 10. What is an execution plan?

Ans: 

An execution plan is a graphical or textual way of showing how the SQL server breaks down a query to get the required result. It helps a user to determine why queries are taking more time to execute and based on the investigation user can update their queries for the maximum result.

In Query Analyzer is an option called “Show Execution Plan” (located on the Query drop-down menu). If this option is turned on it will display a query execution plan in a separate window when a query is run again.

 

Oracle SQL Interview Questions and Answers


Ques: 11. What is a performance monitor?

Ans: 

Windows performance monitor is a tool to capture metrics for the entire server. We can use this tool for capturing events of the SQL server also.

Some useful counters are – Disks, Memory, Processors, Network, etc.

 

Oracle RDMS Interview Questions and Answers


Ques: 12. What is the difference between a Local and a Global temporary table?

Ans: 

If defined inside a compound statement a local temporary table exists only for the duration of that statement but a global temporary table exists permanently in the database but its rows disappear when the connection is closed.

 

BI Publisher Interview Questions and Answers


Ques: 13. What is the SQL Profiler?

Ans: 

SQL Profiler provides a graphical representation of events in an instance of SQL Server for monitoring and investment purpose. We can capture and save the data for further analysis. We can put filters as well to captures the specific data we want.

 

Oracle 10g Interview Questions and Answers


Ques: 14. What are the properties of the Relational tables?

Ans: 

Relational tables have six properties:

  1. Values are atomic. 
  2. Column values are of the same kind. 
  3. Each row is unique. 
  4. The sequence of columns is insignificant. 
  5. The sequence of rows is insignificant. 
  6. Each column must have a unique name.


BlockChain interview Questions and Answers


Ques: 15. What is View?

Ans: 

A view is a virtual table that contains data from one or more tables. Views restrict data access of the table by selecting only required values and make complex queries easy.

Rows updated or deleted in the view are updated or deleted in the table the view was created with. It should also be noted that as data in the original table changes, so does data in the view, as views are the way to look at part of the original table. The results of using a view are not permanently stored in the database

 

MySQL Interview Questions and Answers


Ques: 16. Why is replication required on the SQL Server?

Ans: 

Replication is the mechanism that is used to synchronize the data among the multiple servers with the help of a replica set.

This is mainly used to increase the capacity of the reading and to provide an option to its users to select among various servers to perform the read/write operations.

 

Azure Interview Questions and Answers


Ques: 17. What part does database design have to play in the performance of a SQL Server-based application?

Ans. 

It plays a very major part. When building a new system, or adding to an existing system, it is crucial that the design is correct. Ensuring that the correct data is captured and is placed in the appropriate tables, that the right relationships exist between the tables and that data redundancy is eliminated is an ultimate goal when considering performance. Planning a design should be an iterative process, and constantly reviewed as an application is developed. It is rare, although it should be the point that everyone tries to achieve, when the initial design and system goals are not altered, no matter how slightly. Therefore, a designer has to be on top of this and ensure that the design of the database remains efficient.

 

Ques: 18. What command is used to create a database in the SQL Server and how?

Ans: 

CREATEDATABASE Command is used to create any database in the SQL Server. Following is the way to use this command:

CREATEDATABASE Name of the Database

Example: If the name of a database is “employee” then create command to create this database that can be written as CREATEDATABASE employee.

 

Ques: 19. What is an extended stored procedure? Can you instantiate a COM object 

by using T-SQL?

Ans: 

An extended stored procedure is a function within a DLL (written in a programming language like C, C++ using Open Data Services (ODS) API) that can be called from T-SQL, just the way we call normal stored procedures using the EXEC statement.

Yes, you can instantiate a COM (written in languages like VB, VC++) object from T-SQL by using sp_OACreate stored procedure. 

 

Ques: 20. When should SQL Server-based cursors be used, and not be used?

Ans: 

SQL Server cursors are perfect when you want to work one record at a time, rather than taking all the data from a table as a single bulk. However, they should be used with care as they can affect performance, especially when the volume of data increases. 

From a beginner’s viewpoint, I really do feel that cursors should be avoided every time because if they are badly written, or deal with too much data, they really will impact a system’s performance. There will be times when it is not possible to avoid cursors, and I doubt if many systems exist without them. If you do find you need to use them, try to reduce the number of records to process by using a temporary table first, and then building the cursor from this. The lower the number of records to process, the faster the cursor will finish. Always try to think “out of the envelope”.

 


More Interview Questions and Answers:

 

C language Interview Questions and Answers

 

C++ language Interview Questions and Answers

 

Machine Learning Interview Questions and Answers

  

PowerShell Interview Questions and Answers

 

Python Interview Questions and Answers

 

Python Pandas Interview Questions and Answers

 

SQL Server Interview Questions and Answers

 

Unix interview Questions and Answers

 

C# Language Interview Questions and Answers

 

CSS (Cascading Style Sheets ) Interview Questions and Answers

 

Robotic Process Automation(RPA) Interview Questions and Answers

 

UX Design Interview Questions and Answers

 

Docker Interview Questions and Answers

 

Google Cloud Computing Interview Questions and Answers

 

Linux Interview Questions and Answers

 

Data Science Interview Questions and Answers

 

Edge Computing Interview Questions and Answers

 

Hadoop Technical Interview Questions and Answers

 

Hyperion Technical Interview Questions and Answers

 

Internet of Things (IOT) Interview Questions and Answers

 

C# Language Interview Questions and Answers