InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Define Closure in Scala with example? |
|
Answer» Define Closure in SCALA with example? |
|
| 2. |
Difference between Java, Scala, Python and R |
|
Answer» Difference between Java, Scala, Python and R |
|
| 3. |
Can you please define the uses of Concurrency and Actor Model? |
|
Answer» Can you please define the USES of Concurrency and Actor Model? |
|
| 4. |
In Java and Scala which one is pure OOP language? |
|
Answer» In Java and Scala which one is pure OOP language? |
|
| 5. |
Yield keyword in Scala? |
|
Answer» YIELD keyword in Scala? We use Yield keyword as a Loop in scala. Yield keyword will returns a result once the loop iteration is complete. Here for loop used buffer internally stored iterated result and when iterations is finisihed it yields the result from that buffer. And this will not work like imperative loop. Because type of collection which is returned is of same type that we tend to were iterating over, Therefore a Map yields a Map, a List yields a List, and so on. And syntax for Yield keyword is given below VAR result = for{ var x yield x In above code we have used curly braces that keep the VARIABLE conditions and result is variable where all the VALUES of x are kept within the form of collection. Below are some silent features of Yield:- (1)It is used as a Loop. (2)It produced value for each iteration. (3)It supports the use of Map, FlatMap, and Filters along with nomads. |
|
| 6. |
Define Streams in Scala with and example? |
|
Answer» DEFINE Streams in SCALA with and example? To define Streams in scala we use Lazy list to define streams in scala. Its a lazy list which is evaluates the ELEMENTS when we need that. And this types of lazy computation enhances the PERFORMANCE of the program. Below is the example of Streams in Scala. scala> val stream=12#::14#::16#::Stream.empty stream: scala.collection.immutable.Stream[int] = Stream(12, ?) as in above code we DONOT need second element so we have not evaluate the second element |
|
| 7. |
Different types of variables in Scala explain them? |
|
Answer» Different types of variables in Scala explain them? |
|
| 8. |
Syntax to Append single and multiple data element in list in Scala? |
|
Answer» SYNTAX to Append single and multiple DATA element in list in SCALA? We can append single and multiple data element in list in scala. Below is the syntax to ADD single value to the list. And we should use ":+" to append data in list ![]() And if we want to multiple values to the list we use "++" to append data in the list.
|
|
| 9. |
what is use of Tuples in Scala? |
|
Answer» what is use of Tuples in Scala? |
|