cswork / libraryOpen practice workspace

Interview guides · Capgemini FSSBU

Capgemini FSSBU Software Engineer Interview Guide

Capgemini FSSBU Software Engineer interview guide: the 3 reported rounds, OOP, Java/.NET, React, SQL and coding questions, plus a 7-day prep plan.

The 60-second brief

Capgemini FSSBU is the Financial Services Strategic Business Unit of Capgemini, an IT consulting firm. Candidates describe it as working with banks, capital markets firms and insurers on their software systems. The role description lists Java and microservices work on core banking backends, React or Angular front ends, and deployments on Azure and GCP. A Software Engineer works in agile squads next to business analysts, solution architects, quality engineers and client stakeholders, builds REST services, integrates third-party financial APIs, manages database schemas, writes unit and integration tests, and on some projects helps refactor legacy monoliths into cloud-native microservices.

This guide is for candidates applying as a Software Engineer at Capgemini FSSBU, whether through a campus drive or as a lateral hire. It covers the three reported rounds, the five groups of questions candidates report (OOP and CS fundamentals, Java and .NET backend frameworks, frontend, databases with cloud and architecture, and coding), and a plan that practises each group. It does not cover other roles in the unit.

Candidates report three rounds over roughly 3-5 weeks: an Online Assessment, Technical Interviews and a Final HR Round. Campus and lateral hires describe somewhat different routes through them.

Focus areas

  • Data Structures & Algorithms (DSA)
  • Object-Oriented Programming (OOP)
  • Programming Fundamentals

Overview

The reported questions fall into five groups of five. Core OOP and CS fundamentals cover encapsulation versus abstraction, overloading versus overriding, interface versus abstract class, .NET garbage collection and the internals of HashMap and HashSet. Backend framework questions cover LINQ, dependency injection in Spring Boot and .NET Core, building a REST microservice, fail-fast versus fail-safe iterators and IEnumerable versus IQueryable. The frontend group covers Redux versus Context, useEffect versus useLayoutEffect, error boundaries, Angular versus React components and a timer-driven traffic signal component. The fifth group is databases, cloud and architecture, and the sixth is plain coding: palindrome, Fibonacci, pattern printing, duplicates with two pointers and Java Streams.

Almost every one of these is a how-does-it-actually-work question rather than a puzzle. Candidates are told to understand the mechanics of their main stack instead of memorising framework documentation, so the useful practice is to explain each mechanism out loud with a small piece of code beside it: what the hash function does to a key, what a scoped service is scoped to, what SQL an IQueryable turns into.

The questions mix Java and .NET, and the role requirements list Java, C#, C++ or Python as the core language, with Spring Boot, .NET Core, React and Angular as frameworks. You will not know both stacks equally. Prepare your primary stack to the level of internals, and know enough of the other to give a side-by-side answer for the questions that name both, such as dependency injection and its lifecycles.

Because the unit serves financial clients, the scenario questions candidates describe lean on money-handling concerns: a resilient microservice that loses no transaction data, a slow query across ledger tables, and a production container updated without dropping sessions. Idempotent writes, transactions, indexes and rolling deployments are therefore worth rehearsing. Candidates also report that resume projects get probed in every round, so each project on your resume needs a short architecture explanation ready.

The Capgemini FSSBU interview process

These three rounds are what candidates describe, not a published process, and campus and lateral accounts differ in what the first two stages look like.

Online Assessment

Candidates report an online assessment with aptitude tests and coding challenges. For campus hires it is described as an automated screen on a platform such as Superset, covering quantitative aptitude, logical reasoning, verbal ability, pseudo-code analysis and basic DBMS, OS and OOP, sometimes with game-based memory and pattern quizzes, followed by an automated coding test. Lateral accounts instead describe a recruiter screening before the technical rounds. Coding assessments are reported to range from pseudo-code tests to live exercises on arrays, strings and data structures, so the coding questions in this guide (palindrome, Fibonacci, pattern printing, duplicates and two pointers) are the types worth practising for this stage. Approach it as a timed screen: read each problem fully, handle the edge case first, and leave time to run your code against a few inputs.

What to demonstrate

  • Aptitude and logical reasoning, as reported for the online screen
  • Pseudo-code reading and basic DBMS, OS and OOP knowledge for campus screens
  • Coding on arrays, strings and basic data structures

How to prepare

  • Trace short pseudo-code snippets by hand, writing the value of every variable per loop iteration, until you can do it without running anything
  • Solve the palindrome, Fibonacci, pattern-printing and duplicate-finding questions in your chosen language with no built-in reverse and no library helpers
  • Write two-sentence answers to the encapsulation versus abstraction and overloading versus overriding questions, since basic OOP is reported on the screen

Technical Interviews

Candidates report technical interviews that assess software development principles and hands-on experience. Lateral hires describe an L1 round on core languages, frameworks and live coding, then an L2 that is more advanced or client-facing, with scenario-based problem solving, system design and project achievements. Candidates report that most technical rounds include live coding in an online editor or over screen share: string and array logic, SQL queries, or a basic REST endpoint built from scratch. The reported questions across this stage's topics run from HashMap internals and dependency injection to React hooks, slow SQL and zero-downtime updates. Approach it by choosing your primary stack, preparing its internals with code, and practising coding aloud on a shared screen.

What to demonstrate

  • Core language, OOP and data structure fundamentals with code examples
  • Framework mechanics in your main stack: Spring Boot, .NET Core, React or Angular
  • Live coding, including string, array and SQL problems
  • Project experience and, for lateral hires, scenario-based and design discussion

How to prepare

  • Write and run small programs for the interface versus abstract class, HashMap collision and fail-fast iterator questions so each answer comes with real code
  • Build the Spring Boot (or .NET Core) REST service from an empty project, choosing dependencies yourself, and write the controller, service and repository layers with one test
  • Practise the slow-SQL and zero-downtime-update scenarios as step-by-step answers: what you check first, what you change, how you confirm it worked
  • Write a one-page architecture summary for each resume project: components, your exact contribution, tools and one problem you solved

Final HR Round

Candidates report the final round as an HR conversation on cultural fit, communication and career aspirations. For lateral hires it is described as an HR negotiation plus cultural-fit discussion. Candidates also report that salary expectations and notice period come up early in recruiter conversations, and that background verification of education and employment documents is strict, so those need to be accurate and to hand. Project and team-scenario questions in HR and managerial conversations are reported, and the STAR structure (Situation, Task, Action, Result) is the format candidates are advised to use.

What to demonstrate

  • Cultural fit and communication, as reported for this round
  • Career aspirations
  • Team and project scenarios, answered in STAR form

How to prepare

  • Write three STAR stories from your own projects, each ending in a result with a number you can defend
  • Prepare a straight answer on salary expectations and notice period, and gather the education and employment documents you will need to verify
  • Practise explaining one technical decision from your resume in plain language to a non-engineer, as you would to a client stakeholder
  • Write two questions to ask about the team, the client work and how projects are staffed

Where candidates lose points

Defining overloading, overriding, abstraction or interfaces in words with no code

For each OOP question, write a short class hierarchy before the interview. Show overloading resolved at compile time from the argument types, overriding resolved at run time from the object, and an abstract class holding shared state and constructor logic that an interface cannot hold. Say when you would pick each, using a payment-processing example, so the answer is concrete rather than a textbook line.

Describing HashMap or garbage collection at slogan level ("it hashes the key", "it frees unused memory")

Learn the actual sequence. For HashMap: hash spreading, bucket index, equals and hashCode, chained collisions, load-factor resize and the switch from a linked chain to a tree for long chains. For .NET: roots, generations 0, 1 and 2, the large object heap, compaction and why Dispose differs from a finalizer. Be ready to say what breaks when hashCode is inconsistent with equals.

Answering the slow SQL question with only "add an index"

Give a sequence: reproduce the slow query, read its execution plan, find the scan or the bad join order, check selectivity, build a composite index with the filter column before the sort column, avoid functions on indexed columns, then re-read the plan and compare. For financial ledger joins, also check for row multiplication from one-to-many joins and for missing predicates on large tables.

Coding silently, or finishing the palindrome, Fibonacci or pattern problem without testing edge cases

Narrate the plan before you type. Name the inputs you will test: an empty string, a single character, mixed case and punctuation for the palindrome, zero and one for Fibonacci, one row for a pattern. State time and space cost, and say that plain recursive Fibonacci repeats work and what memoisation changes. Rehearse this on a shared screen, since live coding is reported for the technical rounds.

Giving vague answers about your resume projects, or arriving at the HR round without salary, notice-period and document answers

Candidates report that resume projects get probed, so prepare an architecture sketch and a personal contribution statement in the first person for each one. Use STAR for scenario questions, with a measurable result. Settle your salary expectation and notice period before the first recruiter call, and check that your education and employment records match what you have said.

Questions & practice

How does memory management work in C# /.NET Core, and how do garbage collection cycles operate?

Medium · Core Object-Oriented Programming & Compu

Approach

  1. Start with value versus reference types: value-type locals live on the stack (or inline inside the object that contains them); reference-type objects live on the managed heap and are reclaimed by the garbage collector, not by scope exit.
  2. Explain the generational collector: generations 0, 1 and 2, most objects die young, survivors are promoted; a collection marks objects reachable from roots (stack references, statics, GC handles, registers), then sweeps and compacts.
  3. Cover the Large Object Heap: objects of 85,000 bytes or more go there, are collected with generation 2 and are not compacted by default, so it can fragment; mention workstation versus server GC and background GC for generation 2.
  4. Unmanaged resources: implement IDisposable and use using blocks; finalizers delay reclamation because the object survives an extra collection on the finalization queue; avoid calling GC.Collect in application code.
  5. Name real managed leaks: event handlers that keep subscribers alive, ever-growing static caches, and captured closures.

Follow-up

  • What is the difference between Dispose and a finalizer, and what does GC.SuppressFinalize do?
  • Why can large byte arrays cause memory pressure even when they are released?
  • How would you diagnose a memory leak in a running .NET service?

What is an Error Boundary in React, and how do you implement it to handle runtime rendering exceptions?

Medium · Frontend Development & Web Technologies

Approach

  1. An error boundary is a class component that defines static getDerivedStateFromError (switch to fallback UI) and/or componentDidCatch(error, info) (report the error); there is no hook equivalent, though the react-error-boundary package wraps it.
  2. It catches errors thrown while rendering, in lifecycle methods and in constructors of components below it; since React 16 an uncaught render error unmounts the whole tree, which is why boundaries matter.
  3. It does not catch errors in event handlers, asynchronous code (setTimeout, promise callbacks), server-side rendering, or errors thrown by the boundary itself; handle those with try/catch and state.
  4. Placement: wrap routes and independent widgets separately so one failure does not blank the page; allow recovery by resetting the boundary, for example by changing its key or using resetKeys.

Follow-up

  • How would you surface an error from a failed fetch inside useEffect to the nearest boundary?
  • Where would you send the error details in componentDidCatch?
  • How would you let the user retry after the fallback is shown?

Write a program to check whether a given string is a palindrome without using built-in reverse functions.

Medium · Problem Solving & Coding Challenges

Approach

  1. Two pointers: i from the start, j from the end, compare characters and move inward until they meet; any mismatch returns false. O(n) time, O(1) extra space, and no reversed copy is built.
  2. Clarify the rules first: case-sensitive or not, and whether spaces and punctuation are ignored; if ignored, advance i and j past non-alphanumeric characters (Character.isLetterOrDigit) and compare with Character.toLowerCase.
  3. Edge cases: empty string and single character are palindromes; null input needs a defined behaviour; strings of only punctuation should return true under the ignore rule.
  4. Mention that Java strings are UTF-16, so characters outside the Basic Multilingual Plane are surrogate pairs; compare code points if that input is possible. A recursive version works but uses O(n) stack.

Follow-up

  • Return true if the string can become a palindrome by deleting at most one character.
  • Check whether an integer is a palindrome without converting it to a string.
  • Find the longest palindromic substring; what is the complexity of expanding around centres?

Implement a method to generate the Fibonacci sequence using both iterative and recursive approaches.

Medium · Problem Solving & Coding Challenges

Approach

  1. Fix the definition: F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2); confirm whether the task is the nth term or the first n terms, and reject negative input.
  2. Naive recursion mirrors the definition but makes an exponential number of calls (about phi^n, bounded by O(2^n)) with O(n) stack depth; show it, then explain why it is slow.
  3. Improve it: memoised recursion is O(n) time and O(n) space; the iterative version keeps two variables and is O(n) time, O(1) space.
  4. Overflow: an int holds up to F(46) = 1,836,311,903 and a long up to F(92); beyond that use BigInteger (or long with Math.addExact to detect overflow).
  5. Optional extension: matrix exponentiation or fast doubling computes F(n) in O(log n) arithmetic steps.

Follow-up

  • How many calls does the naive recursion make for n = 5, and why does it grow so quickly?
  • Does Java optimise tail recursion? What does that mean for a deep recursive version?
  • How would you compute F(n) modulo 1,000,000,007 for n around 10^18?

Write a program to solve pattern-printing logic using nested loops in your preferred programming language.

Medium · Problem Solving & Coding Challenges

Approach

  1. Pin down the exact pattern by writing the n = 3 or n = 4 output first, then derive a per-row formula; for a centred star pyramid, row i (1 to n) has n - i leading spaces and 2i - 1 stars.
  2. Structure: an outer loop over rows, inner loops for spaces then symbols, a newline after each row; time is proportional to the number of characters printed, O(n^2) for a pyramid.
  3. Variants to have ready: right-angled and inverted triangles, a diamond (pyramid followed by an inverted pyramid of n - 1 rows), Floyd's triangle, and Pascal's triangle using C(r, k+1) = C(r, k) * (r - k) / (k + 1), multiplying before dividing so the result stays an integer.
  4. Build each row in a StringBuilder and print it once instead of many System.out calls; check n = 0 and n = 1 and trailing spaces, where off-by-one errors usually appear.

Follow-up

  • Print a hollow diamond for a given n.
  • Print Pascal's triangle without computing factorials. Why does the multiply-then-divide order matter?
  • How would the code change if n could be even for a symmetric pattern?

Implement array manipulation tasks, such as finding duplicate elements or reordering values using two-pointer

Medium · Problem Solving & Coding Challenges

Implement array manipulation tasks, such as finding duplicate elements or reordering values using two-pointer techniques.

Approach

  1. Clarify for duplicates: return values or indices, is the array sorted, what is the value range, may the input be modified. A HashSet pass is O(n) time and O(n) space; sorting and comparing neighbours is O(n log n) time with little extra space.
  2. If n + 1 values lie in the range 1 to n, Floyd's cycle detection finds a duplicate in O(n) time and O(1) space without modifying the array; marking visited indices by negating values also works but mutates the input.
  3. Two-pointer reordering patterns: a write pointer to move zeros to the end preserving order; slow and fast pointers to remove duplicates from a sorted array in place; pointers from both ends to partition evens and odds; three pointers (Dutch national flag) to sort 0s, 1s and 2s in one pass.
  4. On a sorted array, the pair-with-target-sum problem uses lo and hi pointers moving toward each other, O(n) time and O(1) space.
  5. Edge cases: empty and single-element arrays, all-equal values, negative numbers, and integer overflow when adding values.

Follow-up

  • Find every duplicated value using O(1) extra space; what assumptions on the values make that possible?
  • Is your partition stable? How would you make it stable, and what does that cost?
  • How would you find duplicates in a file too large to load into memory?

What strategies do you use for database indexing and query optimization when dealing with slow SQL execution?

Medium · Databases, Cloud & System Architecture

Approach

  1. Measure before changing anything: find the slow statement (slow query log, pg_stat_statements, SQL Server Query Store), then read EXPLAIN or EXPLAIN ANALYZE for full scans, bad row estimates, the join algorithm and sorts that spill.
  2. Index the columns used in WHERE, JOIN and ORDER BY; in a composite index put equality columns before the range column (leftmost-prefix rule), and add included columns for a covering, index-only read.
  3. Name what makes an index unusable: a function on the column (WHERE YEAR(created_at) = 2024, rewritten as a date range), implicit type conversion, a leading wildcard LIKE '%x', OR across different columns, low selectivity.
  4. Rewrite the query: select only needed columns, replace correlated subqueries with joins or EXISTS, remove N+1 calls from the application, use keyset pagination instead of large OFFSET, refresh statistics.
  5. Cost side: every index slows INSERT and UPDATE and uses storage, so drop unused ones and confirm the gain with the plan again.

Follow-up

  • What is the difference between a clustered and a non-clustered index?
  • Why might the optimizer ignore an index that exists on the filtered column?
  • Which index would you build for a ledger queried by account and date range, sorted by date?

Replace offset paging on the resource feed with keyset

Easy · keyset pagination · composite index · sort order

resource holds resource_id, tenant_id, owner_user_id, title, body_ref, version, status ('draft','active','archived','deleted'), created_at, updated_at, deleted_at, with an index on (tenant_id, status, updated_at DESC, resource_id DESC). The listing endpoint returns active resources for one tenant, newest update first, 50 per page, today with LIMIT 50 OFFSET n. Tenants reach page 400 and rows are created while they read. Write the keyset query, define what the cursor carries and how it is encoded, and say which part of the index each predicate uses. Assume PostgreSQL 16.

Approach

  1. Name the two failures separately. OFFSET 20000 makes the server produce and discard 20,000 rows, so page cost grows with depth rather than with page size. Independently, any write that changes how many rows sort above the offset moves the window between two fetches, and the direction decides which anomaly you get: an insert lands at the head of updated_at DESC and pushes already-returned rows down past the boundary, so they are returned a second time; a delete above the offset, or a row whose updated_at is bumped above the cursor, pulls rows up and one is never returned at all. Nothing in the response reveals either.
  2. Write the seek: WHERE tenant_id = $1 AND status = 'active' AND (updated_at, resource_id) < ($2, $3) ORDER BY updated_at DESC, resource_id DESC LIMIT 50. The row-value comparison is one index range rather than a disjunction, and both columns are NOT NULL, which is what makes that comparison well defined.
  3. Map each predicate onto the index: tenant_id and status are equality on the leading columns, (updated_at, resource_id) is the range, and the ORDER BY matches the index order so no Sort node appears and the scan stops after 50 rows. The DESC in the definition only matters for mixed directions — a plain ascending btree on the same columns is read backwards for this query.
  4. Put both sort columns in the cursor and nothing the client can tamper with into another tenant: base64 of (updated_at, resource_id), validated server-side, with tenant_id taken from the principal.

Follow-up

  • The client asks for 'jump to page 400'. What do you offer instead, and what does the honest version cost?
  • Sort order becomes user-selectable across four columns. How many indexes is that, and which would you refuse to add?

What is the difference between encapsulation and abstraction, and how do you implement both in an enterprise a

Medium · Core Object-Oriented Programming & Compu

What is the difference between encapsulation and abstraction, and how do you implement both in an enterprise application?

Approach

  1. Separate the two: encapsulation bundles state with the methods that guard it and hides the representation (private fields, validated mutators, invariants); abstraction exposes what an operation does and hides how, through an interface or abstract type that callers depend on.
  2. Give one enterprise example of each: an Account class with a private balance and a debit() method that rejects overdrafts is encapsulation; a PaymentGateway interface with one implementation per provider, injected into a service, is abstraction.
  3. Name the mechanisms: access modifiers (private, package-private or internal, protected) enforce encapsulation; interfaces, abstract classes and layering (a repository interface that hides SQL) deliver abstraction.
  4. Call out the common mistake: public getters and setters for every field is not encapsulation, and returning a mutable internal list leaks state; return an unmodifiable view or a copy.

Follow-up

  • Is a class with a public getter and setter for every field encapsulated?
  • Which SOLID principle depends on abstraction, and how does it show up in a Spring or .NET service?
  • How does the repository pattern use both ideas at once?

Explain the difference between method overloading and method overriding with practical code examples.

Medium · Core Object-Oriented Programming & Compu

Approach

  1. Overloading: same method name, different parameter list (count, types or order), resolved at compile time from the static types of the arguments; a different return type alone does not create an overload.
  2. Overriding: a subclass redefines an inherited instance method with the same signature, resolved at runtime from the object's actual type (dynamic dispatch). Return type may be covariant, access cannot be narrowed, and checked exceptions cannot be broadened; mark it with @Override.
  3. Code example: calculateInterest(BigDecimal amount) and calculateInterest(BigDecimal amount, int days) as overloads; SavingsAccount overriding Account.calculateInterest, called through an Account reference to show dispatch.
  4. Edge cases: static methods are hidden, not overridden; private and final methods cannot be overridden; in C# overriding needs virtual plus override, while the new keyword hides the base method.

Follow-up

  • Given foo(String) and foo(Object), which runs for foo(null), and what changes if the second overload is foo(Integer)?
  • Can you override a static method? What happens if you try?
  • Is overloading a form of polymorphism, and how does it differ from runtime polymorphism?

What are the core differences between an interface and an abstract class, and when would you choose one over t

Medium · Core Object-Oriented Programming & Compu

What are the core differences between an interface and an abstract class, and when would you choose one over the other?

Approach

  1. List the structural differences: an abstract class can hold instance fields, constructors, any access level and concrete methods, and a class extends only one; an interface has no instance state (only public static final constants), and a class can implement many.
  2. Note the Java 8+ changes: default and static methods in interfaces, private interface methods since Java 9; in C# 8+ default interface members exist too, so the deciding factor is state and single inheritance, not 'no method bodies'.
  3. Choose an interface for a capability or contract with several unrelated implementations, for dependency injection and for mocking in tests; choose an abstract class when implementations share state and a fixed algorithm skeleton (Template Method).
  4. Mention the combination used in the JDK: an interface for the contract plus an abstract skeletal class (List and AbstractList) so implementers inherit common behaviour without losing the interface.

Follow-up

  • If a class implements two interfaces with the same default method, what must it do?
  • Can an abstract class have a constructor, and when is it called?
  • Adding a method to a widely used interface: what breaks, and how do default methods help?

Explain the internal working mechanism of a HashMap and HashSet in Java, including collision resolution st

Medium · Core Object-Oriented Programming & Compu

Explain the internal working mechanism of a HashMap and HashSet in Java, including collision resolution strategies.

Approach

  1. HashMap is an array of buckets; the key's hashCode is spread (h ^ (h >>> 16)) and the index is hash & (capacity - 1), which is why capacity is a power of two.
  2. Collisions use separate chaining: nodes in a bucket form a linked list; since Java 8 a bucket becomes a red-black tree once a chain reaches 8 entries and the table has at least 64 buckets (otherwise the table resizes), so a bad bucket costs O(log n) instead of O(n).
  3. Resizing: default capacity 16 and load factor 0.75; when size exceeds capacity times load factor the table doubles and each entry moves either to the same index or to index + old capacity.
  4. HashSet is a wrapper around a HashMap: the element is the key and a shared dummy object is the value; add returns whether put returned null.
  5. Edge cases: equals and hashCode must agree, mutating a key after insertion makes it unreachable, one null key is allowed, and HashMap is not thread-safe (use ConcurrentHashMap).

Follow-up

  • What happens if a class overrides equals but not hashCode and you put it in a HashSet?
  • How does open addressing (linear probing, as in Java's ThreadLocalMap) compare with chaining?
  • How does ConcurrentHashMap allow concurrent writes without locking the whole table?

What is the difference between SingleOrDefault and FirstOrDefault in LINQ, and how does each affect databa

Medium · Enterprise Backend Frameworks (Java &.NE

What is the difference between SingleOrDefault and FirstOrDefault in LINQ, and how does each affect database execution?

Approach

  1. Semantics: FirstOrDefault returns the first matching element or the default (null for reference types, 0 for int) and ignores further matches; SingleOrDefault returns the only match or the default when none, and throws InvalidOperationException when more than one matches.
  2. Database effect in EF Core: FirstOrDefault translates to TOP(1) or LIMIT 1; SingleOrDefault fetches up to two rows (TOP(2) or LIMIT 2) so it can detect a duplicate. Both benefit from an index on the filter column.
  3. Without an OrderBy, which row First returns from a database is not deterministic, so add an explicit order when the choice matters.
  4. Use SingleOrDefault when uniqueness is an invariant (a unique column) so a data error surfaces as an exception; use FirstOrDefault when any or the top row is acceptable; for a primary-key lookup, Find checks the change tracker before querying.

Follow-up

  • What SQL would you expect each call to generate, and how would you check it?
  • What does SingleOrDefault return on an empty sequence of int, and why can that be misleading?
  • Would you catch the exception from SingleOrDefault or prevent the duplicate with a unique index?

Explain dependency injection in Spring Boot and.NET Core, detailing how object lifecycles are managed across s

Medium · Enterprise Backend Frameworks (Java &.NE

Explain dependency injection in Spring Boot and.NET Core, detailing how object lifecycles are managed across scopes.

Approach

  1. Define it: the container builds objects and supplies their dependencies, preferably through the constructor, so classes depend on abstractions, are testable with fakes and do not construct their own collaborators.
  2. Spring: beans come from @Component, @Service or @Bean; scopes are singleton (default), prototype, and web scopes request, session and application. Lifecycle: instantiate, inject, BeanPostProcessor hooks, @PostConstruct, use, @PreDestroy on context close (not called for prototype beans).
  3. ASP.NET Core: register in IServiceCollection with AddSingleton (one per app), AddScoped (one per request scope) or AddTransient (new per resolution); the container disposes IDisposable instances it created at the end of the scope or at shutdown.
  4. Captive dependency: a singleton holding a scoped service such as a DbContext; .NET scope validation throws for this in Development, and in Spring a prototype injected into a singleton is created only once unless you use ObjectProvider, @Lookup or a scoped proxy.

Follow-up

  • Why is constructor injection preferred over field injection?
  • Why is a DbContext registered as scoped rather than singleton?
  • How would you resolve a circular dependency between two services?

How do you build a RESTful microservice from scratch using Spring Boot, and how do you configure package depen

Medium · Enterprise Backend Frameworks (Java &.NE

How do you build a RESTful microservice from scratch using Spring Boot, and how do you configure package dependencies?

Approach

  1. Bootstrap with Spring Initializr: spring-boot-starter-web, spring-boot-starter-data-jpa, spring-boot-starter-validation, spring-boot-starter-actuator and a JDBC driver; the spring-boot-starter-parent (or the Gradle plugin with its BOM) manages versions so you do not pin each library.
  2. Layer it: a @RestController with @GetMapping, @PostMapping, @PutMapping and @DeleteMapping returning ResponseEntity with correct status codes; a @Service with @Transactional; a JpaRepository; DTOs separate from entities.
  3. Handle errors once: @Valid on request bodies plus a @RestControllerAdvice with @ExceptionHandler methods mapping exceptions to a consistent error body (400, 404, 409).
  4. Configuration: application.yml with profiles, secrets from environment variables, actuator health endpoints for liveness and readiness.
  5. Dependencies and tests: use mvn dependency:tree to find conflicts and add exclusions, set scopes (runtime, test, provided); test with @WebMvcTest and MockMvc, @DataJpaTest, and Testcontainers for integration.

Follow-up

  • How does auto-configuration decide what to configure (conditional annotations on classpath and properties)?
  • How would you version this API without breaking existing clients?
  • What do you add when a downstream call is slow or failing (timeouts, retries, a circuit breaker)?

Explain the concepts of Fail-Fast versus Fail-Safe iterators in Java collections with examples.

Medium · Enterprise Backend Frameworks (Java &.NE

Approach

  1. Fail-fast: iterators of ArrayList and HashMap compare the collection's modCount with the expected count on each next(); a structural change made outside the iterator throws ConcurrentModificationException, even in single-threaded code.
  2. Show the classic bug: removing from a list inside a for-each loop throws; fix it with iterator.remove(), list.removeIf(predicate), or by collecting items and removing after the loop.
  3. Fail-safe (the JDK calls these weakly consistent or snapshot iterators): CopyOnWriteArrayList iterates a snapshot and never throws but does not see later writes, and every write copies the array (O(n)); ConcurrentHashMap iterators never throw and may or may not reflect changes made after creation.
  4. State that fail-fast detection is best-effort, not a guarantee, so it is a bug detector, not a thread-safety mechanism; pick CopyOnWriteArrayList for read-heavy, rarely written lists such as listeners.

Follow-up

  • Why does removing the second-to-last element in a for-each loop not throw?
  • How would you remove entries from a HashMap while iterating over it?
  • When is CopyOnWriteArrayList a bad choice?

What are the differences between IEnumerable and IQueryable when querying database entities?

Medium · Enterprise Backend Frameworks (Java &.NE

Approach

  1. IEnumerable<T> is LINQ to Objects: operators take delegates (Func) and run in memory. IQueryable<T> operators take expression trees (Expression<Func>) that the provider, such as EF Core, translates into SQL.
  2. Consequence: a Where applied after ToList() or AsEnumerable() pulls every row into the application and filters there; keep Where, Select and Take on the IQueryable so the database filters, projects and limits.
  3. Both use deferred execution: nothing runs until enumeration, and enumerating an IQueryable twice runs the query twice.
  4. EF Core 3 and later throw when an expression cannot be translated (except in the final projection) instead of silently evaluating it on the client; inspect the generated SQL with ToQueryString() or logging.
  5. Design trade-off: returning IQueryable from a repository lets callers compose queries but leaks persistence details; returning materialised lists keeps the boundary clear.

Follow-up

  • What is the difference between calling ToList() and AsEnumerable() in the middle of a query?
  • Should a repository expose IQueryable? Defend your choice.
  • How would you spot an N+1 query pattern in an EF Core application?

How do you manage global state across complex React components using Redux versus the Context API?

Medium · Frontend Development & Web Technologies

Approach

  1. Context is a way to pass a value down the tree without prop drilling; paired with useState or useReducer it can hold state, but every consumer re-renders when the provider's value changes, and there is no built-in selector.
  2. Redux (Redux Toolkit today): one store, pure reducers via createSlice, actions, and useSelector, which re-renders a component only when its selected value changes by reference; middleware such as thunks for async work; devtools for tracing actions.
  3. Rule of thumb: Context for low-frequency values (theme, locale, signed-in user); Redux or another store for frequently updated state shared by many components or with complex update logic.
  4. Context mitigations: split into several providers, memoise the value with useMemo, wrap expensive children in React.memo. Server data (API caches) is often better handled by RTK Query or React Query than by either.

Follow-up

  • Why does passing an inline object as a context value cause re-renders on every parent render?
  • How does Redux Thunk handle an asynchronous API call?
  • How would you normalise a list of entities in the store?

Explain the key differences between useEffect and useLayoutEffect in React, and when each should be applie

Medium · Frontend Development & Web Technologies

Explain the key differences between useEffect and useLayoutEffect in React, and when each should be applied.

Approach

  1. Both run after React commits changes to the DOM. useLayoutEffect runs synchronously before the browser paints; useEffect usually runs after paint, so it does not block the frame.
  2. Use useLayoutEffect to measure layout (getBoundingClientRect) and adjust synchronously, for example positioning a tooltip, so the user never sees a flicker; keep it short because it delays paint.
  3. Use useEffect for data fetching, subscriptions, timers and logging; the cleanup function runs before the next effect and on unmount, and the dependency array controls when it re-runs.
  4. Edge cases: useLayoutEffect does not run during server rendering (older React versions warn about it); in development Strict Mode, React 18 mounts, unmounts and remounts components, so effects must clean up correctly.

Follow-up

  • In what order do the cleanup of the old effect and the new effect run?
  • How do you fix an effect that reads a stale value from an earlier render?
  • Why would a fetch inside useLayoutEffect be a poor choice?

Explain the difference between component-based architecture in Angular and functional components with React Ho

Medium · Frontend Development & Web Technologies

Explain the difference between component-based architecture in Angular and functional components with React Hooks.

Approach

  1. Angular is a full framework: components are TypeScript classes with the @Component decorator, a template and styles; services are provided through hierarchical dependency injection; routing, forms and HTTP are built in, with RxJS throughout.
  2. React is a UI library: components are functions returning JSX; state comes from useState or useReducer, side effects from useEffect, and logic is reused through custom hooks; there is no built-in DI (Context fills that role).
  3. Binding and rendering: Angular uses property and event binding plus two-way [(ngModel)] and change detection driven by Zone.js (or OnPush, and signals in recent versions); React uses one-way data flow and re-renders when state or props change, reconciling against the virtual DOM.
  4. Map lifecycles: ngOnInit roughly corresponds to useEffect with an empty dependency array, ngOnDestroy to the effect's cleanup, ngOnChanges to an effect with dependencies.
  5. Trade-off: Angular gives one opinionated structure for large teams; React leaves routing, state and forms to library choices.

Follow-up

  • How does OnPush change detection decide when to re-check a component?
  • What is the React equivalent of an Angular service shared across components?
  • How would you share form validation logic in each framework?

How do you implement a dynamic component in JavaScript, such as an automated traffic signal light where states

Medium · Frontend Development & Web Technologies

How do you implement a dynamic component in JavaScript, such as an automated traffic signal light where states shift on a timer?

Approach

  1. Model it as a finite state machine: a config table of states (red, green, yellow), each with its duration and next state, and render purely from the current state.
  2. Vanilla JavaScript: chain setTimeout calls, scheduling the next transition with the current state's duration (setInterval with one fixed tick cannot give different durations cleanly); keep the timer id so stop() can clearTimeout.
  3. React: hold the current light in useState (or useReducer); a useEffect that depends on the light sets one setTimeout to advance and returns a cleanup that clears it, which avoids stale closures and leaked timers after unmount.
  4. Edge cases: unmount mid-timer, pause and resume, a manual override, and background tabs where browsers throttle timers; if accuracy matters, compute remaining time from timestamps.
  5. Render three elements with an active class and give the current state a text label so it is not conveyed by colour alone.

Follow-up

  • How would you add a pedestrian button that shortens the current green phase?
  • How would you test the transitions without waiting in real time (fake timers)?
  • What goes wrong with setInterval plus a state variable captured in the callback?

How do you modify a running cloud instance on Azure or GCP without incurring system downtime?

Medium · Databases, Cloud & System Architecture

Approach

  1. Avoid mutating a lone instance: run it behind a load balancer in a managed group (Azure Virtual Machine Scale Sets, GCP managed instance groups) and roll out a new image or template instance by instance, with health checks and surge capacity.
  2. Know the platform limit: resizing a running VM restarts it on Azure, and on GCP the instance must be stopped to change its machine type, so scale out first, drain the old node, then change it.
  3. For apps and containers: Azure App Service deployment slots with a swap, or a Kubernetes rolling update with readiness probes and maxUnavailable set to 0; blue-green or canary when fast rollback matters.
  4. Drain gracefully: handle SIGTERM, stop accepting new requests, finish in-flight ones, close database pools cleanly, and keep session state outside the instance (for example Redis) so users are not logged out.
  5. Database changes use expand-then-contract migrations so the old and new versions can run against the same schema during the rollout.

Follow-up

  • How do you roll back automatically if the new version fails its health checks?
  • What changes if the application relies on sticky sessions?
  • How would you rename a column without breaking the version still serving traffic?

Explain the key differences between UPDATE and PUT HTTP methods in RESTful API design.

Medium · Databases, Cloud & System Architecture

Approach

  1. Correct the premise first: HTTP has no UPDATE method. The standard methods include GET, POST, PUT, PATCH and DELETE, so the usual comparison is PUT versus PATCH, or SQL UPDATE versus HTTP PUT; say which one you are answering.
  2. PUT replaces the full representation of a resource at a URI the client knows; it is idempotent, so repeating it leaves the same state; it can create (201) or replace (200 or 204). Fields missing from a PUT body are treated as cleared or defaulted.
  3. PATCH applies a partial change, for example JSON Merge Patch (RFC 7396) or JSON Patch (RFC 6902), and is not guaranteed to be idempotent; POST creates under a collection with a server-assigned id and is not idempotent.
  4. Server side, a PUT handler usually maps to an UPDATE of every column (or an upsert); guard concurrent edits with an ETag and If-Match, returning 412 Precondition Failed on a mismatch.

Follow-up

  • Is PATCH ever idempotent? Give an example where it is not.
  • How would you make a POST that creates a payment safe to retry?
  • What status code do you return when a PUT creates a resource rather than replacing one?

What security measures do you implement to protect microservices against DDoS, CORS, and CSRF attacks?

Medium · Databases, Cloud & System Architecture

Approach

  1. Separate the three threats: DDoS attacks availability; CORS is a browser rule that relaxes the same-origin policy and is not a protection on its own; CSRF tricks a logged-in browser into sending authenticated requests using its cookies.
  2. DDoS: edge protection (Azure DDoS Protection, Google Cloud Armor, a CDN or WAF), rate limiting per client or API key at the gateway (token bucket), request size limits and timeouts, autoscaling with an upper bound.
  3. CORS: an explicit origin allowlist; never reflect any Origin while sending Access-Control-Allow-Credentials: true (browsers reject the wildcard with credentials); restrict methods and headers; remember CORS does not stop server-to-server or curl calls.
  4. CSRF: for cookie-based sessions use SameSite=Lax or Strict, synchronizer or double-submit tokens (Spring Security's CSRF filter is on by default) and Origin checks; APIs that authenticate with a bearer token in the Authorization header are not exposed to classic CSRF, which is the only good reason to disable it.
  5. Between services: mTLS or signed tokens validated by each service, and least-privilege credentials.

Follow-up

  • Why is it acceptable to disable CSRF protection for a stateless JWT API but not for a session-cookie app?
  • How would you enforce a rate limit consistently across several instances of a service?
  • Does a strict CORS policy protect the API from a scripted attacker? Why or why not?

Define WebSockets in the context of your past project and contrast them with traditional HTTP polling mechanis

Medium · Databases, Cloud & System Architecture

Define WebSockets in the context of your past project and contrast them with traditional HTTP polling mechanisms.

Approach

  1. Define it: a WebSocket starts as an HTTP/1.1 request with Upgrade: websocket, the server answers 101 Switching Protocols, and the TCP connection becomes a persistent full-duplex channel where either side can send frames at any time.
  2. Contrast polling: short polling repeats requests on an interval (latency up to the interval, many empty responses, header overhead); long polling holds each request open until data arrives or a timeout, then the client reissues it.
  3. Tie it to your project in the first person: what data was pushed (for example live status or notifications), why polling was not good enough, and the numbers you actually measured, if any.
  4. Operational costs: connections are stateful, so scaling across instances needs sticky routing or a pub/sub backplane (such as Redis); add heartbeats (ping/pong), reconnection with backoff, resync of missed messages, and authentication at the handshake.
  5. Alternatives: Server-Sent Events for one-way server push over plain HTTP with built-in reconnect; STOMP over WebSocket in Spring and SignalR in .NET as higher-level options.

Follow-up

  • A message must reach a client connected to a different server instance: how do you deliver it?
  • How does your client recover messages it missed while disconnected?
  • When would you choose Server-Sent Events over WebSockets?

Write a program using Java Streams API to filter, map, and collect data from a collection of complex objects.

Medium · Problem Solving & Coding Challenges

Approach

  1. Describe the pipeline: a source (list.stream()), lazy intermediate operations (filter, map, flatMap, distinct, sorted) and a terminal operation (collect, reduce, count) that triggers execution; for example employees.stream().filter(e -> e.getSalary() > limit).map(Employee::getName).collect(Collectors.toList()).
  2. Show collectors: groupingBy(Employee::getDepartment, Collectors.counting()), groupingBy with averagingDouble, partitioningBy, joining(", "), and toMap with a merge function, since toMap without one throws IllegalStateException on a duplicate key.
  3. Handle results carefully: max(Comparator.comparing(Employee::getSalary)) returns an Optional; for money use BigDecimal with map(...).reduce(BigDecimal.ZERO, BigDecimal::add).
  4. Use flatMap for nested collections (orders to line items) and keep lambdas free of side effects.
  5. Pitfalls: a stream can be consumed only once; Stream.toList() (Java 16+) returns an unmodifiable list; parallel streams pay off only for large CPU-bound work with no shared mutable state.

Follow-up

  • Return the top three earners in each department.
  • What is the difference between map and flatMap? Give a case where you need flatMap.
  • What happens if you build a stream pipeline with no terminal operation?

Every query on one table stalls for forty seconds mid-deploy

Medium · lock contention · ddl · migrations

During a release on PostgreSQL, every query touching resource times out for about 40 seconds and then recovers with no intervention. The release ran one migration, ALTER TABLE resource ADD COLUMN archived_reason TEXT, and the migration log shows it completing in 6 ms. Unrelated tables showed no change in error rate. Explain how a 6 ms statement caused a 40-second stall, give the ordered checks you would run on a live system to confirm it, and give the migration procedure that prevents a repeat.

Approach

  1. Separate the statement's duration from the lock's duration. ADD COLUMN with no default is a catalogue-only change and genuinely runs in milliseconds, but it requires ACCESS EXCLUSIVE, and it cannot acquire that until every transaction already touching the table has finished.
  2. Account for the queueing, which is the part that surprises people. A lock request that is waiting blocks later requests for conflicting modes behind it rather than letting them overtake, so one long-open transaction holds the DDL and the DDL holds all the traffic. The stall length is set by the longest open transaction, not by the size of the change.
  3. Confirm on a live system in this order: pg_stat_activity for that table ordered by xact_start, looking for the oldest transaction and specifically for state = idle in transaction; then pg_locks where granted = false to find the waiter; then join them on pid to name blocker and blocked. pg_blocking_pids() does that join for you and is the fastest single call.
  4. Prevent rather than merely time it better. Set lock_timeout to a second or two on the migration session so the DDL abandons the queue after a bounded wait and is retried, instead of holding it for as long as the oldest transaction lives. Be exact about what that buys: queries arriving during the wait still queue behind the pending ACCESS EXCLUSIVE request, so each attempt costs them up to one lock_timeout of added latency. The outage goes from 40 seconds to about one second per attempt, not to zero. Also run migrations away from deploy-time peaks, and put a statement timeout and an idle-in-transaction timeout on the analytics role that opens the long transactions.

Follow-up

  • The same release also wants NOT NULL on that column. What is the sequence that gets there without a long lock?
  • Your lock_timeout retry fails ten times in a row because the analytics transaction is always open. What do you change?

Suggested practice checklist

The plan follows the reported question groups: OOP fundamentals, collections and runtime internals, coding problems, backend frameworks, frontend, SQL and cloud, then the HR round. Each day ends with something you can show: code, a diagram or a spoken answer.

Day 1 — Map the loop and write the OOP examples

  • Write one page mapping the three reported rounds, marking whether you expect the campus route or the lateral route, and note which round you feel least ready for
  • Write a small Java or C# example with an Account class that hides its balance behind validated methods (encapsulation) and a PaymentProcessor interface with two implementations (abstraction), and explain the difference in two sentences
  • Write an overloading example resolved at compile time and an overriding example called through a parent-type reference, and say what the compiler checks in each
  • Write the interface versus abstract class decision rules: shared state, constructors, default methods, and multiple inheritance of type

Deliverable: A one-page route map plus three runnable OOP examples (encapsulation versus abstraction, overloading versus overriding, interface versus abstract class), each with a spoken two-sentence answer.

Day 2 — Collections and runtime internals

  • Draw the HashMap structure: hash, bucket index, chained collisions, load-factor resize and treeified chains, and note that HashSet stores its elements as keys of a HashMap
  • Write a key class with a poor hashCode and one that breaks the equals and hashCode contract, then show what happens to lookups
  • Write code that modifies an ArrayList while iterating to trigger the fail-fast exception, then iterate a CopyOnWriteArrayList or ConcurrentHashMap through the same change and note the behaviour
  • Write a one-page summary of .NET memory management: stack versus heap, generations 0, 1 and 2, the large object heap, and Dispose versus finalizers

Deliverable: A HashMap diagram, two runnable demos (broken hashCode and fail-fast iteration) and a one-page .NET garbage collection summary.

Day 3 — Coding problems for the assessment and live rounds

  • Solve the palindrome check with two pointers and no reverse function, skipping non-alphanumeric characters if asked, and state O(n) time and O(1) space
  • Write Fibonacci iteratively, recursively and with memoisation, and explain why the plain recursive version is exponential
  • Print a right triangle, a pyramid and a diamond using nested loops, deriving spaces and stars from the row index
  • Find duplicates with a HashSet and rearrange an array with two pointers, then write a Java Streams pipeline that filters, maps and groups a list of transaction objects

Deliverable: Five working solutions in your language, each with a stated time and space complexity and at least three test inputs including an empty or minimal case.

Day 4 — Backend frameworks: Spring Boot, .NET Core and LINQ

  • Generate a Spring Boot project, choose the dependencies yourself (web, data access, validation), and write a controller, service, repository and one test for a small resource
  • Write a side-by-side table of dependency injection lifecycles: Spring singleton, prototype, request and session scopes against .NET singleton, scoped and transient, and explain the problem of a long-lived service holding a short-lived one
  • Write LINQ queries using FirstOrDefault and SingleOrDefault against a database context, read the SQL each generates, and note the exception SingleOrDefault throws on multiple matches
  • Show IEnumerable pulling rows into memory before filtering and IQueryable translating the filter into SQL, and say where AsEnumerable changes the answer

Deliverable: A running REST service with a test, a Spring versus .NET lifecycle table, and a LINQ note showing the generated SQL for each of the two comparisons.

Day 5 — Frontend: React, Angular and the traffic signal

  • Build the traffic signal component in React with state, an effect that starts a timer and cleans it up on unmount, and then again in vanilla JavaScript with setTimeout
  • Write a small shared cart state with the Context API and again with Redux, and note what re-renders in each and how asynchronous work enters Redux through middleware
  • Write a demo where measuring a DOM node in useLayoutEffect avoids a visible flicker that useEffect shows, and write an error boundary class and list what it does not catch
  • Write a one-page comparison of an Angular component (decorator, template, injected services) and a React function component with hooks

Deliverable: A working traffic signal in two forms, a Context versus Redux example, an effect-timing demo with an error boundary, and an Angular versus React comparison page.

Day 6

  • Take a slow query that joins several ledger-style tables, read its execution plan, add a composite index, rewrite the query if needed and compare plans
  • Write a zero-downtime update answer for a container on Azure or GCP: rolling or blue-green rollout, health checks, connection draining and a backward-compatible schema change
  • Write an answer on PUT versus PATCH and idempotence, noting that UPDATE is a SQL verb rather than an HTTP method
  • Write the protections against DDoS, CORS misconfiguration and CSRF for a microservice, then a project-based answer comparing WebSockets with HTTP polling

Deliverable: A before-and-after execution plan for one query, a written zero-downtime rollout checklist, a REST method comparison and a one-page security and WebSocket answer.

Day 7 — HR round and full mock

  • Write your answers on salary expectations and notice period, and make a checklist of education and employment documents
  • Run a mock on a shared screen: explain one resume project's architecture, then solve one coding problem and one SQL problem while talking
  • Write the two questions you will ask the interviewer about team structure and client work

Deliverable: Three written STAR stories, a salary and notice-period answer with a document checklist, a recording or notes from one shared-screen mock, and your two closing questions.

Project walkthroughs and the HR round

Candidates report that the Final HR Round covers cultural fit, communication and career aspirations, and that resume projects and team scenarios come up in HR and managerial conversations. The preparation advice candidates give is the STAR structure. For this role, that means each story should name your own contribution to a project, the technical choice you made, and a result you can state, and should show you explaining that choice clearly to a non-engineer such as a client contact.

  1. Walk me through a project on your resume: your exact contribution, the architecture, the tools you used and one problem you solved.
  2. Tell me about a time you explained a technical decision to someone who was not an engineer, and what you changed when they did not follow.
  3. Tell me about a time a requirement changed late in a project and how you adapted your plan and your code.
  4. Describe a disagreement with a teammate over a design or a code review and how it was resolved.
  5. Where do you want your career to go over the next few years, and how does this role fit?
  6. What are your salary expectations and notice period?

Unblock an engineer without taking the keyboard

Easy · mentoring · leases · at-least-once

A teammate has spent two days on a job handler that occasionally writes duplicate rows. They are certain the queue is delivering twice by mistake. You suspect a lease expiring under a slow handler, so the job is running concurrently with itself. Describe how you have unblocked someone in this position: what you asked before offering a hypothesis, what you showed them rather than told them, and what you left them owning. Then say what you would do if their theory turned out to be the right one.

Approach

  1. Ask before diagnosing, and ask for things answerable from data they already have: the attempt count on the job rows that produced duplicates, the handler's observed duration against its lease expiry, and whether the duplicate rows share a natural key that a unique constraint could have caught.
  2. Teach the shape rather than the answer. A lease cannot distinguish a dead worker from a slow one, so a handler that outruns its lease is running twice by design, and deploys deliver the other half by killing handlers mid-run on every rollout. Both of their candidate theories produce identical duplicate rows, which is why the evidence has to come from timings rather than from argument.
  3. Hand over a checklist they execute: a natural key on every write the handler performs so the second copy collides rather than appends, the record of intent written before any external effect, a lease heartbeat while running, and the metric that shows it working.
  4. Keep ownership with them deliberately. Pair on the first write, then step back; if you finish it yourself you have closed one ticket and left the same person stuck on the next redelivery.

Follow-up

  • How would you distinguish a genuine double-delivery from a lease expiry using only the data already stored?
  • Their handler calls an external endpoint before recording that it did. What do you tell them to change first?

Argue against a design, lose, and commit anyway

Medium · disagreement · service boundaries · decision records

Describe a design you argued against and lost. State the failure you predicted as a named mechanism, not a feeling about complexity: two services that would need one transaction, a projection with no rebuild path, a write path with no idempotency key. Say what evidence you brought, what the decision maker weighed instead, and what you did after the decision was made: what you instrumented, what you wrote down, and whether the prediction came true. Five minutes.

Approach

  1. State the prediction in falsifiable form up front: the mechanism, the condition that triggers it, and the observable outcome. A prediction that cannot be checked also cannot be credited to you later.
  2. Show the evidence you had at the time and label each piece honestly as measured, analogous, or intuition. Keeping the intuition is fine; disguising it as data is the thing that erodes your standing in the next argument.
  3. Represent the opposing case at full strength, including the constraint you did not control: a fixed date, a team boundary, or the fact that the decision was cheap to reverse and yours was not.
  4. Make disagree-and-commit concrete. Name the artefact you left behind so the prediction could be settled without you: the alert and its threshold, the counter on the dashboard, the decision note that recorded the trade-off and the condition that would revisit it.

Follow-up

  • What threshold on that alert would have proved you right, and did anyone ever look at it?
  • If the same proposal arrived tomorrow with the same deadline, would you argue it the same way?

Turn a code review disagreement into a decision

Easy · code review · optimistic concurrency · communication

A colleague's change updates a row with UPDATE resource SET version = version + 1 WHERE resource_id = $1 AND version = $2 and treats an affected-row count of zero as a successful no-op. You read that as a silently lost update; they think returning 200 is friendlier to clients than returning a conflict. Describe how you have handled a review disagreement of this shape: what goes in the comment, when you leave the thread, and who decides. Then write the comment you would leave here, in under 80 words.

Approach

  1. Sort the disagreement before writing anything. A silently discarded write is a correctness claim about data; the choice between 409 and 412 is taste. Only the first justifies blocking a merge, and saying which one you are doing is most of the value of the comment.
  2. Make the claim reproducible in the comment itself with an interleaving rather than a principle: A reads version 7, B reads version 7, B commits version 8, A's predicate matches zero rows, A is told it succeeded and A's edit is gone.
  3. Offer the alternative with its cost attached: return 409 carrying the current version and the revision that won, so the client can re-read and re-apply. Note that automatic retry is not the fix, because a retry re-reads the winner's state and reapplies an intent formed against data that no longer exists.
  4. Apply an escalation rule you can state: two round trips on the thread, then a call, and the service's owner decides rather than the reviewer. A reviewer who cannot be overruled is a bottleneck with extra steps.

Follow-up

  • Where would you put the test that fails if someone reintroduces the swallowed zero rowcount?
  • The author says clients cannot handle a 409. How do you check whether that is true?