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.

 

 

 

Top 20 Oracle BI Publisher Interview Questions and Answers

 

 

Ques. 1): What is the main difference between BI publisher and XML publisher?

Answer: BI publisher can be installed as a standalone version running off of several OC4J compliant engines, such as Application Server and Tomcat. BI publisher can be pointed anywhere, so that reports can be run out of an OLTP or warehouse database, MSSQL and even within EBS. Licensing is already included in EBS, and the standalone costs whatever plus maintenance. XML Pub operates entirely within EBS and can only be used within EBS.


Oracle Fusion Applications interview Questions and Answers


Ques. 2): What is a data template in BI publisher?

Answer: Data template is an xml structure which have the queries to be run for a database so that output can be generated in xml format, this generated xml output is further applied on a layout template for the final required output.


Oracle Accounts Payables Interview Questions and Answers


Ques. 3): What is the default output format of the report in BI publisher?

Answer: The default output format defined during the layout template creation will be used to generate the output, the same can be modified during the request submission and it will overwrite the one defined at layout template.


Oracle ADF Interview Questions and Answers                                 


Ques. 4): What are the various sections in the data template?

Ans: The various sections in the data template in BI publisher are as:

  • Parameter section
  • Lexical Section
  • Trigger Section
  • SQL statement section
  • Data Structure section

Oracle Access Manager Interview Questions and Answers


Ques. 5): In BIP, how do you display the company logo in the report output?

Ans: In BIP, you can just copy and paste the logo (.gif, .jpg or any format) on the header section of .rtf file. Resize the log per the company standards.


Oracle Fusion HCM Interview Questions and Answers


Ques. 6): What is a layout template in BI publisher?

Answer: Layout template defines how the user views the output, basically it can be developed using Microsoft word document in rft (rich text format) or Adobe pdf format. The data output in xml format (from Data template) will be loaded in layout template at run time and the required final output file is generated.


Oracle SCM Interview Questions and Answers


Ques. 7): How do we create subtotals and Grand Total in BI Publisher?

Answer: If I have a report in OBIEE Answers with three columns –

Brand, Type and Revenue.

An OBIEE Report can be created as follows:

  • Create the BI Publisher Report
  • Login into bi publisher through word and open the BIP report
  • Insert the table wizard and Add the columns Brand, Type and Revenue
  • In the Group by – select Brand
  • click the radio button of Group left
  • click on finish.

Oracle Financials Interview questions and Answers


Ques. 8): In how many ways you can display images in a BI Publisher Report?

Answer:
 The images can be displayed in below 5 ways:

  •     Direct Insertion into RTF Template
  •     URL Reference
  •     OA_MEDIA directory reference
  •     Image from BLOB datatype from database
  •     Using UI Beans

Oracle Cloud Interview Questions and Answers


Ques. 9): How to submit a layout in the backend?

Answer: 
we must write a procedure for this using the below code

FND_REQUEST.ADD_LAYOUT (

 TEMPLATE_APPL_NAME     => 'application name',

TEMPLATE_CODE           => 'your template code',

TEMPLATE_LANGUAGE       => 'En',

TEMPLATE_TERRITORY      => 'US',

OUTPUT_FORMAT           => 'PDF'

);

Oracle PL/SQL Interview Questions and Answers


Ques. 10): What are the various XML publisher tables?

Answer:

  • PER_GB_XDO_TEMPLATES
  • XDO_DS_DEFINITIONS_B
  • XDO_DS_DEFINITIONS_TL
  • XDO_DS_DEFINITIONS_VL
  • XDO_LOBS
  • XDO_TEMPLATES_B
  • XDO_TEMPLATES_TL
  • XDO_TEMPLATES_VL
  • XDO_TEMPLATE_FIELDS
  • XDO_TRANS_UNITS
  • XDO_TRANS_UNIT_PROPS
  • XDO_TRANS_UNIT_VALUES

Oracle SQL Interview Questions and Answers


Ques. 11): How to get SYSDATE in the header section dynamically when we run the report?

Answer: You cannot insert form fields in the Header section, but you can just insert the code to achieve this. For example: insert this in the header section to view the sysdate: You could format the date as you would like.

<?xdofx: sysdate(‘YYYY-MM-DD’)?>

Oracle RDMS Interview Questions and Answers


Ques. 12): How do you create a BI Publisher report with two sub reports?

Answer: If I have a report in OBIEE Answers with these columns –

  • Year, Brand, Revenue
  • Region, District, Revenue

An OBIEE Report can be created as follows:

  • Create the BI Publisher Report
  • Login into bi publisher through word and open the BIP report
  • Insert the table wizard
  • Add the columns Year, Brand and Revenue
  • In the Group by select Year and Brand
  • click the radio button of Group left
  • click on finish.
  • delete the ones indicated in circles
  • create a table with 2 rows and 3 columns
  • Give the column headings in the first row
  • copy paste the following indicated by the arrow mark
  • apply the necessary formating and delete the first table
  • give the necessary aggregation as shown below
  • create the other sub report similarly
  • publish the template
  • view it in bi publisher
  • Thus, we can create sub reports in BI Publisher


Oracle 10g Interview Questions and Answers

 

Ques. 13): How to calculate the running total in XMLP?

Answer:

  • <?xdoxslt:set_variable($_XDOCTX, ‘RTotVar’, xdoxslt:get_variable($_XDOCTX, ‘RTotVar’) + ACCTD_AMT(This is column name) )?>
  • <?xdoxslt:get_variable($_XDOCTX, ‘RTotVar’)?>

 

Ques. 14): How to use Variables in XML publisher?

Answer: In XML publisher the declaration of variables can be done as:

Declaring the Variable R and Assigning the Values 4 to R


<?xdoxslt:set_variable($_XDOCTX, ‘R’, 4)?>

Get the Variable value
<?xdoxslt:get_variable($_XDOCTX, ‘R’)?>

This adds 5 to variable R and displays it
<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)+5)?>

This subtracting 2 to varaible R and displays it

<?xdoxslt:set_variable($_XDOCTX, ‘R’, xdoxslt:get_variable($_XDOCTX, ‘R’)-2)?>

 

 

 

August 09, 2020

Top 20 C language Interview Questions & Answers

 

Ques: 01. Why is C language being considered a middle level language?

Ans: This is because C language is rich in features that make it behave like a high level language while at the same time can interact with hardware using low level methods. The use of a well structured approach to programming, coupled with English-like words used in functions, makes it act as a high level language. On the other hand, C can directly access memory structures similar to assembly language routines.


Ques: 02. What are preprocessor directives?

Ans: Preprocessor directives are placed at the beginning of every C program. This is where library files are specified, Explain Which would depend on Explain What functions are to be used in the program. Another use of preprocessor directives is the declaration of constants.Preprocessor directives begin with the # symbol.


Ques: 03. Where does global, static, and local, register variables, free memory and C Program instructions get stored?

Ans: Global: Wherever the linker puts them. Typically the ―BSS segment on many platforms.Static: Again, wherever the linker puts them. Often, they‘re intermixed with the globals. The only difference between globals and statics is whether the linker will resolve the symbols across compilation units.Local: Typically on the stack, unless the variable gets register allocated and never spills.Register: Nowadays, these are equivalent to ―Local variables. They live on the stack unless they get register-allocated.


Ques: 04. What are header files and Explain What are its uses in C programming?

Ans: Header files are also known as library files. They contain two essential things: the definitions and prototypes of functions being used in a program. Simply put, commands that you use in C programming are actually functions that are defined from within each header files. Each header file contains a set of functions. For example: stdio.h is a header file that contains definition and prototypes of commands like printf and scanf.


Ques: 05. What does the format %10.2 mean when included in a printf statement?

Ans: This format is used for two things: to set the number of spaces allotted for the output number and to set the number of decimal places. The number before the decimal point is for the allotted space, in this case it would allot 10 spaces for the output number. If the number of space occupied by the output number is less than 10, addition space characters will be inserted before the actual output number. The number after the decimal point sets the number of decimal places, in this case, it?s 2 decimal spaces.


Ques: 06. Describe about storage allocation and scope of global, extern, static, local and register variables?

Ans:Globals have application-scope. They‘re available in any compilation unit that includes an appropriate declaration (usually brought from a header file). They‘re stored wherever the link erputs them, usually a place called the ―BSS segment. Extern? This is essentially ―global. 

Static: Stored the same place as globals, typically, but only available to the compilation unit that contains them. If they are block-scope global, only available within that block and its subblocks.

Local: Stored on the stack, typically. Only available in that block and its subblocks.(Although pointers to locals can be passed to functions invoked from within a scope where that local is valid.)

Register: See tirade above on ―local vs. ―register. The only difference is that the C compiler will not let you take the address of something you‘ve declared as ―register.
 

Ques: 07. Describe the order of precedence with regards to operators in C.

Ans: Order of precedence determines Explain Which operation must first take place in an operation statement or conditional statement. On the top most level of precedence are the unary operators !, +, – and &amp;. It is followed by the regular mathematical operators (*, / and modulus % first, followed by + and -). Next in line are the relational operators &lt;, &lt;=, &gt;= and &gt;. This is then followed by the two equality operators == and !=. The logical operators &amp;&amp; and || are next evaluated. On the last level is the assignment operator =.


Ques: 08. What is output redirection?

Ans: It is the process of transferring data to an alternative output source other than the display screen. Output redirection allows a program to have its output saved to a file. For example, if you have a program named COMPUTE, typing this on the command line as COMPUTE &gt;DATA can accept input from the user, perform certain computations, then have the output redirected to a file named DATA, instead of s Explain Howing it on the screen.


Ques: 09. What is a far pointer? Where we use it?

Ans: In large data model (compact, large, huge) the address B0008000 is acceptable because in these model all pointers to data are 32bits long. If we use small data model(tiny, small, medium) the above address won‘t work since in these model each pointer is 16bits long. If we are working ina small data model and want to access the address B0008000 then we use far pointer. Far pointer is always treated as a 32bit pointer and contains a segment address and offset address both of16bits each. Thus the address is represented using segment : offset format B000h:8000h. For any given memory address there are many possible far address segment : offset pair. The segment register contains the address where the segment begins and offset register contains the offset of data/code from where segment begins.


Ques: 10. Explain What is the difference between the expression “++a” and “a++”?

Ans: In the first expression, the increment would happen first on variable a, and the resulting value will be the one to be used. This is also known as a prefix increment. In the second expression, the current value of variable a would the one to be used in an operation, before the value of a itself is incremented. This is also known as postfix increment.


Ques: 11. What is the difference between functions getch() and getche()?

Ans: Both functions will accept a character input value from the user. When using getch(), the key that was pressed will not appear on the screen, and is automatically captured and assigned to a variable. When using getche(), the key that was pressed by the user will appear on the screen, while at the same time being assigned to a variable.


Ques: 12. What are macros? What are its advantages and disadvantages?

Ans: Macros are abbreviations for lengthy and frequently used statements. When a macro is called the entire code is substituted by a single line though the macro definition is of several lines.The advantage of macro is that it reduces the time taken for control transfer as in case of function. The disadvantage of it is here the entire code is substituted so the program becomes lengthy if a macro is called several times.


Ques: 13. What is an endless loop?

Ans: An endless loop can mean two things. One is that it was designed to loop continuously until the condition within the loop is met, after Explain Which a break function would cause the program to step out of the loop. Another idea of an endless loop is when an incorrect loop condition was written, causing the loop to run erroneously forever. Endless loops are oftentimes referred to as infinite loops.


Ques: 14. Why is it that not all header files are declared in every C program?

Ans: The choice of declaring a header file at the top of each C program would depend on Explain What commands/functions you will be using in that program. Since each header file contains different function definitions and prototype, you would be using only those header files that would contain the functions you will need. Declaring all header files in every program would only increase the overall file size and load of the program, and is not considered a good programming style.


Ques: 15. Difference between pass by reference and pass by value?

Ans: Pass by reference passes a pointer to the value. This allows the callee to modify the variable directly.Pass by value gives a copy of the value to the callee. This allows the callee to modify the value without modifying the variable. (In other words, the callee simply cannot modify the variable, since it lacks a reference to it.)


Ques: 16. What is dynamic data structure?

Ans: Dynamic data structure provides a means for storing data more efficiently into memory. Using dynamic memory allocation, your program will access memory spaces as needed. This is in contrast to static data structure, wherein the programmer has to indicate a fix number of memory space to be used in the program.


Ques: 17. What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

Ans: The most probable reason behind this error is that the header file for that function was not indicated at the top of the program. Header files contain the definition and prototype for functions and commands used in a C program. In the case of ?tolower()?, the code ?#include ? must be present at the beginning of the program.


Ques: 18. What will be the outcome of the following conditional statement if the value of variable s is 10?

Ans: s &gt;=10 &amp;&amp; s &lt; 25 &amp;&amp; s!=12 The outcome will be TRUE. Since the value of s is 10, s &gt;= 10 evaluates to TRUE because s is not greater than 10 but is still equal to 10. s&lt; 25 is also TRUE since 10 is less then 25. Just the same, s!=12, Explain Which means s is not equal to 12, evaluates to TRUE. The &amp;&amp; is the AND operator, and follows the rule that if all individual conditions are TRUE, the entire statement is TRUE.


Ques: 19. What is FIFO?

Ans: In C programming, there is a data structure known as queue. In this structure, data is stored and accessed using FIFO format, or First-In-First-Out. A queue represents a line wherein the first data that was stored will be the first one that is accessible as well.


Ques: 20. What are enumerated types?

Ans: Enumerated types allow the programmer to use more meaningful words as values to a variable. Each item in the enumerated type variable is actually associated with a numeric code. For example, one can create an enumerated type variable named DAYS whose values are Monday, Tuesday… Sunday.