
Real Interview Questions for the Software Engineer at Elm
NewPractice MCQs
Answers count toward the Software Engineer and overall leaderboards; your latest answer to each question is the one that counts.
MCQ-1A payment service replicates ledger entries between two data centers over a WAN link carrying thousands of entries per second. Entries must arrive exactly once and in order, a lost entry corrupts balances, and a 50 ms connection setup cost is acceptable. Which transport should it use for this replication stream?
Answer to see the discussion.
MCQ-2A Java service has `volatile int processed` incremented by four worker threads with `processed++`, and the total intermittently undercounts under load. The team wants the count to be exact without changing the field type. What change fixes it?
Answer to see the discussion.
MCQ-3A Java model has `Bird` with `fly()`, clients call `fly()` through `Bird` references, and an injured `Sparrow` must be treated as flightless without changing its class. A new `Penguin extends Bird` must never fly. Which change models flying as a capability only flying birds have?
Answer to see the discussion.
MCQ-4A Spring `@Transactional` checkout method submits two inventory writes to an `ExecutorService` and waits for them before returning. The main thread later throws an exception, and the team expects the inventory writes to roll back with the checkout. What is the transaction outcome for the worker-thread writes?
Answer to see the discussion.
MCQ-5A Spring Boot 3 app defines `PricingEngine` with a `@PostConstruct` method that validates `taxRate` and fails if it is zero. A `BeanPostProcessor` must set `taxRate` to 20 before that validation runs, without changing `PricingEngine` itself. Where should the processor set the property?
Answer to see the discussion.
MCQ-6A Spring Boot service holds a repository in a final field, exposes no setter, needs one shared instance, and the team wants to instantiate it in a plain unit test without starting Spring. Which injection type should be used for that repository?
Answer to see the discussion.
MCQ-7A multi-tenant service writes 12000 transactions per second to a single Postgres primary, while reads are only 20 percent of traffic. Adding read replicas and API nodes leaves write latency queueing, with primary CPU at 97 percent. Cross-tenant transactions are not required. What is the first scaling change to make?
Answer to see the discussion.
MCQ-8A Postgres orders table holds 2 million rows and a lookup by `customer_id` takes 900 ms. `EXPLAIN ANALYZE` shows a sequential scan filtering on `customer_id` with no index, while the buffer cache is already warm. Which change addresses the bottleneck shown?
Answer to see the discussion.
MCQ-9An order service and an inventory service each own their database, and checkout must never confirm an order without reserving stock. The services must remain available during a network partition between them, so checkout cannot block waiting for both. Which consistency strategy fits this checkout flow?
Answer to see the discussion.
MCQ-10A billing service must be fixed before Friday, but its retry endpoint has no documentation and the code suggests it may charge twice on duplicate requests. Production logs are unavailable, and a staging copy with test cards is available. What should you do first to validate the duplicate-charge assumption?
Answer to see the discussion.
MCQ-11A service keeps 5 million active sessions keyed by a string token ID, with frequent inserts and deletes, point lookups by ID, and no range queries or ordered iteration. Which structure should it use for the session store?
Answer to see the discussion.
MCQ-12A Spring Boot service handles concurrent withdrawals with `if (balance >= amount) { setBalance(balance - amount); save(); }` inside a `@Transactional` method. Two requests for 80 against a balance of 100 both pass the check and the account ends overdrawn. Which change prevents both withdrawals succeeding?
Answer to see the discussion.
MCQ-13A Spring Boot 3 app has a singleton `OrderController` injecting a `ReportGenerator` that holds state for a single HTTP request, with many users calling it concurrently. The team needs a fresh generator per request and no sharing between requests. Which scope should `ReportGenerator` use?
Answer to see the discussion.
MCQ-14An Elm Software Engineer candidate's background includes a single-region batch reconciler, an eventually consistent distributed cache, dashboards for system health, rollout coordination, and a multi-region reconciler guaranteeing exactly-once settlement. The role requires multi-region systems that stay correct under network partitions. Which prior experience best prepares the candidate for this role?
Answer to see the discussion.
MCQ-15A candidate with three years building Arabic-language public-service platforms in Riyadh is choosing which Elm team to join, and Elm's work centres on large digital government and enterprise services. The panel asks why Elm specifically. Which team choice best fits this candidate's background and the role?
Answer to see the discussion.
Curated: · Written: · Reviewed: