Online Tutorials & Training Materials | STechies.com
Register Login

Scala Interview Questions

Scala FAQ's

1. What is meant by Scala Set?

A: Scala Set is a collection of paired elements of the same type. There are mutable sets and immutable sets and they do not have duplicate elements.

2. What is meant by Scala Map?

A: Scala Maps are collections of Key and Value pairs. Keys are unique, while values are not, and keyes are used to retrieve their corresponding values.

3. How are values and variables different in Scala?

A: Values and Variables both hold values in Scala. However, a Value is immutable and once assigned it cannot be changed, while a Variable is mutable and its value can be changed in the program.

4. What is meant by Recursion Tail in Scala?

A: Recursion refers to a function that calls itself in the program. When the callback to self is the last performed function, then it is referred to as Recursion Tail.

5. What is meant by Scala Trait?

A: Traits in Scala define object types which are specified by the signature of methods that are supported. Traits contain method and field definition and can be reused by mixing these into classes.

6. What are Case Classes in Scala?

A: Case Classes are like regular classes except that they can export their constructor parameters. These parameters can be directly accessed as public values.

7. What is meant by Tupules in Scala?

A: Tupules group a fixed number of items together to be treated as a single entity. Tupules differ from arrays or lists in that they can contain items of different types and are immutable.

8. What is the role of the currying in Scala?

A: Currying is the process of transforming a function taking multiple arguments to a function taking single argument.

9. What is meant by Monad in Scala?

A: Class objects are wrapped with a Monad in Scala, giving them two attributes: Identity by ‘unit’ and Binding by ‘flatMap’.

10. What is meant by Closure in Scala?

A: Closure is a function whose return value depends on variables declared outside that function.

11. What is meant by Scala Future?

A: Scala Future is an object having potential values or future values. It starts a background task and stored values are made available after the task is complete. It also provides different callback functions within itself, making it a complete concurrent class and differing from the Future class of Java which has no inbuilt callback function.

12. What is the role of Option in Scala?

A: Option is used to represent the presence or absence of values and may be used to wrap missing values and as replacements to returning null values.

13. What is meant by Statically Typed Language?

A: Statically Typed Language is where the Type Checking for errors is done during compilation rather that during runtime. This prevents too many bugs from developing at runtime, keeping the development process easy.

14. Which is the superclass for all other classes in Scala?

A: The ‘Any’ class, defined as ‘scala.Any’ is the superclass of all other classes and traits in Scala.

15. Which is the default Access Modifier of Scala?

A: The default Access modifier for Scala is public for all class, method, object and trait.

16. What is meant by Type Inference in Scala?

A: Type Inference refers to the determination of the type of object, expression, or variable by the compiler during compilation of program.

17. What is meant by Unit in Scala?

A: Unit is a final class defined as scala.Unit representing return of No Value or No Useful Value.

18. What is meant by REPL in Scala?

A: REPL, pronounced as ‘ripple’ stands for Read Evaluate Print Loop and is an interpreter that executes Scala code from the command prompt.

19. What is meant by anonymous function in Scala?

A: Anonymous functions, also called function literals are functions that get instantiated into objects during runtime. These objects are called function values.

20. What is meant by higher order function in Scala?

A: Functions with other functions as parameters and whose results are also functions are called higher order functions.

21. What types of identifiers are used in Scala?

A: Four types of Identifiers used in Scala are Alpha-numeric, Operator, Literal, and Mixed Identifiers.

22. What is meant by an Implicit Parameter in Scala?

A: Implicit Parameters defined using the keyword implicit allows functions to run without passing all the parameters.

23. What is the role of yield keyword in Scala?

A: The yield keyword when used with an expression, the value from that expression is returned as collection.

24. What are the roles of the Apply and Unapply methods?

A: The Apply method is used to join separate components to create an object. The Unapply method does the opposite and breaks the object apart into its constituents.

25. How are Array and List different in Scala?

A: Lists have a recursive covariant mutable data structure, and Arrays have a sequential invariant immutable data structure. In simpler terms, List size can change based on the operations performed on it, while Arrays have a fixed size.

1031 results
  • Smartforms Interview Questions and Answers
    SAP ABAP Smartforms Interview FAQ n nQ) Define Smart form? n nForm Printing in the Internet Age n nSmart Forms was initially presented in SAP Basis Release 4.6C primarily as a tool for the creation...
  • Posted in: Interview Questions » ABAP » | By: rekha | Date: 29 Jun 2018 1:19 pm | Comments (6)
  • OOPS INTERVIEW QUESTIONS and ANSWERS
    1.  Priniples of oops?2.  What is difference between procedural & OO Programming?3.  What is class?4.  What is object?5.  Can we instantiate a class within implementation...
  • Posted in: Interview Questions » ABAP » | By: vishal singh | Date: 18 May 2018 11:23 am | Comments (1)
  • BAPI Interview Questions and Answers
    General BAPI Interview Questions n n1) Define BAPI? n nBAPI is a standardized programming interface (method) which enable external applications to gain access to business processes and data in...
  • Posted in: SAP Blogs » » | By: rekha | Date: 08 Jan 2019 6:43 am | Comments (1)
  • Reorganizations Interview Question and Answers
    nFAQ: Reorganizations 1. What is reorganization?The term reorganization refers to the reconstruction of objects in the database. A distinction is made between offline and online...
  • Posted in: Interview Questions » Oracle » | By: rekha | Date: 19 May 2018 4:27 am | Comments (0)
  • ALV Layout Interview Questions
    [1] Question: What do the terms "display variant" and "layout" mean? n nAnswer: Both the term "display variant" and the term "layout" refer to the same thing...
  • Posted in: Interview Questions » ABAP » | By: rekha | Date: 18 May 2018 12:00 pm | Comments (0)
  • JMon Interview Questions and Answers
    FAQ: JMon1.Q: The JVM cores on Windows 2000 with the following error in the file hs_err_pidxxxx.log: An unexpected exception has been detected in native code outside the VM. Unexpected Signal:...
  • Posted in: Interview Questions » Java » | By: rekha | Date: 20 May 2018 1:51 am | Comments (1)
  • SAP EHS Interview Questions
    Hello SAP Experts, n nI Need SAP EHS interview questions and answers that are asked usually in any interivew. Please try to share them with me as soon as possible so that I can read and follow them...
  • Posted in: Forum » EHS ( Environment, Health, and Safety Management ) » | By: | Date: 18 May 2018 11:53 pm | Comments (1)
  • Order Management Interview Questions
    Hello Experts, n nI have recently faced an interview of a Company and the interviewer asked me these question which i have mentioned below: n nFirst question : If a xyz sales person(may be he meant...
  • Posted in: Forum » SD (Sales and Distribution) » | By: Rohit Mahajan | Date: 04 Dec 2018 7:21 am | Comments (4)
  • Authorizations Interview Question and Answers
    FAQ: General Questions About Authorizations[1] Question: Can wildcards be used in authorizations?[2] Question: What does the PFCG_TIME_DEPENDENCY clean up?[3] Question: What happens to change...
  • Posted in: Interview Questions » BASIS » | By: rekha | Date: 18 May 2018 12:09 pm | Comments (0)
  • MODULARIZATION Interview Questions and Answers
    MODULARIZATION FAQs1.Does every ABAP/4 have a modular structure?Yes.2.What is Modularization and its benefits?If the program contains the same or similar blocks of statements or it is required to...
  • Posted in: Interview Questions » ABAP » | By: Merityunjay Kumar Shukla | Date: 19 May 2018 11:07 am | Comments (1)
  • SDBI_CLUSTER_CHECK Interview Questions and Answers
    Q-1.Will I be able to run the SDBI_CLUSTER_CHECK without option "Find duplicates"? What is the impact?Ans) It is indeed possible to run the report without causing any impacts. The option...
  • Posted in: Interview Questions » NetWeaver » | By: vaibhav gupta | Date: 18 May 2018 3:51 pm | Comments (0)
  • Informatica Interview Questions and Answer
    Informatica FAQ's n n1. What is Enterprise Data Warehousing? n nA: Enterprise Data Warehousing is the creation of organization data at a single access point. Data with global view can be given to...
  • Posted in: SAP Blogs » » | By: Nitesh Singh | Date: 30 May 2018 11:08 am | Comments (0)
  • Hive Interview Questions and Answers
    What is Hive? n nHive is a tool to perform ETL (extract, transform and load) and Data warehousing functions. It was developed as a sub-project of Hadoop Distributed File System (HDFS). Hive makes...
  • Posted in: Articles » » | By: vaibhav gupta | Date: 14 Feb 2019 6:43 am | Comments (0)
  • TestNG Interview Questions & Answers
    What is TestNG? n nTestNG is a tool to perform tasks like reporting, assertions, parallel test execution etc. integrating the framework with selenium or other automation tools. The NG in TestNG...
  • Posted in: Articles » » | By: Jyoti Pandey | Date: 15 Jan 2019 10:06 am | Comments (0)
  • SSRS Interview Questions and Answers
    What is SSRS? n nSQL Server Reporting Service is a server-based software system. It generates reports that Microsoft develops. You can prepare and deliver various printed reports that are...
  • Posted in: Articles » » | By: Shalesh Singh | Date: 11 Feb 2019 8:34 am | Comments (0)
  • VMware Interview Questions and Answers
    What is VMware? n nVMware is a software that enables you to do virtualization and cloud computing in your host computer. You can run a virtual computer from your own computer. The basis of...
  • Posted in: Articles » » | By: vaibhav gupta | Date: 24 Dec 2018 7:03 am | Comments (0)
  • Data Modelling Interview Questions
    What is data modelling? n nThe process of documenting the design of a complex software system through diagrams, text, and symbols that represent the data flow is known as data modelling. This...
  • Posted in: Articles » » | By: Romil Tripathi | Date: 15 Feb 2019 1:45 pm | Comments (0)
  • Microservices Interview Questions and Answers
    What are Microservices? n nMicroservices or Microservice Architecture is a style of architecture that organizes an application in the form of a collection of minor autonomous services that are...
  • Posted in: Articles » » | By: Sushma | Date: 08 Jan 2019 6:31 am | Comments (0)
  • SoapUI Interview Questions and Answers
    What is SoapUI? n nSoapUI is a tool that is used for functional and non-functional testing of SOAP Web Services as well as RESTful or HTTP based services Web Services. It is an Open Source, free...
  • Posted in: Articles » » | By: Sonia Barwar | Date: 24 Jan 2019 12:45 pm | Comments (0)
  • Unix Interview Questions and Answers
    What is UNIX? What does UNIX stand for? n nUNIX is easy to use, multi-user, multi-tasking and stable operating system for servers that have a graphical user interface (GUI) like Microsoft Windows. It...
  • Posted in: Articles » » | By: Romil Tripathi | Date: 18 Jan 2019 12:58 pm | Comments (0)
VIEW MORE