Interview Questions

Q:

What is an error-first callback ?

Answer

Error-first callbacks are used to pass errors and data as well. You have to pass the error as the first parameter, and it has to be checked to see if something went wrong. Additional arguments are used to pass data.


 


fs.readFile(filePath, function(err, data) {
if (err) {
// handle the error, the return is important here
// so execution stops here
return console.log(err)
}
// use the data object
console.log(data)
})

Report Error

View answer Workspace Report Error Discuss

2 3345
Q:

What is the impact of declaring a method as final?

Answer A method declared as final can't be overridden. A sub-class can't have the same method signature with a different implementation.
Report Error

View answer Workspace Report Error Discuss

Subject: Java

1 3345
Q:

What are Spring beans ?

Answer

The Spring Beans are Java Objects that form the backbone of a Spring application. They are instantiated, assembled, and managed by the Spring IoC container. These beans are created with the configuration metadata that is supplied to the container.
Beans defined in spring framework are singleton beans. There is an attribute in bean tag named "singleton" if specified true then bean becomes singleton and if set to false then the bean becomes a prototype bean. By default it is set to true. So, all the beans in spring framework are by default singleton beans.

Report Error

View answer Workspace Report Error Discuss

Subject: Java
Job Role: Analyst , IT Trainer

4 3342
Q:

what is the difference between the terms 'credit' and 'debit' from the customer point of view?

Answer

 From the customer point of view, credit is the amount which is deposited into her or his account. And debit refers to that amount which is taken from the account of the customer.

Report Error

View answer Workspace Report Error Discuss

Subject: Accounts Payable

2 3341
Q:

What is a bad debt provision?

Answer

A bad debt provision is a reserve that you build up over time against the future recognition of specific accounts receivable as being uncollectible. Thus, if a company has issued invoices for a total of $1 million to its customers in a given month, and has a historical experience of 5% bad debts on its billings, it would be justified in creating a bad debt provision for $50,000 (which is 5% of $1 million).


It is impossible to know the exact amount of bad debts that will occur at some point in the future from the current account receivable, so it is entirely normal to continually readjust the bad debt provision, as you gain a greater understanding of how collectible the accounts receivable really are. These adjustments may lead to future increases or decreases in the bad debt expense. Since these adjustments can be viewed as a means of manipulating a company's reported profits, you should fully document your reasons for making the adjustments.


You would create a bad debt provision with a debit to the bad debt expense account, and a credit to the bad debt provision account. The bad debt provision account is an accounts receivable contra account, which means that it contains a balance that is the reverse of the normal debit balance found in the associated accounts receivable account. Later, when a specific invoice is found to be uncollectible, you create a credit memo in the accounting software for the amount of the invoice that is uncollectible. The credit memo reduces the bad debt provision account with a debit, and reduces the accounts receivable account with a credit. Thus, the initial creation of the bad debt provision creates an expense, while the later reduction of the bad debt provision against the accounts receivable balance is merely a reduction in offsetting accounts on the balance sheet, with no further impact on the income statement.


The reason for a bad debt provision is that, under the matching principle, you should match revenues with related expenses in the same accounting period. Doing so shows the full effect of a billed sale transaction in a single accounting period. If you were to not use a bad debt provision, and instead used the direct write off method to only charge bad debts to expense when you were certain that a specific invoice was not collectible, then the charge to expense might be many months later than the initial revenue recognition associated with the billing. Thus, under the direct write off method, profits will be too high in the period of the billing to the customer, and too low in the later period when you finally charge some portion or all of an invoice to the bad debt expense.

Report Error

View answer Workspace Report Error Discuss

0 3340
Q:

Financial statements are prepared in the following order.

A) Income statement - Balance sheet - Statement of retained earnings B) Income statement - Statement of retained earnings - Balance sheet
C) Balance sheet - Statement of retained earnings - Income statement D) Statement of retained earnings - Balance sheet - Income statement
 
Answer & Explanation Answer: B) Income statement - Statement of retained earnings - Balance sheet

Explanation:

The financial statements should be prepared in the following order:


Income statement - Statement of retained earnings - Balance sheet

 

1. Income statement reports revenues and expenses and calculates net income or net loss for the time period.

2. Statement of retained earnings show how retained earnings changed during the period due to net income or net loss and dividends.

3. Balance sheet reports assets, liabilities, and stockholders’ equity as of the last day of the period.

Report Error

View Answer Report Error Discuss

Filed Under: Accounts Payable
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 3338
Q:

So if md5( ) generates the most secure hash, why would you ever use the less secure crc32( ) and sha1( )?

Answer Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 3338
Q:

How can you find a PL/SQL block, if the cursor is open?

Answer

By use of %ISOPEN status variable.


 

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3336