Thursday 13 February 2014

Groovy/Grails Sample Questions and Answers Set II

Groovy/Grails Questions & Answers - 3.2 SET II:
-----------------------------------------------
1. What is the in-built database server which is used by grails apps?
A. H2 DB Server (ANSWER)
B. MySQL DB Server
C. PostgreSQL DB Server
D. Mongo DB Server (No SQL Database)
---------------------------------------------------------------------------------------------
2. In the given Open Source Framework, Which one is Apache's Web Framework?
A. Hibernate
B. Spring MVC
C. Struts (ANSWER)
D. Grails
---------------------------------------------------------------------------------------------
3. In the given Open Source Framework, Which one is not belongs to Web Framework?
A. Grails
B. Hibernate (ANSWER)
C. Struts
D. Rails
---------------------------------------------------------------------------------------------
4. In the given Web Framework, Which option is not the correct compination?
A. JRuby/Rails
B. Groovy/Grails
C. Scala/Play
D. JRuby/Grails (ANSWER)
---------------------------------------------------------------------------------------------
5. Convention over configuration (also known as coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility. Which option is followed this concept?
A. Ruby on Rails
B. Groovy on Grails
C. All of the above (ANSWER)
D. None of the above
---------------------------------------------------------------------------------------------
6. In the given option, Which option is not belongs to MVC Framework?
A. Struts -2.3.12
B. JavaServer Faces - 2.1
C. Play -2.1.1
D. Google Web Toolkit(GWT) -2.5.1 (ANSWER)
---------------------------------------------------------------------------------------------
7. In the given option, Which option is not belongs to JavaScript Framework?
A. Ext JS-4.2
B. Google Web Toolkit-2.4 (ANSWER)
C. jQuery UI-1.9
D. DOJO-1.8
---------------------------------------------------------------------------------------------
8. Which file contains configuration properties and information needed when running your application?.
It contains properties used by your services, controllers, etc.
A. Config.groovy (ANSWER)
B. BootStrap.groovy
C. BuildConfig.groovy
D. DataSource.groovy
---------------------------------------------------------------------------------------------
9. Which file contains information relevant to building and deploying your application, such as repositories, jar file dependencies and war file name.?
A. Config.groovy
B. BuildConfig.groovy (ANSWER)
C. UrlMappings.groovy
D. DataSource.groovy
---------------------------------------------------------------------------------------------
10. Which file that allows you to define code that is ran every time your grails application starts up.?
A. BuildConfig.groovy
B. Config.groovy
C. UrlMappings.groovy
D. BootStrap.groovy (ANSWER)
---------------------------------------------------------------------------------------------
11. Explain about Grails shell:
A. Swing-based command console similar to the Groovy console. It will execute code against a full environment that has access to all your domain classes and quickly test out code that would go into controllers and services.

B. Interactive mode of the grails command line interface. It lets you run Gant scripts in the script runner one after another.

C. Headless version of Grails console.This is useful when you want to access and test out code in a remote SSH-based server.  It does not reload when domain classes change like the console does, so it is useful also for long-running scripts, although the new run-script command in Grails  (ANSWER)

D.  None of the above
---------------------------------------------------------------------------------------------
12. Which environments are available by default in Grails?
A. Development(dev), Test(test), Staging(stage) & Production(prod)
B. Production (prod), Staging (stage) & Development(dev)
C. Staging(prod), Test(test) & Development (dev)
D. Production(prod), Test(test) & Development(dev) (ANSWER)
---------------------------------------------------------------------------------------------
13. What is the difference between run-app and run-war?
A. run-war will compile and builds a war file that it runs from the embedded container ( Tomcat unless you’ve changed it ).
   run-app runs the application from compiled sources in the file system.
   This means that any change to controllers, views, etc will be reflected immediately by run-app, but not by run-war (ANSWER)
B. There are no difference between run-app and run-war.
C. run-app will compile and builds a war file that it runs from the embedded container ( Tomcat unless you’ve changed it ).
   run-war runs the application from compiled sources in the file system.
   This means that any change to controllers, views, etc will be reflected immediately by run-war, but not by run-app (ANSWER)
D. None of the above.
---------------------------------------------------------------------------------------------
14. "select distinct s.name from Student s" - This query of the domain objects belongs to
A. Dynamic finder
B. HSQL is a query language that looks like SQL but is fully object-oriented. (ANSWER)
C. Criterias are a DSL based on Hibernate Criterias and Groovy builders
D. None of the above.
---------------------------------------------------------------------------------------------
15. Student.findByName('Siddharth') added to domain classes - This query of the domain objects belongs to
A. Criterias are a DSL based on Hibernate Criterias and Groovy builders
B. Dynamic finder. (ANSWER)
C. HSQL is a query language that looks like SQL but is fully object-oriented.
D. All of the above.
---------------------------------------------------------------------------------------------
16. Gorm provides two auto-timestamping variables, what are they?
A. createdDateTime and updatedDateTime
B. createdDate & updatedDate
C. createdDateTS and updatedDateTS
D. dateCreated & lastUpdated (ANSWER)
---------------------------------------------------------------------------------------------
17. I have a property such as 'password' in my domain class that I don’t want to be persisted, how do I make sure it doesn’t generate a field in my database?
A. static transient = ['password'] (ANSWER)
B. static encrypt = ['password']
C. static String = ['password']
D. static volatile = ['password']
---------------------------------------------------------------------------------------------
18. In the given option, Which one is not belongs to programming language?
A. Java
B. Groovy
C. Scala
D. Javascript
---------------------------------------------------------------------------------------------

No comments:

Post a Comment