52/60 = 87%, against a 76% pass mark. Six marks over. That beats #17's 51 by one
mark. Spring Core was 96% (one miss in 25). MVC and Testing were both 100%.
Half the misses were in Data Management (4 of 11): propagation, isolation levels, the JNDI DataSource and
@Query. Two of the 8 were questions you'd missed before, word for word, and you made the same wrong tick
both times.
The first fourteen papers averaged 40.3. The last nine average 47.9, and seven of those nine passed. Two passes in a row now, and this one has the biggest margin so far.
How the sizes come out. Core at 96% with one miss is 24/25. Data at 64% with four misses is 7/11. Boot at 75% with two misses is 6/8. Security at 80% with one miss is 4/5. That's 49 questions, so MVC and Testing shared the other 11 between them, all correct. Security's drop is one question on a five-question section, and it was a repeat.
| If you had… | Score | Result |
|---|---|---|
| What actually happened | 52 | 87% — pass |
| …and not repeated the two wrong ticks from earlier papers (Q5, Q24) | 54 | 90% |
| …and read "can not occur" the right way round on Q36 | 55 | 92% |
…and ticked @Named on Q6 | 56 | 93% |
| …and not made the other four wrong picks (Q1, Q40, Q43, Q46) | 60 | 100% |
Stopping short is nearly gone: one question this time, down from four. Seven of the eight misses had a wrong tick, so on this paper the marks went on ticking an option that sounds plausible.
| Attempt #22 | Attempt #23 | Result | |
|---|---|---|---|
| Score | 49/60 (82%) | 52/60 (87%) | +3 · best ever |
| Misses | 11 | 8 | −3 |
| Spring Core misses | 3 of 21 | 1 of 25 | 96%, held and improved |
| Stopped short (no wrong tick) | 4 | 1 | −3 |
| Questions with a wrong tick | 7 | 7 | Flat |
| Data Management misses | 3 | 4 | +1 · the weakest section now |
| Word-for-word repeats | 3 of 11 | 2 of 8 | Both with the same wrong tick as before |
| Time | 41m 15s | 39m 42s | −1.5 min |
| Q | Topic | Already on this site | Then → now |
|---|---|---|---|
| Q24 | jsr250Enabled = true | #19 | Ticked "All of the above" both times |
| Q5 | Default health indicators | #8 Q15 | Ticked ApplicationHealthIndicator both times |
Q1 isn't a word-for-word repeat, but it's the third paper running where a propagation question cost a mark: #12 (REQUIRED), #22 (NEVER), now #23 (REQUIRED again, and you picked MANDATORY). The Data block has the full table.
Each time you finish a drill block (every question answered), it's recorded here in this browser. Reload the page to retake a block. Questions and options reshuffle every time. Aim for a full score on every block, and redo the repeats block on a different day from the first try.
| Drill block | Qs | Last | Best | Runs | Last done |
|---|---|---|---|---|---|
| Loading… | |||||
| Q | Topic | What went wrong | The answer |
|---|---|---|---|
| Q1 | Creates a tx if none exists | Picked MANDATORY | REQUIRED |
| Q5 | Default health indicators | + ApplicationHealthIndicator · same as #8 | DiskSpaceHealthIndicator · ElasticsearchRestHealthIndicator |
| Q6 | Overriding the bean id | Stopped short — 3 were true | @Bean(name="x") · @Bean(name={"a","b"}) · @Named("x") |
| Q24 | jsr250Enabled = true | + "All of the above" · same as #19 | @RolesAllowed only |
| Q36 | Non-repeatable reads can not occur | Ticked Read Committed + Read Uncommitted — the reverse | Repeatable Read · Serializable |
| Q40 | DistributionSummary | + "increments by the value, like a counter" | Captures count, total, mean, max |
| Q43 | DataSource on an app server | + @Bean returning BasicDataSource | JNDI lookup via JndiDataSourceLookup |
| Q46 | @Query statements | + "@Query is mandatory for hand-written queries" | Defines JPQL · redundant on derivable names · @Param binds :name |
@Named is the likely one. On Q36 both wrong options have no letter. The likeliest reading is
that you ticked those two and not the right two, which means the question was read as "can occur".
@EnableGlobalMethodSecurity(jsr250Enabled = true) ticked a false option 2nd paper, same tick| Attribute | Switches on | Where the annotation comes from |
|---|---|---|
jsr250Enabled = true | @RolesAllowed (+ @PermitAll, @DenyAll) | JSR-250, the Java standard. 250 → Roles |
securedEnabled = true | @Secured | Spring's own. secured → @Secured, same word |
prePostEnabled = true | @PreAuthorize, @PostAuthorize (+ filters) | Spring, SpEL-based. prePost → Pre/Post, same word |
Two of the three names give it away: securedEnabled → @Secured,
prePostEnabled → @Pre…/@Post…. So jsr250Enabled can't also switch those on,
and "All of the above" is out as soon as you've ruled out one option. In Spring Security 6,
@EnableMethodSecurity replaces it with the same three attributes, but prePostEnabled
defaults to true and the other two default to false.
ApplicationHealthIndicator, here and on #8.The true pair was DiskSpaceHealthIndicator (always on) and
ElasticsearchRestHealthIndicator (when an Elasticsearch client bean is present). Every built-in
indicator checks one external dependency: DataSource, Redis, Mongo,
Rabbit, Elasticsearch, Cassandra, Neo4j, disk space, plus
ping. The application's overall health isn't an indicator. Actuator aggregates all the
indicators into it. ConnectionHealthIndicator is too vague: there's no single "connection" to check.
Footnote: older Boot versions did have a class
called ApplicationHealthIndicator. It was a fallback that always said UP when no other indicator
existed. It's not one of the defaults this question means, and the bank marks it wrong both times.
REQUIRED, the defaultMANDATORY. MANDATORY requires a transaction but never
creates one. If none exists, it throws.| Propagation | Tx already exists | No tx exists |
|---|---|---|
REQUIRED (default) | Joins it | Creates one |
REQUIRES_NEW | Suspends it, creates a new one | Creates one |
NESTED | Savepoint inside it | Creates one (like REQUIRED) |
SUPPORTS | Joins it | Runs without |
NOT_SUPPORTED | Suspends it, runs without | Runs without |
MANDATORY | Joins it | Throws |
NEVER | Throws | Runs without |
Only three create a transaction: REQUIRED, REQUIRES_NEW, NESTED. The two that throw are opposites: MANDATORY throws when there's no transaction, NEVER throws when there is one.
| Level (weakest → strongest) | Dirty read | Non-repeatable read | Phantom read |
|---|---|---|---|
READ_UNCOMMITTED | possible | possible | possible |
READ_COMMITTED | prevented | possible | possible |
REPEATABLE_READ | prevented | prevented | possible |
SERIALIZABLE | prevented | prevented | prevented |
Each level fixes one more problem, in order: dirty → non-repeatable → phantom. The level's name tells you what it fixes: Read Committed stops reading uncommitted (dirty) data; Repeatable Read makes reads repeatable. Before answering a "not" question, say the question back with the "not" in it.
@Bean method returning a BasicDataSource. That
builds a second pool inside your app, next to the one the server already has.The question's key words are "deployed on top of an Application Server". The server (WebLogic,
WildFly, WebSphere) has a DataSource configured under a JNDI name, with pooling, credentials and XA. Spring's job
is to fetch it: JndiDataSourceLookup in a @Bean, <jee:jndi-lookup>
in XML, or spring.datasource.jndi-name in Boot. A BasicDataSource/Hikari bean or
spring.datasource.url is right for a standalone app with an embedded server.
@Bean
public DataSource dataSource() {
return new JndiDataSourceLookup().getDataSource("java:comp/env/jdbc/AppDB");
}
@Query statements ticked a false option@Query is one way to hand-write a query. It isn't the only way@Query annotation is mandatory for defining any hand-written
query".A JPA named query also works with no @Query: put
@NamedQuery(name = "Product.findProductByName", query = "…") on the entity (or in
orm.xml), and Spring Data matches it to the repository method by name. A custom repository
implementation can also run any query through the EntityManager. Words like "mandatory",
"any" and "only" need just one counterexample to be false, and named queries are that
counterexample.
The three true statements: @Query defines custom JPQL for the method;
@Param("name") binds to :name; and @Query is redundant when the name is
already derivable (findByName). The two false ones you rightly left alone: @Query
can run native SQL (nativeQuery = true), and JPQL @Query methods do
accept Pageable and Sort.
@Query, or a
@NamedQuery on the entity.DistributionSummary ticked a false optionrecordValue is
called, similar to a counter".Recording 3, 10 and 5 into a summary gives count = 3, total = 18, max = 10, and the mean (6) follows from those. You can also turn on percentiles. A counter only goes up by an amount. It has no max, mean or distribution. The option sounds half-right because total does go up by each value, but "like a counter" is the wrong description: the point of a summary is the distribution.
| Meter | Measures | Example |
|---|---|---|
Counter | A count that only goes up | Requests served, errors |
Gauge | A current value that goes up and down | Queue size, active sessions |
Timer | How long things take: count, total time, max | Request latency |
DistributionSummary | Same as Timer, for non-time values: count, total, max | Payload size in bytes, batch size |
@Named("someName").| How the bean is declared | Default name | Override |
|---|---|---|
@Bean method | The method name | @Bean("x") or @Bean(name = {"x", "alias"}). The first name is primary, the rest are aliases |
@Component / @Service class | Class name, first letter lower-case | @Component("x"), @Service("x") |
| JSR-330 class | Class name, first letter lower-case | @Named("x"), which counts as a component and sets its name |
XML <bean> | Generated | id="x", name="a,b" |
Spring supports the JSR-330 annotations as standard equivalents: @Inject ≈
@Autowired, @Named ≈ @Component (on a class) or @Qualifier
(on an injection point). So @Named("someName") on a scanned class sets its bean id. The only false
option was "it's not possible to override".
@Named is the standard's @Component, and it takes a
name the same way.| Q | Rule |
|---|---|
| Q24 | jsr250Enabled → @RolesAllowed · securedEnabled → @Secured · prePostEnabled → @PreAuthorize/@PostAuthorize. One family each |
| Q5 | Health indicators check one dependency (disk, DataSource, Redis, Elasticsearch…). "Application" health is the aggregate, not an indicator |
| Q1 | Only REQUIRED, REQUIRES_NEW and NESTED create a transaction. MANDATORY throws if none exists, NEVER throws if one does |
| Q36 | Each level fixes one more problem: Read Committed → no dirty, Repeatable Read → no non-repeatable, Serializable → no phantom. Read "not" questions twice |
| Q43 | App server → look the DataSource up in JNDI (JndiDataSourceLookup, <jee:jndi-lookup>, spring.datasource.jndi-name). Standalone → build a pool |
| Q46 | Queries come from the method name, @Query, or a @NamedQuery. So @Query is never mandatory |
| Q40 | DistributionSummary = a Timer for non-time values: count, total, max (mean). Not a counter |
| Q6 | Bean names: @Bean("x"), @Bean(name={"x","alias"}), @Component("x"), @Named("x") |
Every question here is a new wording of a fact from this paper. Do it last, or on another day.