Language fundamentals (Q1-Q8)
1. What is Gosu and where does it run?
Gosu is Guidewire's statically typed, object-oriented language, compiled to JVM bytecode. It powers business rules, enhancements, PCF expressions, plugins, and batch logic across the InsuranceSuite, and interoperates bidirectionally with Java.
2. Gosu vs Java, name five concrete differences.
(1) Properties replace getter/setter boilerplate; (2) enhancements add members to existing types without inheritance; (3) blocks give lightweight closures; (4) null-safe operators (?., ?:); (5) native entity/typelist awareness, Claim and typekey.LossCause are first-class types. Also: type inference with var, and uses instead of import.
3. Write a property in Gosu.
class RiskScore {
var _score : int as Score // shorthand: field + property
property get IsHigh() : boolean { // derived, read-only property
return _score > 75
}
}The as keyword exposes a field as a property; explicit property get/set defines computed accessors.
4. What is an enhancement? Write one, and state its two big limitations.
enhancement PolicyPeriodEnhancement : PolicyPeriod {
property get ActiveVehicleCount() : int {
return this.PersonalAutoLine.Vehicles.countWhere(\ v -> v.Active)
}
}Limitations: enhancements are resolved statically at compile time (no polymorphic dispatch, so you cannot override existing methods), and they cannot hold state (no instance fields).
5. What are blocks? Show three collection operations using them.
var open = claims.where(\ c -> c.State == ClaimState.TC_OPEN) var totals = claims.map(\ c -> c.TotalIncurredAmount) var byAdj = claims.partition(\ c -> c.AssignedUser.DisplayName)
Blocks are closures: \ params -> expression. Also expect sortBy, firstWhere, countWhere, hasMatch.
6. Explain Gosu's null-safety features with an example.
// returns null instead of NPE if any link is null var acct = claim?.Policy?.Account?.AccountNumber ?: "UNKNOWN"
?. short-circuits to null on a null receiver; ?: supplies a default. Interviewers often follow with: "what does Java require for the same?" The answer: nested null checks or Optional chains.
7. What are feature literals?
Compile-time references to members using #: Claim#State, Claim#Policy. Used in Query criteria and property paths so refactoring breaks the build instead of production, unlike string-based reflection.
8. How do typelists appear in Gosu code?
if (claim.LossCause == LossCause.TC_REAREND) { ... }
var allCauses = LossCause.getTypeKeys(false) // all non-retired codesTC_ constants are typecodes; typekey types are checked at compile time, so a typo in a code is a build error, not a runtime bug.
Bundles, queries & the entity model (Q9-Q15)
9. What is a bundle and why does Guidewire use it?
The unit of database transaction: all entity changes in a bundle commit atomically or roll back together. It guarantees consistency across the entity graph (claim + exposures + transactions changed together) and is also the trigger scope for rules and messaging; events fire relative to the committing bundle.
10. Write code that modifies an entity in a new bundle.
uses gw.transaction.Transaction
Transaction.runWithNewBundle(\ bundle -> {
var c = bundle.add(claim) // attach entity to THIS bundle
c.Description = "Escalated by batch"
}, "su") // run as userThe classic follow-up: forgetting bundle.add() and modifying an entity loaded in another bundle throws, because entities are bundle-bound.
11. When would you explicitly create a bundle vs use the current one?
Web/UI code runs in an implicit request bundle, so use it. Explicit bundles are for batch processes, message transports, startable services (no ambient bundle exists), or when you need commit isolation, e.g., logging an audit row that must persist even if the main transaction fails.
12. Write a query with a join and explain lazy evaluation.
uses gw.api.database.Query
var q = Query.make(Claim)
q.compare(Claim#State, Equals, ClaimState.TC_OPEN)
q.join(Claim#Policy).compare(Policy#PolicyNumber, Equals, "PA-123456")
var results = q.select() // no DB hit yet
for (c in results) { ... } // rows streamed as iteratedselect() returns a lazy result set; the query executes on iteration and streams rows. Calling .toList() or .Count forces execution; loading huge tables into memory this way is the classic performance bug.
13. Query API vs entity graph navigation, when to use which?
Query API: searching across the database (find all open claims for a policy); it hits the DB, returns read-only rows unless added to a bundle. Graph navigation (claim.Exposures): working within the current transaction's loaded graph, editable, rule-visible. Anti-pattern to call out: issuing queries inside a loop over graph objects (N+1).
14. How do you add a new field to an entity and use it in Gosu?
Create/extend the .etx file with a new <column> (or typekey/foreignkey), regenerate the dev schema, and the field is immediately available as a typed property: claim.RiskScore_Ext. The _Ext suffix convention marks customer extensions, mentioning it signals real codebase familiarity.
15. What is the difference between new Claim() and creating via a bundle?
Entities must be created in a bundle context: new Claim(bundle) registers the instance for insertion on commit. In UI code the current bundle is implicit; in background code you pass it explicitly. A bare entity with no bundle cannot persist.
Advanced & code-review questions (Q16-Q20)
16. Spot the bugs (asked as a code review):
for (claim in Query.make(Claim).select().toList()) {
var pmts = Query.make(Payment)
.compare(Payment#Claim, Equals, claim).select()
claim.TotalPaid_Ext = pmts.sum(\ p -> p.Amount)
}Expected findings: (1) unbounded query loads the whole Claim table (toList()); (2) query-per-claim inside the loop (N+1); (3) mutation without a bundle (claim from a query result is read-only, needs bundle.add(claim)); (4) this belongs in a chunked batch process, not inline code.
17. How does Gosu code participate in validation rules?
Rules bodies are Gosu; validation rules call Result.reject.../add errors and warnings at a validation level against the entity. Key discipline points: keep rule conditions cheap (they run on every commit of that entity type) and never perform external calls inside validation.
18. What is gw.api.* vs entity.* vs typekey.*?
Namespaces: entity.* holds generated entity types (Claim, PolicyPeriod), typekey.* generated typelist types, gw.api.* the platform's public Gosu/Java API (Query, Transaction, util classes). Knowing where things live shows you've navigated the real codebase, not just slides.
19. How do you write and run tests for Gosu code?
GUnit-style server tests extending Guidewire's test framework classes: they boot a test server context, create entities in test bundles with builders, run the logic, and assert on the graph. On cloud projects, CI runs these headlessly. Honest answers about test data builders and rollback-per-test are rewarded, fabricated details are easily probed.
20. When do you write Java instead of Gosu on a Guidewire project?
Heavy algorithmic/utility code, code shared with non-Guidewire systems, third-party SDK integration, and performance-critical paths, packaged as Java libraries called from Gosu. Rules, enhancements, PCF logic, and entity-touching business code stay in Gosu. The pragmatic split, not language advocacy, is the right answer.
Shaky on any of these?
Work through the free Gosu guide with syntax references and cheat sheet, then return to this list.
Open the Gosu GuideRelated reading: Top 50 Guidewire Interview Questions · PolicyCenter Questions · ClaimCenter Questions · Training Roadmap