IT Trainer 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 3174
Q:

When do you override hashcode and equals() ?

Answer

HashCode method return int value. So the Hash value is the int value returned by the hash function .


If you want to do equality check or want to use your object as key in HashMap, we must override hashcode and equals() method.

Report Error

View answer Workspace Report Error Discuss

Subject: Java
Job Role: Analyst , IT Trainer

5 3173
Q:

I am a 5 letter word.

I am normally below you. If you remove my 1st letter, you'll find me above you. If you remove my 1st & 2nd letters, you can't see me.

What am I?

Answer

Firstly, I focussed on "If you remove my 1st & 2nd letters, you can't see me". The first thing that comes to mind which we can’t see is the "AIR".


 


So now, what 4 letter words can be formed ending with "AIR"? Think of all the words from A to Z, considering which one lies above you. That is how we get to "HAIR".


 


Now, which 5 letter word can be formed ending with "HAIR"? Starting with A to Z, we reach "CHAIR" and also, it lies below us.


 


And the required answer is "CHAIR".

Report Error

View answer Workspace Report Error Discuss

4 3171
Q:

A restrictive clause is one that

A) usually occurs at the beginning of a sentence B) should be set off by commas
C) limits the meaning of the word it describes D) functions as an adverb
 
Answer & Explanation Answer: C) limits the meaning of the word it describes

Explanation:

A restrictive clause is one that limits the meaning of the word it describes.

For example :: 

The girl who lives next door is beautiful.

This restrictive clause limits "the girl" to say it's specifically the one next door.

Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: AIEEE , Bank Exams , CAT , GATE , GRE , TOEFL
Job Role: Analyst , Bank Clerk , Bank PO , Database Administration , IT Trainer

1 3167
Q:

Select a suitable figure from the four alternatives that would complete the figure matrix.

4_281484716123.png image

A) 3 B) 1
C) 2 D) 4
 
Answer & Explanation Answer: C) 2

Explanation:

The third figure in each row comprises of parts which are not common to the first two figures.

Report Error

View Answer Report Error Discuss

Filed Under: Figure Matrix
Exam Prep: AIEEE , Bank Exams , CAT , GATE , GRE
Job Role: Bank Clerk , Bank PO , IT Trainer

15 3156
Q:

A bike runs at the speed of 35 km/h when not serviced and runs at 55 km/h, when serviced. After servicing the bike covers a certain distance in 5 h. How much approximate time will the bike take to cover the same distance when not serviced?

A) 8 hrs B) 7.5 hrs
C) 7 hrs D) 6.5 hrs
 
Answer & Explanation Answer: A) 8 hrs

Explanation:

Given speed of the bike after servicing = 55 kmph

Time taken for travelling some distance at 55 kmph = 5 hrs

Then, 

Distance = Speed x Time = 55 x 5 = 275 kms.

Now, 

Speed of the bike before servicing = 35 kmph

Distance = 275 kms

Now, Time = Distance/Speed = 275/35 = 7.85 hrs =~ 8 hrs.

Report Error

View Answer Report Error Discuss

Filed Under: Time and Distance
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO , IT Trainer

9 3154
Q:

_U_R_Y_

Complete this 7 letter word _U_R_Y_

1. Girls like it
2. Boys use it
3. Parents hate it.

Answer

HURRAYS.

Report Error

View answer Workspace Report Error Discuss

22 3148
Q:

What is immutable object? Can you write immutable object ?

Answer

Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example is String is immutable in Java. Mostly Immutable are also final in Java, in order to prevent sub class from overriding methods in Java which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor.

Report Error

View answer Workspace Report Error Discuss

3 3148