Section 1: Introduction & Background
100 Interview Questions & Answers
Section 1: Introduction & Background (Q1–Q10)
Q1. Tell me about yourself. I'm a full-stack software engineer with 15 years of experience, primarily in the Java and Spring ecosystem. I'm currently a Senior Software Developer at Hubject in Germany, where I design solution concepts, lead complex deployments, and mentor junior developers. Before that I worked across gaming (Aeria Games), international organizations (United Nations), and product companies in Bangladesh, including Samsung R&D. Recently I've expanded into applied AI engineering — building LLM-powered features with Spring AI, RAG pipelines with vector databases, and MCP integrations — because I believe AI-augmented backend systems are where the industry is heading.
Q2. Walk me through your career progression. I started in 2011 at Dynamic Solution Innovators in Bangladesh building Java applications for CRM, health, and banking sectors. I moved through Samsung R&D (Android OS work), Servicely (data migration for a financial client), and Cefalo, where I built publishing platforms for Scandinavian clients. In 2017 I joined the United Nations in Thailand as a Java Consultant and designed the Sendai Framework Monitor backend from scratch. I relocated to Germany in 2019 for Aeria Games, migrating a gaming platform to Google Kubernetes Engine, and joined Hubject in 2020, where I was promoted from Intermediate to Senior Developer in 2023.
Q3. What does Hubject do, and what is your role there? Hubject operates a B2B eRoaming platform for electric vehicle charging — it connects charge point operators and e-mobility service providers so EV drivers can charge across networks. I work on the HBS B2B platform. As a Senior Developer I create solution concepts, evaluate trade-offs given project constraints, lead complex deployments, support CI/CD and infrastructure changes, and mentor junior team members. I also act as a product advocate for complex technical solutions when communicating with stakeholders.
Q4. What accomplishment are you most proud of? Migrating over 1.5 billion data entries from Elasticsearch to OpenSearch at Hubject with no data loss and minimal downtime. It required careful planning: dual-writing during the transition, batch reindexing with checkpointing, validation tooling to compare document counts and checksums, and a rollback strategy. It taught me a lot about migrating live, high-volume systems safely.
Q5. Why are you looking for a new role? I've grown a lot at Hubject — from Intermediate to Senior, owning solution design and mentoring. Now I'm looking for a role with a broader architectural scope and, ideally, one where I can apply my applied AI experience (Spring AI, RAG, MCP) in production systems rather than personal projects. I want to keep growing toward an architect-level role.
Q6. What are your greatest strengths? Depth in the Java/Spring ecosystem combined with breadth across the full delivery lifecycle — from solution design to deployment and monitoring. I'm also strong at large-scale data migrations and at making complex systems operable: I've maintained 50+ microservices on AWS. Finally, I invest in staying current — my recent AI/LLM work is an example of proactively building skills before they're required.
Q7. What is a weakness you're working on? I sometimes go too deep into technical perfection when a pragmatic solution would ship faster. I've learned to counter this by explicitly time-boxing design work and asking "what's the simplest thing that satisfies the actual constraint?" — a habit reinforced by my solution-concept work at Hubject, where I have to recommend the best approach given project constraints, not in the abstract.
Q8. Why should we hire you? Three reasons. First, proven scale: I've built and operated systems serving thousands of companies and migrated billions of records. Second, versatility: backend depth in Java/Spring plus frontend (Angular), cloud (AWS, GCP, Kubernetes), and now AI/LLM integration. Third, seniority beyond code: I design solutions, unblock teams, lead deployments, and mentor — I raise the level of the whole team, not just my own output.
Q9. Where do you see yourself in five years? Moving toward a software architect role — owning system design across teams, working with domain-driven design, documenting decisions with ADRs, and communicating architecture to stakeholders. I'm already studying distributed systems patterns, the C4 model, and non-functional requirements to prepare for that path.
Q10. What kind of work environment do you thrive in? Agile teams with clear ownership and honest technical discussion. I've worked in Scrum and Kanban for years; I value short feedback loops, blameless retrospectives, and a culture where identifying and escalating blockers early is seen as a strength — something I actively do in my current Scrum team.
Section 2: Core Java (Q11–Q25)
Q11. What's the difference between JDK, JRE, and JVM? The JVM is the runtime that executes bytecode and provides memory management, JIT compilation, and garbage collection. The JRE is the JVM plus the core class libraries needed to run applications. The JDK is the JRE plus development tools — compiler (javac), debugger, and profilers. As a developer I work with the JDK; production containers historically shipped the JRE, though with modern Java we often build custom runtimes with jlink.
Q12. Explain the Java memory model at a high level.
Heap memory stores objects and is shared across threads, divided by generational GC into young (Eden + survivor spaces) and old generations. Each thread has its own stack for frames, local variables, and references. Metaspace holds class metadata. The Java Memory Model also defines visibility and ordering guarantees between threads — the happens-before relationship — which is why we need volatile, synchronized, or java.util.concurrent tools for safe cross-thread communication.
Q13. How does garbage collection work, and which collector would you choose? GC automatically reclaims unreachable objects. Most collectors are generational: short-lived objects die in the young generation via cheap minor GCs; survivors are promoted to the old generation. For modern services I default to G1 (the JDK default), which balances throughput and pause times using region-based collection. For latency-sensitive services with large heaps I'd evaluate ZGC or Shenandoah, which offer sub-millisecond pauses. In practice I've tuned heap sizing and monitored GC pauses for microservices under load at Hubject.
Q14. What's the difference between == and equals()?
== compares references (or primitive values), while equals() compares logical equality as defined by the class. If you override equals(), you must override hashCode() consistently — otherwise hash-based collections like HashMap and HashSet break. A classic pitfall is comparing Strings or boxed Integers with ==; small Integer values are cached (-128 to 127) so it works accidentally, then fails for larger values.
Q15. HashMap vs ConcurrentHashMap vs Hashtable? HashMap is not thread-safe and allows one null key. Hashtable is legacy, synchronized on every method — a global lock, poor concurrency. ConcurrentHashMap provides thread safety with fine-grained locking (bucket-level CAS and synchronized bins since Java 8), so reads are mostly lock-free and writes only contend within a bin. In services I use ConcurrentHashMap for shared in-memory caches and HashMap for method-local usage.
Q16. How does HashMap work internally?
It's an array of buckets. A key's hashCode() is spread and mapped to a bucket index; collisions are handled by chaining. Since Java 8, a bucket converts from a linked list to a red-black tree when it exceeds 8 entries, so worst-case lookup degrades to O(log n) instead of O(n). When size exceeds capacity × load factor (default 0.75), the table resizes and entries are rehashed. This is also why mutable objects make dangerous keys — if the hash changes after insertion, the entry becomes unreachable.
Q17. Explain the difference between checked and unchecked exceptions. What's your practice?
Checked exceptions must be declared or handled (IOException); unchecked extend RuntimeException and don't (NullPointerException, IllegalArgumentException). My practice in Spring services: use unchecked exceptions for business errors, translate them centrally with @ControllerAdvice into consistent API error responses, and reserve checked exceptions for genuinely recoverable conditions. Spring itself converts most checked exceptions (e.g., SQLExceptions) into its unchecked DataAccessException hierarchy for the same reason.
Q18. What are Java Streams, and when would you avoid them? Streams provide a declarative pipeline over collections — map, filter, reduce, collect — improving readability for transformations. I'd avoid them for: performance-critical hot loops (lambda/boxing overhead), complex control flow with early exits and side effects, and debugging-heavy code where stack traces get noisy. Parallel streams specifically need caution: they share the common ForkJoinPool, so a blocking operation inside a parallel stream can starve the whole application.
Q19. Explain final, finally, and finalize().
final makes a variable unassignable, a method non-overridable, or a class non-extendable. finally is the block that always executes after try/catch — used for cleanup, though try-with-resources is preferred for closeables. finalize() was a hook called before GC reclaims an object; it's deprecated and removed in newer JDKs because it's unpredictable — use Cleaner or try-with-resources instead.
Q20. What is the volatile keyword?
volatile guarantees visibility: writes to a volatile field are immediately visible to other threads, and it prevents instruction reordering around it. It does not provide atomicity for compound operations — count++ on a volatile int is still a race. For counters use AtomicInteger/LongAdder; for compound invariants use locks. A classic legitimate use is a volatile boolean running flag to stop a worker thread.
Q21. How do you create threads in Java, and what do you actually use in practice?
Raw options are extending Thread or implementing Runnable/Callable, but in practice I never create threads manually. I use ExecutorService thread pools with explicit sizing, CompletableFuture for async composition, and Spring's @Async with a configured TaskExecutor. Since Java 21, virtual threads change the calculus — you can have millions of cheap threads for blocking I/O workloads, which simplifies high-concurrency services that would previously have needed reactive programming.
Q22. What is a deadlock, and how do you prevent it?
A deadlock occurs when threads hold locks and wait for each other in a cycle. Prevention strategies: acquire locks in a consistent global order, use tryLock with timeouts instead of blocking indefinitely, keep lock scopes small, and prefer higher-level constructs (concurrent collections, queues) over manual locking. For diagnosis, a thread dump (jstack) shows deadlocked threads explicitly — the JVM detects lock cycles.
Q23. What's new in recent Java versions that you use?
Records for immutable DTOs, sealed classes for closed hierarchies, pattern matching for instanceof and switch, text blocks for readable SQL/JSON, and virtual threads (Java 21) for high-throughput blocking I/O. Records in particular cleaned up a lot of boilerplate in API request/response models. I follow LTS releases — 17 and 21 — as production baselines.
Q24. Explain immutability and why it matters.
An immutable object can't change state after construction — all fields final, no setters, defensive copies of mutable inputs. Benefits: inherent thread safety (no synchronization needed), safe use as map keys, easier reasoning, and safe sharing across layers. Strings, records, and the List.of() collections are immutable. In microservices I keep DTOs and configuration objects immutable to eliminate whole classes of concurrency bugs.
Q25. What is the difference between an interface and an abstract class today? Interfaces define contracts and since Java 8 can carry default and static methods; a class can implement many. Abstract classes can hold state, constructors, and protected members, but allow only single inheritance. My rule: interfaces for capabilities and API contracts (mockable, composable), abstract classes only when subclasses genuinely share state or constructor logic. With default methods, the practical need for abstract classes has shrunk considerably.
Section 3: Spring, Spring Boot & Hibernate (Q26–Q40)
Q26. What is dependency injection and why does Spring use it? DI means a component receives its dependencies from a container instead of constructing them itself. It decouples classes from concrete implementations, makes testing trivial (inject mocks), and centralizes wiring and lifecycle management. Spring's IoC container manages beans, resolves the dependency graph, and handles scopes and proxies. I use constructor injection exclusively — it makes dependencies explicit, enables final fields, and fails fast on cycles.
Q27. Explain the Spring Bean lifecycle.
The container instantiates the bean, injects dependencies, then runs aware callbacks (BeanNameAware etc.), BeanPostProcessor postProcessBeforeInitialization, @PostConstruct/InitializingBean, then postProcessAfterInitialization — which is where AOP proxies are typically applied. On shutdown, @PreDestroy and DisposableBean run. Understanding this matters in practice: for example, calling a @Transactional method from inside the same bean bypasses the proxy, so the transaction never starts — a classic bug.
Q28. How does Spring Boot auto-configuration work?
@EnableAutoConfiguration (inside @SpringBootApplication) loads configuration classes listed in AutoConfiguration.imports from the classpath. Each is guarded by conditions — @ConditionalOnClass, @ConditionalOnMissingBean, @ConditionalOnProperty — so configuration activates only when relevant dependencies exist and you haven't defined your own bean. That's why adding spring-boot-starter-data-jpa gives you a DataSource, EntityManagerFactory, and transaction manager with zero XML. You can inspect decisions with the --debug conditions report.
Q29. @Component vs @Service vs @Repository vs @Controller?
All are stereotypes registering a bean via component scanning. @Service is semantic — business layer. @Repository additionally enables persistence exception translation into Spring's DataAccessException hierarchy. @Controller/@RestController register request handler mappings, with @RestController implying @ResponseBody. The distinction aids readability, AOP pointcuts, and tooling more than behavior.
Q30. How does @Transactional work under the hood?
Spring wraps the bean in a proxy (JDK dynamic proxy or CGLIB). When a transactional method is called through the proxy, a transaction interceptor opens or joins a transaction via the PlatformTransactionManager, binds the connection to the thread, and commits or rolls back based on the outcome. Key gotchas I always mention: self-invocation bypasses the proxy; by default only unchecked exceptions trigger rollback; and propagation settings (REQUIRED vs REQUIRES_NEW) control nesting behavior. Long transactions holding DB connections are a common performance killer under load.
Q31. Explain JPA entity lifecycle states. Transient (new, unknown to the persistence context), managed (attached; changes tracked and flushed automatically — dirty checking), detached (was managed, session closed), and removed (scheduled for deletion). Many Hibernate bugs come from misunderstanding these — e.g., modifying a detached entity and expecting it to persist, or LazyInitializationException when accessing a lazy association after the session closed.
Q32. What is the N+1 select problem and how do you fix it?
Loading N parent entities and then lazily triggering one query per child association — 1 + N queries. Fixes: JOIN FETCH in JPQL for specific use cases, @EntityGraph to declare fetch plans per query, or batch fetching (@BatchSize / default_batch_fetch_size) to collapse N queries into a few IN-clause queries. I detect it by enabling SQL logging in dev and using tools like Hibernate statistics; in production, slow endpoints with high query counts in APM traces are the giveaway.
Q33. First-level vs second-level cache in Hibernate? The first-level cache is the persistence context itself — per session, always on, guarantees repeatable reads of entities within a transaction. The second-level cache is optional, shared across sessions, backed by providers like Ehcache or Redis, and suits read-mostly reference data. I'm conservative with L2 caching in distributed systems — invalidation across service instances is hard, and for read-heavy data I usually prefer explicit Redis caching at the service layer where I control TTLs and keys.
Q34. How do you handle database schema changes in a Spring Boot application?
With versioned migrations — Flyway or Liquibase — never ddl-auto=update in production. Migrations are immutable, reviewed in PRs, and run on startup or in the deployment pipeline. For zero-downtime deployments the rule is backward-compatible changes: add columns as nullable, backfill, then tighten constraints in a later release; never rename or drop in the same release the code stops using them.
Q35. RestTemplate vs WebClient vs HTTP interfaces?
RestTemplate is the classic blocking client, in maintenance mode. WebClient is reactive and non-blocking, usable from both reactive and servlet apps. Since Spring 6, declarative HTTP interfaces (@HttpExchange) give a Feign-like typed client on top of WebClient or RestClient. For new blocking services I use RestClient (the modern synchronous API) or HTTP interfaces; I reach for WebClient when I genuinely need non-blocking concurrency, like fanning out to multiple downstream services.
Q36. How do you validate input in a REST API?
Bean Validation (Jakarta Validation): annotate request DTOs with @NotNull, @Size, @Pattern, custom constraint annotations for business rules, and @Valid on controller parameters. Violations raise MethodArgumentNotValidException, which I translate in a @RestControllerAdvice into a structured error response with field-level messages. Validation belongs at the boundary — by the time data reaches the domain layer it should be trusted.
Q37. How do you write tests for a Spring Boot service?
A pyramid: fast unit tests with JUnit 5 and Mockito for business logic; slice tests — @WebMvcTest for controllers, @DataJpaTest for repositories; and a smaller set of @SpringBootTest integration tests, using Testcontainers to run real PostgreSQL/Elasticsearch/Redis in Docker so tests match production behavior. For API contract tests I've used Karate, and Selenium/TestCafe for end-to-end UI flows. CI runs everything on each PR through Jenkins.
Q38. How do you secure a Spring Boot REST API?
Spring Security with stateless JWT or OAuth2/OIDC — in B2B platforms typically client-credentials flow against an identity provider. The filter chain validates tokens, populates the SecurityContext, and method-level rules (@PreAuthorize) enforce fine-grained authorization. Beyond authentication: enforce HTTPS, validate all input, set security headers, rate-limit at the gateway, and never log secrets or tokens. Secrets live in a vault or Kubernetes secrets, not in configuration files.
Q39. What are Spring profiles and how do you use them?
Profiles activate environment-specific beans and properties — application-dev.yml, application-prod.yml, @Profile on beans. I keep differences minimal and externalize the rest to environment variables or a config server, following twelve-factor principles. In Kubernetes, configuration comes from ConfigMaps and Secrets; profiles mainly distinguish local development (embedded fakes, verbose logging) from deployed environments.
Q40. How do you monitor a Spring Boot application in production? Spring Boot Actuator exposes health, metrics, and info endpoints. Metrics flow through Micrometer to Prometheus/CloudWatch, dashboarded in Grafana; alerts fire on error rates, latency percentiles (p95/p99), JVM memory, and GC pauses. Logs are structured (JSON) and centralized — I've used Elasticsearch-based logging stacks. Distributed tracing with correlation IDs (Micrometer Tracing / OpenTelemetry) ties a request across microservices, which is essential when you operate 50+ services like we do at Hubject.
Section 4: Microservices & System Design (Q41–Q52)
Q41. Monolith vs microservices — how do you decide? Microservices buy independent deployment, scaling, and team autonomy at the cost of distributed-system complexity: network failures, eventual consistency, operational overhead. My rule: start with a well-modularized monolith unless you have organizational scale (multiple teams) or clearly divergent scaling/availability needs. At Hubject, microservices make sense — many bounded contexts, thousands of B2B clients, independent scaling. For a small team and product, a modular monolith ships faster.
Q42. How do microservices communicate in systems you've built? Synchronously via REST for request/response interactions, and asynchronously via messaging — I've worked extensively with AWS SQS — for decoupled, resilient workflows. Async is my default for anything that doesn't need an immediate answer: it absorbs load spikes, survives downstream outages, and enables retry semantics. The trade-off is eventual consistency and the need for idempotent consumers, since SQS standard queues deliver at-least-once.
Q43. How do you handle a failing downstream service? Layered resilience: timeouts on every remote call (no unbounded waits), retries with exponential backoff and jitter — only for idempotent operations — circuit breakers (Resilience4j) to fail fast when a dependency is down, and fallbacks or graceful degradation where the business allows. Bulkheads isolate thread pools so one slow dependency can't exhaust resources for everything else. And monitoring: a circuit breaker opening should page someone.
Q44. What is idempotency and why does it matter in distributed systems? An idempotent operation produces the same result no matter how many times it's applied. It matters because networks fail ambiguously: a timeout doesn't tell you whether the request was processed, so clients and message consumers retry. With SQS's at-least-once delivery, consumers must handle duplicates — via idempotency keys, conditional writes, or deduplication tables. Designing APIs so PUT and message handlers are idempotent turns retries from a danger into a safe default.
Q45. How do you maintain data consistency across microservices? Avoid distributed transactions (2PC) — they don't scale and couple availability. Instead: sagas for multi-service workflows, either choreographed via events or orchestrated by a coordinator, with compensating actions for rollback. The transactional outbox pattern guarantees that a database write and its corresponding event are published atomically. And design for eventual consistency explicitly — the business process usually tolerates it better than engineers assume.
Q46. Design an API that serves thousands of B2B companies. What do you consider? From my HBS platform experience: versioning strategy from day one (URI or header-based) because B2B clients upgrade slowly; strict backward compatibility and a deprecation policy; authentication via OAuth2 client credentials with per-client rate limits and quotas; pagination, filtering, and idempotency keys on mutating endpoints; comprehensive OpenAPI documentation; and observability per client — you need to answer "which client is generating this traffic spike?" Multi-tenancy isolation and fair-use throttling protect all tenants from one noisy one.
Q47. How would you approach migrating 1.5 billion records with minimal downtime? (Your CV mentions this.) The approach I used for Elasticsearch → OpenSearch: first, make the application dual-write to both systems so new data stays in sync. Then backfill historical data in batches with checkpointing — resumable, rate-limited to protect the source cluster. Continuously validate: document counts per index, spot-check checksums, and query-result comparisons. Switch reads gradually (canary a subset of traffic), keep dual-writing until confidence is high, then decommission the source. The keys are resumability, validation, and an always-available rollback path.
Q48. What is an API gateway and what belongs in it? A single entry point handling cross-cutting concerns: authentication/token validation, rate limiting, routing, TLS termination, request logging, and sometimes response caching. What does not belong in it: business logic. Keep the gateway thin, or it becomes a shared bottleneck and deployment coupling point. In Kubernetes environments this role is often split between an ingress controller and a dedicated gateway.
Q49. Explain CAP theorem and its practical implications. Under a network partition, a distributed system must choose between consistency (every read sees the latest write) and availability (every request gets a response). Practically: PostgreSQL with synchronous replication leans CP; systems like Cassandra or an SQS-based async flow lean AP with eventual consistency. The real skill is choosing per use case — payment balances need consistency; a product catalog or activity feed tolerates staleness. Most of my systems mix both: strongly consistent core writes, eventually consistent read models and caches.
Q50. How do you approach observability across 50+ microservices? Three pillars, standardized: structured JSON logs shipped to a central store with correlation IDs propagated across every service boundary; metrics via a common Micrometer setup with uniform dashboards (RED metrics — rate, errors, duration — per service); and distributed tracing so one slow request can be followed across hops. Equally important is convention: shared libraries or a platform template so every new service emits telemetry identically. Alerting targets symptoms (SLO burn) rather than causes, to avoid pager fatigue.
Q51. What patterns do you use for service-to-service authentication? OAuth2 client-credentials tokens issued by a central identity provider, validated at each service; or mTLS via a service mesh where the platform handles it. Tokens should be short-lived and scoped. Never shared static API keys in config files. Internally, propagating the original caller's identity (token exchange or forwarded claims) matters for auditability — "which client caused this write?" must remain answerable at every hop.
Q52. How do you version and evolve events/messages in an async architecture? Treat message schemas as public contracts. Rules: additive changes only (new optional fields), never repurpose or remove fields consumers rely on, and include a schema version in the payload or headers. For breaking changes, publish to a new version and run consumers side by side during migration. Consumer-driven contract tests catch accidental breaks in CI before they hit production.
Section 5: Databases, Elasticsearch & Redis (Q53–Q64)
Q53. How do you optimize a slow PostgreSQL query?
Start with EXPLAIN (ANALYZE, BUFFERS) to see the actual plan: sequential scans on large tables, misestimated row counts, expensive sorts or nested loops. Typical fixes: add or adjust indexes (including composite and covering indexes matching the WHERE/ORDER BY shape), rewrite the query to be sargable (no functions on indexed columns), update statistics with ANALYZE, or restructure — pagination with keyset instead of OFFSET for deep pages. If the query is fine but volume is the issue: caching, read replicas, or denormalized read models.
Q54. What index types does PostgreSQL offer, and when do you use them?
B-tree is the default — equality and range queries, ORDER BY support. GIN for JSONB containment queries, arrays, and full-text search. GiST for geometric and range types. Hash for pure equality (rarely worth it). Partial indexes for hot subsets (WHERE status = 'ACTIVE'), and expression indexes for computed lookups (lower(email)). Every index costs write performance and storage, so I index deliberately based on real query patterns, not speculatively.
Q55. Explain transaction isolation levels in PostgreSQL.
Read Committed (default): each statement sees data committed before it started — non-repeatable reads possible within a transaction. Repeatable Read: snapshot per transaction; PostgreSQL's implementation also prevents phantom reads, but concurrent updates can trigger serialization errors you must retry. Serializable: full serializability via SSI, detecting dangerous patterns at commit. In practice I stay on Read Committed and use explicit locking (SELECT ... FOR UPDATE) or optimistic locking (@Version in JPA) where correctness requires it.
Q56. Optimistic vs pessimistic locking — when do you use each?
Optimistic locking assumes conflicts are rare: a version column is checked at update time, and a conflict throws an exception you handle by retrying or informing the user — great for low-contention web workloads and the JPA default I use. Pessimistic locking (SELECT FOR UPDATE) blocks concurrent access up front — appropriate for high-contention rows like account balances or inventory counters where retries would thrash. Pessimistic locks held across long transactions are a scalability trap.
Q57. How does Elasticsearch differ from PostgreSQL, and when do you use it? Elasticsearch is a distributed search and analytics engine built on inverted indexes: excellent at full-text relevance, fuzzy matching, aggregations over huge datasets, and horizontal scaling; but near-real-time (refresh interval), eventually consistent, and not a system of record — no transactions or joins in the relational sense. My pattern: PostgreSQL as the source of truth, Elasticsearch as a derived read/search index kept in sync via events or CDC. If you can rebuild the index from the primary store, its consistency model stops being scary.
Q58. Explain Elasticsearch's architecture — shards, replicas, nodes. An index is split into primary shards (fixed at creation — plan capacity up front), each a Lucene index distributed across data nodes; replicas are copies providing redundancy and read throughput. A coordinating node scatter-gathers queries across shards. Master-eligible nodes manage cluster state. Sizing lessons from operating it at scale: avoid oversharding (each shard has overhead), keep shards in the tens-of-GB range, and use ILM/rollover for time-based data.
Q59. What did you learn from the Elasticsearch → OpenSearch migration? Beyond the mechanics (Q47): validate assumptions about client compatibility early — client libraries and API versions diverge between the two after the fork. Reindexing throughput is bound by the target cluster's indexing capacity, so tune batch sizes, refresh intervals (disable during bulk load), and replica counts (add replicas after backfill, not during). Build validation tooling as a first-class deliverable, not an afterthought. And communicate progress in business terms — "x% migrated, on track for date" — because a billion-record migration is a stakeholder topic, not just an engineering one.
Q60. How do you use Redis, and what are its main data structures? Primarily for caching (strings/hashes with TTLs), distributed locks, rate limiting (INCR with expiry or sliding windows via sorted sets), and session/ephemeral state. Structures: strings, hashes, lists, sets, sorted sets (great for leaderboards and time-windowed queries), plus streams for lightweight messaging. Redis is single-threaded for command execution, so commands are atomic — which is what makes patterns like INCR-based counters safe.
Q61. What caching strategies do you use, and what are the pitfalls? Cache-aside is my default: read from cache, on miss read DB and populate, invalidate or update on write. Pitfalls: stale data (mitigate with sensible TTLs and event-driven invalidation), cache stampede on hot-key expiry (mitigate with jittered TTLs, request coalescing, or soft-expiry refresh), and treating the cache as a source of truth. I only cache data whose staleness tolerance I can state explicitly — if nobody can tell me how stale is acceptable, it doesn't get cached.
Q62. How do you handle cache invalidation across multiple service instances? Prefer a shared cache (Redis) over per-instance in-memory caches so there's one thing to invalidate. Where local caches are needed for latency, layer them: short-TTL local cache over Redis, accepting brief staleness, or broadcast invalidation events via pub/sub. TTL is the safety net regardless — every entry expires eventually even if an invalidation message is lost.
Q63. When would you choose SQS over Kafka (or vice versa)? SQS: fully managed, trivial operations, per-message workloads, automatic scaling, DLQs built in — ideal for task queues and decoupling services, which is how I've used it. Kafka: ordered partitioned logs, replayability, multiple independent consumers of the same stream, high-throughput event streaming and event sourcing. If you need to reprocess history or fan the same events to many consumers, Kafka; if you need a reliable work queue with minimal ops, SQS. FIFO SQS covers moderate ordering needs.
Q64. How do you design an SQS consumer to be production-grade? Idempotent processing (at-least-once delivery means duplicates will happen), visibility timeout tuned to processing time with heartbeat extension for long tasks, batch receive for throughput, exponential backoff on failures, and a dead-letter queue with alerting — a growing DLQ is an incident signal. Also: graceful shutdown that stops polling and finishes in-flight messages before the pod terminates, which matters in Kubernetes where instances are replaced routinely.
Section 6: Cloud, Kubernetes & DevOps (Q65–Q74)
Q65. Tell me about migrating a platform from a data center to Google Kubernetes Engine. (Aeria Games) We moved a large-scale gaming platform (Trion Worlds) from a traditional data center to GKE. The work involved containerizing services with Docker, defining Kubernetes manifests for deployments and services, rethinking configuration and secrets for the cloud, adapting stateful components, and setting up CI/CD to deploy to the cluster. The migration was incremental — service by service with traffic shifting — because a big-bang cutover for a live gaming platform was unacceptable. The payoff was elastic scaling for player-load spikes and far faster, more reliable deployments.
Q66. Explain core Kubernetes concepts you use daily. Pods (the schedulable unit), Deployments (declarative rollout and rollback of ReplicaSets), Services (stable virtual IPs and load balancing across pods), Ingress (HTTP routing into the cluster), ConfigMaps and Secrets (externalized configuration), and HorizontalPodAutoscaler (scaling on CPU/memory or custom metrics). Liveness and readiness probes are critical for JVM services — readiness gates traffic until Spring Boot is actually up, and liveness restarts hung pods.
Q67. How do you make a JVM application behave well in Kubernetes? Set container-aware memory: modern JVMs respect cgroup limits, but you must leave headroom beyond heap for metaspace, threads, and native memory — a common OOMKilled cause is heap ≈ container limit. Configure resource requests/limits realistically, tune readiness probes for JVM startup time, handle SIGTERM for graceful shutdown (Spring Boot's graceful shutdown drains in-flight requests), and enable preStop hooks so load balancers deregister before the pod dies. For faster startup, consider CDS or, where appropriate, native images.
Q68. Describe a CI/CD pipeline you would set up for a microservice. On each PR: compile, unit tests, static analysis, and integration tests with Testcontainers. On merge to main: build a versioned Docker image, scan it for vulnerabilities, push to a registry, deploy automatically to a staging environment, run smoke/contract tests, then promote to production — via rolling update, or canary for risky changes — with automated rollback on failing health metrics. I've built and improved pipelines like this with Jenkins; the principles carry to GitLab CI or GitHub Actions. The goal is that deploying is boring.
Q69. How do you achieve zero-downtime deployments? Rolling updates with readiness probes so traffic only reaches healthy new pods; graceful shutdown so old pods drain connections; backward-compatible database migrations (expand-migrate-contract pattern); and backward-compatible APIs and message schemas so old and new versions coexist mid-rollout. For higher-risk releases: canary deployments with automated metric analysis, or feature flags to decouple deployment from release entirely.
Q70. What do you monitor, and how do you decide what to alert on? Golden signals per service: latency (p95/p99), traffic, error rate, and saturation (CPU, memory, connection pools, queue depth). JVM-specifics: heap usage, GC pause time, thread counts. Business metrics where they matter — e.g., message processing lag. Alerts fire on user-impacting symptoms tied to SLOs, not on every anomaly; a spiking DLQ or SLO burn rate pages someone, a single pod restart does not. Every alert must be actionable, or it trains people to ignore alerts.
Q71. A production service is suddenly slow. Walk me through your debugging process. First, scope: one service or many, all endpoints or one, all clients or one — dashboards and traces answer this fast. Check recent changes: deployments, config, traffic patterns. Then follow the trace: is time spent in the service (GC pauses, thread pool exhaustion, CPU throttling) or downstream (slow DB query, saturated dependency, external API)? For DB suspicion: active query analysis and locks in PostgreSQL. For JVM suspicion: thread dumps and GC logs. I fix the bleeding first (scale out, roll back, open a circuit breaker), then do root-cause analysis and a blameless postmortem with a prevention action.
Q72. How do you manage secrets and configuration securely? Secrets never live in code or plain config files: Kubernetes Secrets (ideally backed by an external manager like AWS Secrets Manager or Vault with rotation), injected as env vars or mounted files. Configuration follows twelve-factor: environment-specific values externalized, sane defaults in the app. Access is least-privilege via IAM roles/service accounts — pods get exactly the permissions they need, not a shared god-credential. And CI scans for accidentally committed secrets.
Q73. What's your experience with AWS services? Day-to-day: SQS for async messaging between microservices, and operating 50+ microservices hosted on AWS — which in practice means IAM roles and policies, CloudWatch metrics/logs/alarms, load balancers, and container infrastructure. I've also worked with Google Cloud (GKE) at Aeria Games, so I'm comfortable mapping concepts across providers. My focus is architecting services to be cloud-portable: managed services where they remove toil, abstractions where lock-in would hurt.
Q74. How do you approach infrastructure changes safely, as your Hubject role requires? Infrastructure as code so changes are reviewed like application code; apply in staging first; make changes incrementally and reversibly; and coordinate timing with the team — I lead complex deployments, and the difference between a smooth one and an incident is usually preparation: a written plan, a rollback path, monitoring dashboards open, and clear communication about who does what when.
Section 7: AI / LLM Engineering (Q75–Q87)
Q75. Tell me about your AI/LLM experience. I've built AI-powered features in personal projects using Spring AI: RAG pipelines with vector databases, and Model Context Protocol servers so LLMs can call tools and access context safely. I also built an autonomous coding assistant based on mini-swe-agent concepts — an agent loop that reads a task, edits code, runs tests, and iterates. Day to day I use AI-assisted development tools (GitHub Copilot, Claude Code, and agent tooling like OpenClaw and Hermes Agent) and have studied the integration patterns underneath: context management, tool calling, and prompt design. My angle is bringing production engineering discipline — testing, observability, cost control — to LLM features.
Q76. What is Spring AI and why use it over calling an LLM API directly? Spring AI is Spring's abstraction layer for AI integration: a portable ChatClient API across providers (OpenAI, Anthropic, local models), built-in support for structured outputs (mapping responses to Java records), prompt templates, function/tool calling that binds Java beans as callable tools, embedding clients, and vector store abstractions over pgvector, Elasticsearch, Redis, and others. The value is the same as Spring Data's: swap providers without rewriting business logic, get idiomatic Spring configuration and testing, and keep AI code consistent with the rest of a Java codebase.
Q77. Explain RAG — what it is and why it exists. Retrieval-Augmented Generation grounds an LLM in external knowledge: at query time you retrieve relevant documents and inject them into the prompt so the model answers from your data rather than only its training. It exists because models have knowledge cutoffs, don't know your private data, and hallucinate when asked beyond their knowledge. RAG is usually cheaper and more maintainable than fine-tuning for knowledge injection — update the document store and the system knows the new information immediately, with sources you can cite.
Q78. Walk me through a RAG pipeline you would build. Ingestion: load documents, split them into chunks (semantic or fixed-size with overlap), generate embeddings via an embedding model, and store vectors plus metadata in a vector database. Query: embed the user's question, run a similarity search (optionally hybrid — combining vector and keyword search), optionally rerank the top candidates, then assemble a prompt with the retrieved context and clear instructions to answer only from it, citing sources. In Spring AI this maps to DocumentReaders, TextSplitters, an EmbeddingModel, a VectorStore, and advisors like QuestionAnswerAdvisor around the ChatClient.
Q79. How does vector similarity search work? Text is embedded into high-dimensional vectors where semantic similarity corresponds to geometric closeness — typically measured by cosine similarity. Exact nearest-neighbor search is too slow at scale, so vector databases use approximate algorithms like HNSW (a navigable graph structure) trading a little recall for large speedups. Practical knobs: embedding model choice, dimensionality, distance metric, and index parameters. Metadata filtering (search only documents for tenant X) is essential in real applications and affects index design.
Q80. What is chunking and why does it matter so much in RAG? Chunking splits documents into retrievable units, and it dominates RAG quality. Too large: retrieved chunks contain mostly irrelevant text, diluting the context and wasting tokens. Too small: chunks lose the surrounding meaning needed to answer. Good practices: split on semantic boundaries (headings, paragraphs) rather than raw character counts, use overlap so ideas spanning boundaries aren't cut, and attach metadata (title, section, source) both for filtering and so citations are possible. I evaluate chunking empirically — retrieval hit-rate on a test question set — rather than guessing.
Q81. What is the Model Context Protocol (MCP)? MCP is an open protocol (introduced by Anthropic) that standardizes how LLM applications connect to external tools and data. An MCP server exposes three primitives — tools (functions the model can invoke), resources (data it can read), and prompts (reusable templates) — over a standard transport, and any MCP-compatible client can use any server. It solves the M×N integration problem: instead of every AI app writing custom integrations for every system, you write one MCP server per system. I've built MCP integrations in personal projects; Spring AI ships MCP client and server support, so a Spring service can expose its capabilities to LLM agents with familiar annotations.
Q82. How does tool/function calling work with LLMs? You describe available functions to the model — name, purpose, JSON schema of parameters. The model doesn't execute anything; it responds with a structured request to call a tool with arguments. Your application executes the actual function, returns the result to the model, and the model continues, possibly chaining more calls. In Spring AI, you register Java methods as tools and the framework handles schema generation and the invocation loop. The engineering discipline is on your side: validate arguments, enforce authorization (the model must not be able to request actions the user isn't allowed to do), and make tools idempotent where possible.
Q83. Tell me about the autonomous coding assistant you built. It's based on mini-swe-agent concepts: an agent loop where an LLM receives a coding task, explores the repository, proposes edits, executes them in a sandboxed environment, runs tests, observes results, and iterates until the task passes or budget runs out. Building it taught me the hard parts of agents: context management (you can't fit a repo in a prompt — the agent needs targeted file reading), designing a minimal action space (bash execution covers a lot), robust output parsing, guarding against loops, and cost/step budgets. It gave me a much deeper understanding of how tools like Claude Code work internally, which also makes me a better user of them.
Q84. How do you evaluate and test LLM-based features? Differently from deterministic code, but no less rigorously. Build an evaluation dataset of representative inputs with expected properties; run it on every prompt or model change like a regression suite. Techniques: assertion-based checks for structured outputs, retrieval metrics for RAG (did the right chunks come back?), LLM-as-judge scoring for free-text quality, and human review for a sample. In production: log inputs/outputs (with privacy care), track user feedback signals, and monitor cost and latency per request. Prompts are code — versioned, reviewed, and tested.
Q85. What are the main risks of LLM features in production, and how do you mitigate them? Hallucination — mitigate with RAG grounding, citations, and constrained outputs. Prompt injection — treat retrieved documents and user input as untrusted; never let them override system instructions; strictly authorize tool calls server-side. Data leakage — control what goes into prompts, especially with third-party APIs; respect tenant isolation in retrieval. Cost and latency — token budgets, caching, model tiering (small model first, escalate when needed). And non-determinism — design UX that presents AI output as assistive with human confirmation for consequential actions.
Q86. How do AI coding tools fit into your workflow, and what's your view on them for a team? I use Copilot for in-editor completion and Claude Code and agent tools for larger tasks — scaffolding, refactoring, test generation, and exploring unfamiliar code. They're a significant productivity multiplier, but the senior engineer's job shifts to specification and review: the quality of what you get tracks the quality of the task definition, and everything gets reviewed like a junior developer's PR. For teams, I'd establish guidelines: what's allowed with proprietary code, review standards for AI-generated changes, and shared prompt/agent configurations so gains are consistent, not individual.
Q87. Why should a company hire a senior Java engineer for AI work instead of an ML specialist? For LLM application engineering — which is most enterprise AI work today — the hard problems are software engineering problems: integrating models into existing systems, data pipelines for RAG, tool security, testing non-deterministic components, observability, cost control, and reliability. You're consuming models via APIs, not training them. A senior backend engineer who understands both the enterprise stack and LLM integration patterns ships production AI features faster and more safely than someone who knows models deeply but not production systems. For model training or fine-tuning research, you'd want an ML specialist — different job.
Section 8: Behavioral & Leadership (Q88–Q100)
Use the STAR structure (Situation, Task, Action, Result) and adapt these skeletons with your real details.
Q88. Tell me about a time you led a complex deployment. Situation: At Hubject I lead complex deployments involving multiple services and infrastructure changes. Task: One release required coordinated changes across services with a database migration that couldn't break the live B2B API. Action: I wrote a deployment plan with explicit ordering, made the migration backward-compatible (expand-contract), scheduled the rollout in stages with health checks between steps, prepared a rollback path for each stage, and walked the team through it beforehand. Result: The deployment completed without downtime or client impact, and the plan template became our standard for risky releases.
Q89. Tell me about a time you mentored a junior developer. Situation: Part of my senior role is supporting junior team members with implementation. Task: A junior colleague was struggling with a complex feature involving transactions and async messaging. Action: Instead of taking it over, I broke the problem into stages with them, pair-programmed the trickiest part, explained the underlying concepts (transaction boundaries, idempotent consumers), and reviewed their PRs with teaching-oriented comments. Result: They delivered the feature, and more importantly handled a similar problem independently the next quarter. My measure of good mentoring is whether the same question comes back.
Q90. Tell me about a time you disagreed with a technical decision. Situation: A proposed solution favored a quick implementation that I believed would create scaling problems. Task: Influence the decision without derailing the timeline. Action: Rather than argue in the abstract, I prepared a short solution concept comparing both options against concrete constraints — expected load, operational cost, migration effort later — and presented it to the team. I also proposed a middle path that shipped in a similar timeframe but left the scaling door open. Result: We adopted the middle path. I've learned disagreement lands best as a written comparison against agreed constraints, not as opinion versus opinion.
Q91. Tell me about a production incident you handled. Situation: Operating 50+ microservices means incidents happen. Pick a real one — e.g., a degraded service or message backlog. Task: Restore service quickly while protecting data integrity. Action: Triaged scope from dashboards, stabilized first (scaled consumers / rolled back the offending change), communicated status to stakeholders on a fixed cadence, then root-caused via traces and logs. Action after: wrote a blameless postmortem with concrete prevention items — an alert, a test, a config change. Result: Service restored within the SLO, and the class of failure was eliminated rather than just this instance.
Q92. Tell me about a time you had to deliver under a tight deadline. Situation: Choose a real delivery crunch. Task: Ship the critical scope on time. Action: I negotiated scope explicitly — separated must-have from nice-to-have with the product owner — cut the riskiest non-essential parts, kept quality gates on what shipped (tests, review), and flagged the deferred work as tracked debt rather than letting it silently disappear. Result: Delivered the essential scope on time; deferred items were scheduled, not lost. The lesson I emphasize: under pressure you cut scope, not correctness.
Q93. Tell me about a time you identified and escalated a blocker. Situation: At Hubject, part of my role is identifying blockers within the Scrum team. Task: A dependency on another team's API was slipping and threatened our sprint goal. Action: I raised it in standup with impact stated concretely ("we miss the release date if this isn't resolved by Thursday"), proposed alternatives (mock the contract and integrate later; descope the dependent feature), and escalated to the product owner with options rather than just the problem. Result: We agreed on the contract-first approach and hit the release. Escalation works when you bring options and a recommendation, not just an alarm.
Q94. How do you handle receiving critical feedback? I ask clarifying questions to make sure I understand the specific behavior, look for the valid core even if the delivery is rough, and act on it visibly. Early in my career I took code review feedback personally; with experience I've internalized that critique of the code isn't critique of me — and as a reviewer myself, I now write the kind of feedback I'd want to receive: specific, reasoned, and about the work.
Q95. Describe your experience working in multicultural, distributed teams. My career spans Bangladesh, Thailand (UN), and Germany, with clients in Norway and Sweden and, at Hubject, colleagues and B2B customers worldwide. What I've learned: make communication explicit and written (decisions documented, not implied), don't mistake communication style for competence or commitment, over-communicate context across time zones, and confirm understanding rather than assuming it. At the UN, implementing multilingual support for 100+ languages was itself a lesson in designing for a global audience.
Q96. How do you approach solution design when requirements are ambiguous? First, extract the real constraints: what problem, for whom, what scale, what deadline, what must not break. I write a short solution concept — options, trade-offs, recommendation — because writing exposes ambiguity fast. Then I validate with stakeholders before building, and prefer designs that keep options open where uncertainty is highest. This is literally my role at Hubject: create solution concepts and recommend the best approach given project constraints — the phrase "given constraints" is the whole job.
Q97. Tell me about the most technically challenging project of your career. Strong candidates from your CV — pick the one you can go deepest on: the 1.5-billion-record Elasticsearch→OpenSearch migration (scale, zero downtime, validation), the data-center→GKE migration of a live gaming platform (incremental cutover, containerizing legacy services), or building the Sendai Framework Monitor backend from scratch for the UN (greenfield design, 100+ languages, international stakeholders). Structure it as STAR and be ready for three levels of follow-up depth on whichever you choose.
Q98. How do you keep your skills current? Deliberately and hands-on. The clearest recent example: I identified AI/LLM integration as strategically important, so I built real projects — RAG with vector databases, MCP servers, an autonomous coding agent — rather than only reading about them, and adopted AI tooling in my daily workflow. I also study toward my next role: distributed systems patterns, DDD, architecture documentation. My filter is "can I build something with it?" — knowledge I can't apply doesn't stick.
Q99. How do you balance technical debt against feature delivery? Make debt visible and priced: I track it explicitly, attach it to the pain it causes (incidents, slow delivery, onboarding cost), and negotiate capacity for it in planning rather than fixing it invisibly. Tactically, I follow the boy-scout rule for small debt and bundle related cleanup with feature work touching the same area. The senior skill is translating debt into business language — "this saves X hours per release" or "this removes our biggest incident source" — so prioritization is a shared decision, not an engineering complaint.
Q100. Do you have any questions for us? Always say yes. Strong options for a senior role: "What does the architecture look like today, and what's the biggest technical challenge in the next year?" — "How are AI/LLM capabilities being adopted here, and who owns that?" — "What does the path from senior engineer toward architecture look like in this organization?" — "How do teams here make and document technical decisions?" — "What would success look like for this role after six months?" Pick two or three that are genuine for you; the questions you ask signal your level as much as your answers.
How to use this document
- Don't memorize — internalize. Read each answer, then close the document and answer aloud in your own words.
- Fill in the STAR skeletons (Q88–Q97) with your real details, numbers, and names before interviews.
- Prepare for depth. Interviewers follow up 2–3 levels deep on anything you claim. For every headline (1.5B records, 50+ microservices, MCP, RAG), be ready to go one level more concrete than what's written here.
- Your differentiator is the combination: 15 years of production Java + genuine hands-on AI engineering. Bring the AI answers back to production discipline (testing, security, cost) — that's what separates you from people who've only done tutorials.