InterviewPitch
Land the job you want — prepare
with Real interviews Q&A
Curated interview questions, company-wise guides and coding rounds. Practice mock interviews, improve with feedback, and track your progress.
Q&A
Top curated interview packs
Company-wise & role-wise packs, quality assured.
Mock interview
AI scoring
Coding rounds
Top 10 sets
Beginner
1. What is Groovy?
Groovy is a dynamic, object-oriented programming language that runs on the JVM and integrates seamlessly with Java.
Beginner
2. Is Groovy compatible with Java?
Yes, Groovy is fully compatible with Java and can use Java libraries and frameworks directly.
Beginner
3. What are the features of Groovy?
Dynamic typing, closures, list & map literals, simplified syntax, and seamless Java integration.
Beginner
4. What is dynamic typing in Groovy?
Variables can be declared without specifying type using
def.Beginner
5. What is def keyword?
Used to declare dynamically typed variables.
Beginner
6. What is a closure in Groovy?
A closure is a block of code that can be passed as a parameter.
Beginner
7. What is GroovyShell?
A className used to evaluate Groovy scripts dynamically.
Beginner
8. What is GString?
Groovy’s string interpolation feature using $.
Beginner
9. Difference between String and GString?
String is immutable Java string. GString supports interpolation.
Beginner
10. How to create a list in Groovy?
def list = [1,2,3]Beginner
11. How to create a map?
def map = [name:"John", age:25]Beginner
12. What is each() method?
Used to iterate over collections.
Beginner
13. What is it in closure?
Default parameter name inside a closure.
Beginner
14. How to define a function?
def add(a,b)Beginner
15. What is optional semicolon?
Groovy does not require semicolons at line endings.
Intermediate
16. What is @Grab annotation?
Used to automatically download dependencies.
Intermediate
17. What is Expando?
Allows adding properties and methods at runtime.
Intermediate
18. What is method overloading?
Multiple methods with same name but different parameters.
Intermediate
19. What is safe navigation operator?
?. prevents NullPointerException.Intermediate
20. What is Elvis operator?
?: provides default value if null.Intermediate
21. What is spread operator?
*. invokes method on all items in collection.Intermediate
22. What is metaclassName?
Used to modify className behavior at runtime.
Intermediate
23. What is AST transformation?
Modifies code at compile time.
Intermediate
24. What is trait in Groovy?
Reusable set of methods that can be added to classNamees.
Intermediate
25. What is builder pattern in Groovy?
Used to create structured data like XML/JSON easily.
Intermediate
26. What is JSONSlurper?
Parses JSON text into Groovy objects.
Intermediate
27. What is XmlSlurper?
Parses XML documents.
Intermediate
28. What is range operator?
1..5 creates range from 1 to 5.Intermediate
29. What is collect()?
Transforms elements in a collection.
Intermediate
30. What is findAll()?
Returns elements matching condition.
Advanced
36. What is static compilation?
Using @CompileStatic for better performance and type safety.
Advanced
37. What is GroovyclassNameLoader?
Loads Groovy classNamees dynamically.
Advanced
38. What is methodMissing()?
Handles calls to undefined methods dynamically.
Advanced
39. What is propertyMissing()?
Handles access to undefined properties.
Advanced
40. What is DSL in Groovy?
Domain Specific Language built using Groovy syntax flexibility.
Coding Round
46. Print Hello World
println "Hello World"Coding Round
47. Iterate list
list.each Coding Round
48. Filter list
list.findAll Coding Round
49. Map transformation
list.collectCoding Round
50. Read file
new File("test.txt").eachLine