IT Trainer Questions


Q:

How can you avoid callback hells ?

Answer

There are lots of ways to solve the issue of callback hells:


1. Modularization: break callbacks into independent functions
2. Use a control flow library, like async
3. Use generators with Promises
4. Use async/await (note that it is only available in the latest v7 release and not in the LTS version)

Report Error

View answer Workspace Report Error Discuss

Subject: Java
Job Role: Analyst , IT Trainer

3 2484
Q:

When should you stop at green and go at red?

Answer

While eating a watermelon, we all go along the red and stops at green.

Report Error

View answer Workspace Report Error Discuss

5 2480
Q:

Difference between Arraylist and Linked list?

Answer

ArrayList and LinkedList both implements List interface and maintains insertion order. Both are non synchronized classes.


 


But there are many differences between ArrayList and LinkedList classes that are given below.


 

ArrayList    V/s     LinkedList ::


 

1) ArrayList internally uses dynamic array to store the elements.


                   Whereas


LinkedList internally uses doubly linked list to store the elements.


 

2) Manipulation with ArrayList is slow because it internally uses array. If any element is removed from the array, all the bits are shifted in memory.


                   Whereas


Manipulation with LinkedList is faster than ArrayList because it uses doubly linked list so no bit shifting is required in memory.


 

3) ArrayList class can act as a list only because it implements List only.


                   Whereas


LinkedList class can act as a list and queue both because it implements List and Deque interfaces.


 

4) ArrayList is better for storing and accessing data.


                   Whereas


LinkedList is better for manipulating data.

Report Error

View answer Workspace Report Error Discuss

3 2480
Q:

Which of the following data structure is linear type?

A) Tree B) Binary Tree
C) Queue D) Graph
 
Answer & Explanation Answer: C) Queue

Explanation:

A data structure is a specialized format for organizing and storing data. General data structure types include the array, the file, the record, the table, the tree, and so on. Any data structure is designed to organize data to suit a specific purpose so that it can be accessed and worked with in appropriate ways.

 

Linear data structure: A linear data structure traverses the data elements sequentially, in which only one data element can directly be reached.

Ex: Arrays, Linked Lists, Stack, Queue, Any type of List all are linear.

 

Trees like Binary Tree, B Tree or B+ Tree are examples of non linear data structure.

Report Error

View Answer Report Error Discuss

5 2475
Q:

How fast do satellites orbit the earth?

A) 28,000 kmph B) 26,000 kmph
C) 17,500 kmph D) 22,500 kmph
 
Answer & Explanation Answer: A) 28,000 kmph

Explanation:

Satellites orbit the earth at a speed of 28,000 kmph.

Satellites that are further away actually travel slower. The International Space Station has a Low Earth Orbit, about 400 kilometers (250 miles) above the earth's surface. Objects orbiting at that altitude travel about 28,000 kilometers per hour (17,500 miles per hour).

Report Error

View Answer Report Error Discuss

5 2474
Q:

6 divided by 2(1 + 2) =

A) 1 B) 0
C) 9 D) Can't be determined
 
Answer & Explanation Answer: C) 9

Explanation:

The given expression can be simplified as

÷ 2 (1 + 2)

The expression can be simplified further by the order of operations, using BODMAS rule.

 

First evaluate Parentheses/Brackets, then evaluate Exponents/Orders, then evaluate Multiplication-Division, and finally evaluate Addition-Subtraction.

 

Now, the expression becomes ÷ 2 (3)

 

According to the order of operations, division and multiplication have the same precedence, so the correct order is to evaluate from left to right. First take 6 and divide it by 2, and then multiply by 3.

6 ÷ 2 × 3

= 3 × 3

= 9

But not  6÷2×3 = 6 ÷ 6 = 1

Screenshot_(21)1528090844.jpg image 

 

Hence, 6 ÷ 2 (1 + 2) = 9.

Report Error

View Answer Report Error Discuss

3 2463
Q:

Carbon in the ocean originates from the atmosphere.

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

True, the carbon in the ocean originates from the atmosphere. The oceanic surface water absorbs the carbon dioxide gas from the atmosphere and dissolves in it.

Report Error

View Answer Workspace Report Error Discuss

0 2462
Q:

How long is an IPv6 address?

A) 128 bytes B) 32 bits
C) 128 bits D) 32 bytes
 
Answer & Explanation Answer: C) 128 bits

Explanation:

IPv6 - Internet Protocol Version 6.

IPv6 addresses have a size of 128 bits.

Internet Protocol Version 6 [IPv6] is the successor to the Internet's first addressing infrastructure, Internet Protocol version 4 (IPv4).

In contrast to IPv4, which defined an IP address as a 32-bit value, IPv6 address have a size of 128 bits. 

Report Error

View Answer Report Error Discuss

6 2462