Skip to content
Tech Interview Prep

Real Interview Questions for the Software Engineer at Constellation Software

New

Interview Q&A

20 questions · Flow follows Relevance until this set has a learning order.

Q&A-1Write a function to reverse a linked list?

Reported in Constellation Software Software Engineer interview ...

Assume a singly linked list, acyclic, and that in-place reversal is acceptable. I would say that up front, then give the iterative version as the default. It runs in O(n) time and O(1) extra space, and it does not depend on call stack depth.

Python
# Python 3.11
from __future__ import annotations

class Node:
    def __init__(self, value: int, next: Node | None = None):
        self.value = value
        self.next = next

def reverse(head: Node | None) -> Node | None:
    prev = None
    curr = head
    while curr is not None:
        nxt = curr.next   # save before overwriting
        curr.next = prev
        prev = curr
        curr = nxt
    return prev

The invariant is that prev is the head of the already reversed prefix and curr is the head of the untouched suffix. Each iteration moves one node from the suffix to the prefix by flipping one pointer. When curr becomes None, prev points at the old tail, which is the new head. An empty list returns None and a single node returns itself, with no special cases in the loop.

Worked trace for 1 -> 2 -> 3 -> None:

Stepcurr beforecurr.next afterprev aftercurr after
011None1
11None12
22123
3323None

Result: 3 -> 2 -> 1 -> None. The step that most candidates fumble is saving nxt first. Overwrite curr.next before saving it and the rest of the list is lost.

The recursive form is shorter and worth mentioning, because interviewers often ask for it next:

Python
def reverse_recursive(head: Node | None) -> Node | None:
    if head is None or head.next is None:
        return head
    new_head = reverse_recursive(head.next)
    head.next.next = head
    head.next = None
    return new_head
IterativeRecursive
TimeO(n)O(n)
Extra spaceO(1)O(n) call stack
Main failure modeCycle loops foreverStack overflow on long lists
ReadabilityNeeds the invariant statedMirrors the structure of the list

In CPython the default recursion limit is 1,000 frames, so a list of 10,000 nodes that the iterative version handles easily will raise RecursionError in the recursive one. In C the equivalent failure is a stack overflow and a crash rather than an exception. That is why I would ship the iterative version and only offer recursion if the interviewer asks for it.

Two failure modes to name before being asked. First, a cycle. If the list loops back on itself, curr never reaches None and the loop never ends. I would state the acyclic assumption rather than silently adding Floyd cycle detection, because detection changes the contract and costs either O(n) extra space for a visited set or a second pass. Second, shared mutation. If another thread or a cached iterator still holds the old head, reversing in place changes the list under it. In production code I would either copy the nodes, document that the input is consumed, or take the lock that guards the list. Returning a new list of new nodes is the safer choice when the caller needs the original preserved, at the cost of O(n) allocation.

If the list were doubly linked, the same idea applies but each node also flips its prev pointer, and the head becomes the old tail. The interview answer stays the same: state the assumptions, give the O(1) space version, and show you know where it breaks.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-2How would you find the longest substring without repeating characters in a string?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I would use a sliding window with a map from each character to its last index. Keep start at the left edge of the current window, which always contains distinct characters. When the character at i was last seen at or after start, move start to just after that previous occurrence. Otherwise the window extends by one. Track the longest window seen. That scans the string once, so time is O(n) and extra space is O(min(n, alphabet size)).

Python
def longest_unique_substring(s: str) -> str:
    last: dict[str, int] = {}
    start = 0
    best_start = 0
    best_len = 0

    for i, ch in enumerate(s):
        if ch in last and last[ch] >= start:
            start = last[ch] + 1
        last[ch] = i
        if i - start + 1 > best_len:
            best_len = i - start + 1
            best_start = start

    return s[best_start:best_start + best_len]

Checked against Python 3.12. s is a sequence of Unicode code points there, so the map key is a full character. In Java, a char based version would split surrogate pairs, so I would iterate code points with codePointAt and advance by Character.charCount if the input can contain characters outside the BMP.

Worked trace

For s = "abca":

ichlast[ch] before updatestart after stepwindowbest
0anone0aa
1bnone0abab
2cnone0abcabc
3a01bcaabc

At i = 3, the earlier a sits inside the window, so start jumps to 1 instead of restarting the scan. The window bca has length 3, which does not beat the stored best, so the answer stays abc.

Why the alternatives lose

ApproachTimeSpaceProblem
Brute force: check every substringO(n^2) or worseO(n)For n = 1,000,000 that is on the order of 10^12 character checks
Sliding window with a set, shrink one by oneO(n)O(window)Correct, but the map of last index moves start directly and avoids repeated shrink steps
Sliding window with last-index mapO(n)O(min(n, alphabet))The version above

The set version is what I would write if the interviewer asked for the window contents explicitly. The last-index map is shorter and makes the jump obvious in code review.

Edge cases I would name before coding

Empty string returns "" with best_len = 0, and the slice handles it. A string of one repeated character, such as "bb", returns "b" because the second b moves start to 1 and the window length stays 1. Ties, such as "ab" versus "ba" in different inputs, return the first longest window because the update uses strict >. If the caller only needs the length, I drop the slice and return best_len, which also avoids copying a potentially large substring.

A common bug is updating last[ch] before checking it, or comparing last[ch] >= start against the wrong variable after start has moved. Another is resetting the whole map when a repeat appears, which discards valid characters after the repeat and can miss the optimum. The trace above catches both, since the jump to start = 1 keeps b and c in play.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-3Explain how you would implement a binary search algorithm?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I would assume a sorted array with random access, then keep a shrinking interval [lo, hi] that is guaranteed to contain the target if it exists at all. Each step I probe the midpoint, discard the half that cannot contain the target, and repeat until the interval is empty. That gives O(log n) comparisons and O(1) extra space with an iterative loop.

Python
# Python 3.12, checked against CPython
def binary_search(a: list[int], target: int) -> int:
    lo, hi = 0, len(a) - 1  # inclusive bounds
    while lo <= hi:
        mid = lo + (hi - lo) // 2  # avoids overflow in fixed-width languages
        if a[mid] == target:
            return mid
        if a[mid] < target:
            lo = mid + 1
        else:
            hi = mid - 1
    return -1  # not present; hi is the insertion point

The invariant is the whole design: at the top of every iteration, if target is in a, it lies between lo and hi inclusive. Probing mid lets me throw away one half safely, because sorted order tells me everything left of mid is smaller and everything right of it is larger. When lo > hi the interval is empty, so the target cannot be present.

Worked trace

Searching for 17 in [2, 5, 8, 11, 14, 17, 20, 23]:

Steplohimida[mid]Decision
10731111 < 17, discard left half, lo = 4
247517found, return 5

For a miss, say 16, the same trace continues: step 2 gives a[5] = 17 > 16, so hi = 4, then lo = 4, hi = 4, mid = 4, a[4] = 14 < 16, so lo = 5. Now lo > hi and I return -1. The final hi + 1 = 5 is where 16 would be inserted to keep the array sorted, which is why libraries expose that value instead of just -1.

Where it breaks, and what I would check

Unsorted input is the silent failure. Binary search will return -1 for a value that is present, with no error. In production code that reads from a database index or a sorted file, I would not trust the caller. I would assert sortedness in tests with a property test against a linear scan over random arrays, including duplicates and empty arrays, and I would check the sortedness invariant at ingestion time rather than on every search.

Duplicates change the contract. The code above returns some index holding the target, not the first or last. If a caller needs the leftmost occurrence, for example the earliest record for a customer ID in a sorted log, I need a lower-bound variant that keeps searching left when a[mid] == target and records the candidate. That is a different function, and I would say so explicitly instead of letting the caller assume.

Two implementation traps come up in interviews and in C or Java codebases. First, (lo + hi) // 2 overflows when lo + hi exceeds the maximum integer, which matters for arrays near 2^31 elements. Writing lo + (hi - lo) // 2 avoids it. Second, recursion looks cleaner but adds a call per level and risks stack depth on very large inputs, with no benefit here. I would use the iterative form.

When I would not use it

Binary search needs random access. On a linked list each probe costs O(n) to reach, so the total is O(n) and a linear scan wins. If the data is sorted but uniformly distributed, interpolation search probes by estimated position and averages O(log log n), but it degrades badly on skewed data, so I would only reach for it with measured distributions. If the array is unbounded, such as the first occurrence in a growing stream, exponential search (probe at 1, 2, 4, 8, ...) brackets the answer in O(log n) probes before binary search takes over. In practice, for a sorted list in Python I would call bisect.bisect_left rather than hand-roll this, and keep the hand-rolled version for languages or storage engines where I control the index structure.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-4Can you demonstrate how to use a hash table for efficient data retrieval?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

A hash table maps a key to a bucket with a hash function, then stores the entry there. Lookup hashes the key, jumps straight to that bucket, and checks the few entries inside it. Average time is O(1) for get, put and delete, independent of how many entries the table holds. A list scan is O(n). That gap is the whole point.

I would show it with a small Python implementation using chaining, where each bucket holds a list of entries that collided there.

Python
# Python 3.11, checked against CPython dict semantics
class HashTable:
    def __init__(self, capacity=16):
        self.capacity = capacity
        self.buckets = [[] for _ in range(capacity)]
        self.size = 0

    def _index(self, key):
        return hash(key) % self.capacity

    def put(self, key, value):
        bucket = self.buckets[self._index(key)]
        for i, (k, _) in enumerate(bucket):
            if k == key:
                bucket[i] = (key, value)
                return
        bucket.append((key, value))
        self.size += 1
        if self.size / self.capacity > 0.75:  # load factor
            self._resize()

    def get(self, key, default=None):
        for k, v in self.buckets[self._index(key)]:
            if k == key:
                return v
        return default

    def _resize(self):
        old = self.buckets
        self.capacity *= 2
        self.buckets = [[] for _ in range(self.capacity)]
        self.size = 0
        for bucket in old:
            for k, v in bucket:
                self.put(k, v)

In production I would usually reach for the built-in instead. Python dict, Java HashMap and Go map are the same idea with better-tuned resizing and probing. Writing one by hand is how you prove you understand collisions and growth, not what you ship.

Worked trace

Capacity 8, so index is hash(key) % 8. Using simple integer keys where hash(k) == k for clarity:

StepOperationIndexBucket contents after
------------
1put(3, "a")3[3:a]
2put(11, "b")3[3:a, 11:b] collision
3put(5, "c")5[5:c]
4get(11)3checks 3, then 11, returns "b"
5get(7)7bucket empty, returns None

Step 2 is the case people forget. Two keys land in one bucket, so lookup walks that short chain instead of the whole table. With a load factor near 0.75 and a decent hash, chains stay at length 1 or 2.

The arithmetic that justifies it

Say a service holds 50,000 customer records in memory and does 20,000 lookups per second. A list scan averages 25,000 comparisons per lookup. That is 500 million comparisons per second, and it grows with every record added. A hash table does about 1 to 2 comparisons per lookup at load factor 0.75, so roughly 40,000 comparisons per second. Same hardware, same data, four orders of magnitude apart. That is why a cache keyed by customer id, or an index from order id to order, is a hash table and not a list you filter.

Where it breaks

Worst case is O(n) when every key hashes to the same bucket. That happens with a bad hash function, or deliberately, in a hash flooding attack where an attacker sends keys crafted to collide. Python and Java mitigate this by randomising string hashing per process and, in newer Java versions, treeifying long chains. You still avoid exposing raw hash behaviour to untrusted input where you can.

Two other failure modes come up in interviews and in code. First, mutable keys. If you change a field that feeds the hash after inserting the object, the entry sits in the wrong bucket and get misses it. Use immutable keys, strings, tuples, frozen dataclasses. Second, forgetting to resize. Without the load factor check, chains grow without bound and average time slides toward O(n) while memory looks fine. The resize in the code above costs O(n) once, but doubling keeps it amortised O(1) per insert.

If I needed ordered iteration or range queries, I would not use a hash table at all. I would use a sorted structure like a B-tree or sortedcontainers in Python, and pay O(log n) per lookup for the ordering. Hash tables win when the access pattern is exact key lookup, which is the common case for caches, session stores and id lookups in the systems I have worked on.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-5What is your experience with ASP.NET web development?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I have built and maintained ASP.NET services for about six years. Most of my production work is ASP.NET Core on .NET 8, with controllers, EF Core and SQL Server behind a small internal product. I have also inherited and kept running older .NET Framework 4.8 MVC and Web Forms applications. In a portfolio of long lived vertical products, the job is often to keep a system customers depend on for a decade, make a safe change, and leave a clear upgrade path. I am comfortable in both worlds, and I do not rewrite a working Web Forms app just because a newer stack exists.

A typical Core endpoint I would write today:

CSHARP
// Program.cs, .NET 8
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<AppDbContext>(o =>
    o.UseSqlServer(builder.Configuration.GetConnectionString("App")));
var app = builder.Build();
app.UseMiddleware<ExceptionHandlingMiddleware>();
app.MapControllers();
app.Run();

[ApiController]
[Route("api/orders")]
public sealed class OrdersController(AppDbContext db) : ControllerBase
{
    [HttpGet]
    public async Task<IActionResult> List([FromQuery] int page = 1,
        [FromQuery] int pageSize = 50, CancellationToken ct = default)
    {
        pageSize = Math.Clamp(pageSize, 1, 200);
        var rows = await db.Orders.AsNoTracking()
            .OrderBy(o => o.Id)
            .Skip((page - 1) * pageSize).Take(pageSize)
            .Select(o => new { o.Id, o.CustomerId, o.Total })
            .ToListAsync(ct);
        return Ok(rows);
    }
}

The details that matter are in the pipeline and the data access, not the controller syntax. Async all the way through, AsNoTracking for reads, a hard cap on page size, and middleware that turns exceptions into a consistent problem response instead of a stack trace.

StackWhere I have used itMain cost to watch
Web Forms (.NET Framework)Inherited admin and reporting screensViewState bloat, postback model, session locking
MVC 5 (.NET Framework)Customer portal I maintained for three yearsManual dependency injection, older request pipeline, framework upgrade ceiling
ASP.NET Core (.NET 8)New APIs and one MVC rewriteHosting and deployment changes, EF Core behaviour differences

Failure modes I have actually hit

Web Forms taught me to look for ViewState. One inherited grid page carried 380 KB of ViewState per postback because a large DataTable was stored in it. Page load was fine on a LAN and fell apart over a VPN. Moving that state to the server and paging the grid brought the payload under 20 KB.

Session state is the second trap. In Framework MVC, Session locks the request thread for the whole request, so concurrent AJAX calls from the same user queue behind each other. I saw p95 latency jump from 90 ms to over 900 ms with only 12 concurrent calls per user. The fix was to keep session use to authentication only and store workflow state in the database.

On Core, the common failure is sync over async. Calling .Result on an EF query, or a sync SQL client inside a request, blocks a thread for the duration of the call. Under load those blocked threads accumulate, requests queue, and latency climbs even though the database looks healthy. I check for that by searching the codebase for .Result, .Wait() and GetAwaiter().GetResult() before any performance work, and by watching thread pool queue length in metrics.

Trade-offs I would defend

I prefer controllers over minimal APIs when the surface has filters, versioning or many endpoints, because conventions and testability are clearer for a small team that will maintain the code after I leave. I use minimal APIs for a small internal service with fewer than ten endpoints. For data access I use EF Core for CRUD and reporting queries, and raw ADO.NET or Dapper for the one or two queries where EF generates a plan I cannot accept. I would not move a stable Web Forms module to Core in the same release as a feature change. I would first add tests around the behaviour, extract the business logic out of code-behind, then migrate screen by screen. That sequencing is slower on paper and much cheaper when a customer reports a wrong invoice total.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-6Can you explain the difference between REST and SOAP?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

REST and SOAP are not two versions of the same thing. SOAP is a protocol with a fixed envelope, a type system and tooling around it. REST is an architectural style that uses HTTP verbs and resources, with no mandated format. In practice, REST means JSON over HTTP with GET, POST, PATCH and DELETE mapped to resources. SOAP means an XML envelope posted to one endpoint, with the operation named inside the body.

I would pick REST for a new internal service at a company like Constellation, where dozens of acquired businesses keep their own stacks and need to integrate quickly. I would keep SOAP where a partner, bank or government system already requires it, because rewriting that contract buys nothing.

DimensionREST (as usually built)SOAP 1.2
AddressMany URLs, one per resource: /orders/{id}One endpoint, operation in body: POST /soap with <GetOrder>
FormatJSON by default, also XML, protobufXML only, with XSD types
ContractOpenAPI document, often hand writtenWSDL, generated stubs
HTTP semanticsStatus codes, caching, ETag, Idempotency-KeyUsually 200 for success and failure, errors in the envelope
SecurityTLS plus OAuth 2.0 or API keysWS-Security for message level signing and encryption
Tooling costLow, any HTTP client worksCode generation, brittle when the WSDL changes

Same operation, both ways

HTTP
# REST
GET /orders/42 HTTP/1.1
Host: api.example.com
Accept: application/json

# Response: 200, ETag: "v3", Cache-Control: max-age=60
{"id": 42, "customer_id": "c_8f21", "total_cents": 12900}
HTML / XML
<!-- SOAP 1.2 -->
<soap:Envelope xmlns:soap="http://www.w3.org/1999/xhtml" xmlns:ord="urn:orders">
  <soap:Body>
    <ord:GetOrder><ord:id>42</ord:id></ord:GetOrder>
  </soap:Body>
</soap:Envelope>

The REST call can be cached by a CDN or a proxy because GET is safe and the response carries cache headers. The SOAP call cannot, because the server sees an identical POST for a read and a write. That one difference drives a lot of the operational cost.

Yes No Yes No Yes No New integration Partner or regulator mandates SOAP or WS-Security? Implement SOAP, isolate it behind an adapter Need browser, mobile or public API access? REST with JSON and OpenAPI High volume internal call? REST or gRPC, avoid XML parsing cost

When SOAP still wins

SOAP earns its keep when the contract is formal and long lived. A payment processor or a tax authority publishes a WSDL and an XSD, and both sides validate against it for years. WS-Security also gives message level signatures that survive intermediaries, which TLS alone does not. If I am integrating with that system, I implement the SOAP client, put it behind a narrow internal interface, and do not let XML types leak into the domain model.

Failure modes I would name

REST fails quietly. Without a schema in CI, a field rename ships and breaks clients that parse JSON loosely. I pin an OpenAPI spec, run contract tests, and version by URL (/v2/orders) rather than by header negotiation that clients forget to send.

SOAP fails loudly and expensively. Generated stubs tie you to a WSDL revision, and a namespace change forces a rebuild across every consumer. I have seen a partner add one optional element and break deserialisation in three services. The fix is the same adapter: translate at the edge, keep the rest of the system on internal contracts.

For a new service I would default to REST, publish the OpenAPI spec, require idempotency keys on creates, and reserve SOAP for mandated external contracts. That keeps integration cheap inside the group and contained where the outside world dictates the terms.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-7Describe your approach to optimizing database queries?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I start from a measured bottleneck, not a hunch about indexes. Find the query that actually hurts, reproduce its plan in production-like data, change one thing, and re-measure. At Constellation that matters more than usual because the estate is many small products on different stacks. A fix has to be portable and cheap to maintain, not a vendor-specific trick that only works on one large database.

My order is: confirm the query is the problem, read the execution plan, fix the access pattern, then fix the schema. Most slow queries I have seen in interviews and in production fall into the first two steps.

Step 1: Prove it is this query.

I pull the slow query log or pg_stat_statements (Postgres) or Performance Schema (MySQL), sort by total time and by p99, not just count. A query run 100,000 times at 2 ms can cost more than one run at 2 s. I capture the exact parameters, because a plan for customer_id = 42 tells me nothing about customer_id = 999999.

SQL
-- Postgres, checked on 15.x
SELECT query, calls, mean_exec_time, rows
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;

Then I run EXPLAIN (ANALYZE, BUFFERS) on the worst offender with production parameters. I look for three things: a sequential scan on a large table, a nested loop that runs millions of times, and rows estimated far from rows returned. That last gap usually means stale statistics or a skewed column, and adding an index will not fix it.

Step 2: Fix the access pattern before the index.

Worked example, hypothetical figures labelled as such. A list endpoint for one business unit:

SQL
SELECT o.id, o.created_at, o.total_cents, c.name
FROM orders o
JOIN customers c ON c.id = o.customer_id
WHERE o.tenant_id = 17
ORDER BY o.created_at DESC
LIMIT 50;

Initial plan: Seq Scan on orders (1.2M rows, 340 ms), sort, then nested loop into customers. The tenant filter is selective but there is no index starting with tenant_id, so the planner cannot use it.

The fix is a composite index that matches the filter and the sort:

SQL
CREATE INDEX CONCURRENTLY idx_orders_tenant_created
  ON orders (tenant_id, created_at DESC, id)
  INCLUDE (total_cents, customer_id);

After: Index Scan using idx_orders_tenant_created, 50 rows returned, buffers drop from ~18,000 to ~12, p99 in this example from 340 ms to 6 ms. INCLUDE makes it covering for the columns the query needs, so it avoids a heap fetch per row. I would not add customer_id as a key column here because it is not filtered or sorted on.

CheckBeforeAfter
---------
---------
Scan typeSeq Scan on ordersIndex Scan, idx_orders_tenant_created
Rows examined1,200,00050
SortExplicit sort of filtered rowsOrdered by index, no sort node
Buffers (hypothetical)~18,000~12

Step 3: Look for the patterns indexes cannot save.

Three recur constantly. First, N+1 queries: one query for orders, then one per order for line items. I batch that into a single WHERE order_id = ANY($1) query and assemble in memory. Second, SELECT * on wide tables, which defeats covering indexes and pulls blobs nobody uses. Third, offset pagination on large sets: LIMIT 50 OFFSET 50000 still scans and discards 50,000 rows. I switch to keyset pagination on (created_at, id) with a cursor from the last row.

Failure modes I check before shipping.

An index is a write tax. On a table with 20 writes per second, one extra index is fine. On a hot table at 5,000 writes per second, three extra indexes can push p99 write latency up noticeably and bloat the table. I check write amplification and index size after a day, not just read speed. I also check for unused indexes with pg_stat_user_indexes (Postgres) before adding more, because teams often add a second index that duplicates an existing one with a different column order.

Another failure is a plan that is fast for the test tenant and slow for the largest. I re-run EXPLAIN ANALYZE with the biggest tenant_id and with a rare value, and I run ANALYZE after a bulk load so statistics are not stale. If the planner still chooses a bad plan, I prefer rewriting the query (for example, forcing the join order with a CTE materialisation hint only as a last resort) over locking in a hint that will rot when data grows.

Finally, I verify in the application, not just in psql. Same endpoint, same parameters, cache warmed, compare p50 and p99 over at least a few hundred requests. If the database time drops but endpoint latency does not, the bottleneck was elsewhere, often connection pool saturation or a downstream call, and I say so rather than claim a win.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-8How do you ensure code quality and maintainability?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I assume the interviewer wants to know how I behave when I inherit code I did not write, in a small business unit that will own it for a decade with no platform team to rescue it. That is the Constellation Software setting I would expect: a handful of engineers, a product that must keep billing correctly, and staff turnover that means the next owner may be someone I never meet.

My answer starts with pinning behaviour before I change it. If a billing module has no tests, I do not refactor it on day one. I write characterisation tests around the current output for a set of real inputs, run them in CI, and only then extract the discount rule into a pure function. The mechanism is simple. Tests turn an unknown system into a contract. Without that contract every refactor is a guess, and reviewers cannot tell a safe cleanup from a silent change in what customers are charged.

After that I make the cheap checks automatic, because human review does not scale to style and types. I keep pull requests small enough that a reviewer can hold the whole change in mind, I type the boundaries strictly, and I write down decisions that constrain future work in the repo, not in a chat thread.

A concrete scenario

Say I join a team maintaining a 40,000 line order service in Python. The discount logic lives inside an HTTP handler, reads a global config, and writes to the database directly. A product change arrives: discount threshold moves from 100 to 80, and a new customer segment gets 15 percent instead of 10.

The naive move is to edit the handler and ship. The maintainable move takes an extra day and saves the next five changes:

  1. Add table-driven tests that capture current behaviour at 99.99, 100.00 and for the new segment, using the handler as it is.
  2. Extract a pure function with no I/O, so the rule can be tested without a database.
  3. Leave the handler thin: parse input, call the function, persist the result.
Python
# Python 3.12, pytest 8. Pure function, no config or DB access.
from decimal import Decimal
from enum import Enum

class Segment(Enum):
    STANDARD = Decimal("0.10")
    PREMIUM = Decimal("0.15")

def discount(subtotal: Decimal, segment: Segment) -> Decimal:
    threshold = Decimal("80.00")
    if subtotal < threshold:
        return Decimal("0.00")
    return (subtotal * segment.value).quantize(Decimal("0.01"))

The type does work here. subtotal cannot be a float that drifts by a cent, and segment cannot be a free string that silently misses the premium branch. That is the mechanism behind strict typing at boundaries: it makes a class of bugs unrepresentable instead of relying on a reviewer to spot them.

How I judge trade-offs in review

I do not treat every practice as mandatory. I ask what failure it prevents and what it costs.

Signal in a PRMy thresholdAction
Production code over roughly 200 linesReviewer load rises, rollback gets harderSplit into a behaviour-preserving refactor and the feature
Function over about 50 lines or nested branches past depth 3Hard to test in isolationExtract pure logic, add a table-driven test
New abstraction used in only one placeAdds indirection without reuseInline it, wait for a second use
Dependency not updated in 18 monthsCVE patching and runtime upgrades become largeUpgrade one dependency at a time, record blockers in the README

That last row matters for long-lived business software. A small upgrade every quarter is an afternoon. The same upgrade after two years can be a week, because the framework, the runtime and the transitive dependencies have all moved. I would rather spend that afternoon regularly than explain a blocked security patch during an incident.

I also push back on coverage as a goal. A suite can reach 90 percent by calling functions without asserting outcomes. I check a test by mutating the code: change the threshold from 80 to 100, flip the comparison, and confirm something fails. If nothing fails, the test is decoration and I rewrite it or delete it. Deleting a misleading test improves maintainability, because the next engineer trusts the remaining suite.

Failure modes I watch for

The pattern I see most is duplication by avoidance. A file becomes hard to change, so engineers copy the validation into a new handler. Six months later there are three copies and a bug fix lands in only one. I detect it in review by searching for repeated conditionals and by tracking files that grow while their test files do not. The fix is a separate pull request that extracts the shared rule, with the characterisation tests from step one proving the behaviour did not change.

The other failure is undocumented constraint. Someone chose a keyset cursor over offset pagination because the orders table grows by millions of rows, but nobody wrote that down. A later engineer reverts to offset and the list endpoint times out at 200,000 rows. I record that kind of decision in a short note next to the code: what was chosen, what alternative was rejected, and what measurement drove it. It takes ten minutes and prevents a relitigation that costs far more.

Inherited code, no tests Characterisation tests pin current output Extract pure rule, thin handler CI gates: types, lint, tests, audit Small PR, review for logic not style Merge and record constraining decisions

If a check is not in CI it will be skipped under deadline pressure. If a decision is not written down it will be reversed by someone who lacks the context. My job is to make the maintainable path the default path, so a small team can move fast without accumulating debt it cannot pay back.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-9How would you approach debugging a failing application in production?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I start by stopping the bleed, then I narrow the blast radius before I touch code. In the first five minutes I confirm what "failing" means in numbers: which endpoint, which tenant or customer segment, what error rate, and since when. I check whether a deploy, a config change, a dependency, or a traffic shift lines up with the start time. Only then do I form a hypothesis and test it against logs and traces. A restart or a rollback is a mitigation I take if users are hurt, but I do not call the incident closed until I can explain the mechanism and add a check that would catch it earlier.

That order matters at a company like Constellation, where each business unit runs its own stack with a small team and no large central platform group to hand off to. You own the pager, the fix, and the follow-up, so the cheap reversible action beats the elegant rewrite during the incident.

Scope it in numbers

I pull the same four signals for the last hour and the hour before the alert, so the comparison is honest:

SignalCheckWhat it rules out
Error rate by route and status5xx / total per endpoint, split by versionA single bad route versus a global outage
Latency p50, p95, p99Same split, plus dependency latencyCPU saturation versus one slow downstream call
SaturationCPU, memory, connection pool, queue depth, diskResource exhaustion that will recur under load
Business outcomeOrders, payments, or jobs completed per minuteA noisy alert with no user impact

If p99 on POST /orders jumps from 180 ms to 2,400 ms while p50 stays flat, I look at a subset of requests, not the whole fleet. That pattern usually points to a data-dependent path, a lock, or a downstream call that only some requests make.

Alert fires Confirm user impact and start time Correlate with deploys and config changes Split by route, version, tenant, region Form one testable hypothesis Mitigate: rollback, scale, feature flag, or fix Verify error rate returns to baseline Add regression test and alert

Correlate, then reproduce

I overlay deploy markers on the error graph. A deploy at 14:03 and errors starting at 14:04 is a lead, not proof. I check the diff for the affected route, any migration, and any config default that changed. Then I try to reproduce with the smallest request that fails, using a production-shaped payload from the logs, with identifiers redacted.

For log triage I filter by correlation ID rather than reading raw streams:

Shell
# app logs, JSON lines, last 30 minutes
jq -c 'select(.level == "error" and .route == "/orders" and .status >= 500)
      | {ts, trace_id, version, code, latency_ms, db_ms, cache_hit}' \
  app.json.log | sort | uniq -c | sort -rn | head -20

If db_ms is 1,900 ms on the failing traces and 12 ms on healthy ones, I stop reading application code and look at the query plan, the lock wait, and whether a new index or a missing index changed the plan after the deploy.

Mitigate without masking

Mitigation depends on reversibility. A bad deploy gets rolled back. A feature that triggers the bug gets flagged off. A saturated pool gets scaled or its limit raised temporarily, with the saturation alert kept on so we notice when it returns. I avoid a restart as the only action when the process has been up for weeks, because it clears the evidence and the failure returns on the next traffic peak.

While mitigating, I keep one person on comms and one on the keyboard. In a small team that may be the same person at different minutes, but the status update still goes out: impact, start time, current hypothesis, next check.

Verify and close the loop

I watch the same four signals until they hold at baseline for at least two traffic cycles, not just for two quiet minutes. Then I write the fix with a test that fails on the old code. For a data-dependent timeout, that test is a seeded dataset that reproduces the slow query, plus a timeout and circuit breaker on the downstream call so the next failure degrades one route instead of the whole service.

The follow-up I would defend in review: a dashboard split by version, an alert on error rate per route rather than global 5xx, and a deploy check that compares p99 for the changed route for 15 minutes after release. If those three had existed, this class of failure would have paged us at 14:05 with the route and version already named, instead of at 14:40 from a customer report.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-10If asked to improve a legacy system at Constellation Software, what steps would you take?

Reported in Improving Legacy Systems

The 90-second answer

I would not start by rewriting anything. At Constellation, a business unit lives on a small, loyal customer base and steady maintenance revenue, so a big-bang replacement puts that cash flow at risk for a benefit the unit may never recover. My first job is to learn what the system actually does, measure where it hurts, and then improve it in small, reversible slices that pay for themselves.

I would start with discovery. I would read the tickets, talk to support and to the customers who use the painful workflow, and map the code: entry points, batch jobs, database tables, external integrations, and the parts nobody dares touch. I would also baseline the system before changing it. If a nightly import takes 4 hours and fails twice a month, I need that number in writing, plus error rates and p99 latency for the main screens, so a later improvement is provable.

Next I would pin current behaviour with characterization tests. Legacy code rarely has a spec, so the tests record what it does today, including the quirks. Only then would I pick a seam to improve, usually the one with the highest cost per release or the most customer complaints, and replace it behind the existing interface.

How I would sequence it

StepWhat I doWhat I produce
1. MapTrace requests, jobs and data flows; list integrations and ownersOne-page system map and dependency list
2. BaselineMeasure latency, failure rate, job duration, deploy frequencyNumbers from the last 30 days
3. Pin behaviourAdd characterization tests around the target areaTests that pass on the old code
4. Pick one seamRank by customer impact, change cost and riskOne slice, not a programme
5. StranglePut a new implementation behind the old interface, route a small share to itFeature flag or routing switch
6. Verify and hand overCompare old and new on the same inputs, document the domain rulesMetrics, runbook notes, decision log

Ranking matters because Constellation units are small. A team of three cannot carry a six-month rewrite while also supporting customers. A two-week slice that cuts a 4-hour job to 40 minutes, or removes a manual step support handles 50 times a week, is easier to fund and easier to defend when capital is allocated against other units.

Yes No Map system and callers Baseline metrics Characterization tests Pick one seam New code behind old interface Route small share, compare Metrics improve? Roll out, retire old path Roll back, keep tests

Pinning behaviour before I touch it

Characterization tests are not proof the old code is correct. They are a safety net that tells me when my change alters behaviour I did not intend to alter. For a pricing or tax calculation, I would capture a set of real inputs and the outputs the legacy code produces today.

Python
# Python 3.11, pytest. Checked against the legacy calculation as-is.
import pytest
from legacy_pricing import calculate_total  # existing module, untouched

@pytest.mark.parametrize("cart,expected", [
    ([{"sku": "A", "qty": 2, "price": 10.00}], 20.00),
    ([{"sku": "B", "qty": 1, "price": 5.50}, {"sku": "A", "qty": 1, "price": 10.00}], 15.50),
    ([], 0.00),
])
def test_current_totals_are_pinned(cart, expected):
    assert calculate_total(cart) == expected

If I then extract that calculation into a new service, these tests run against both implementations. A mismatch on a real cart shape stops the rollout before customers see it.

The strangler slice

I would keep the old interface stable and put the new code behind it. For a web flow, that means the existing endpoint stays, a flag decides which implementation handles the request, and I start with internal users or one customer cohort. For a batch job, it means writing the new job to a shadow table and comparing row counts and checksums against the old output for a week before switching the downstream consumer.

Rollback has to be a flag flip, not a redeploy. If p99 latency rises or error codes change, I route back to the old path and keep the tests and the comparison data. That discipline is what makes incremental work safe in a unit where the same people who ship the change also answer support calls.

What I would avoid

I would avoid a full rewrite, a framework migration done for its own sake, and refactoring code nobody needs changed. I would also avoid changing behaviour silently to match what I think the business should do. If a legacy rule looks wrong, for example a discount applied twice, I would raise it with the business owner, confirm the intended rule, and only then change it, with a test that names the rule.

I would close each slice by writing down the domain knowledge I learned: why the rule exists, which customer asked for it, and which edge cases matter. In a small vertical market system, that knowledge is often the real asset. The code can be replaced later. Losing the reason a customer-specific workflow exists is the failure I am trying to prevent.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-11What factors do you consider when designing a scalable application?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I start by asking what is supposed to scale, because traffic, data volume, team size and cost scale in different ways and pull the design in different directions. My default assumptions, which I would state out loud, are a read-heavy service, growth that is uneven across tenants, and a team that has to run this for years without a rewrite. With that, I design for stateless request handling, partitioned data, explicit backpressure, and failure isolation between tenants. I only add caching, sharding or a queue when a measured bottleneck justifies it.

Client Load balancer API instance A API instance B Cache Tenant-partitioned DB Work queue

Workload before architecture. I need numbers: peak requests per second, read to write ratio, payload size, and the latency target at p99. A service doing 500 reads per second with a 200 ms p99 budget needs a different answer from one doing 20,000 writes per second. Little's law turns that into concurrency: 20,000 requests per second times 0.2 seconds of downstream time is 4,000 requests in flight. If each database connection can serve one at a time and the pool is 100, the database becomes the ceiling long before the API tier does. That calculation decides whether I scale the API horizontally, raise the pool, or cut downstream latency first.

Stateless compute, stateful data. API instances hold no session state, so any instance can serve any request and a dead instance costs nothing but capacity. Sessions, uploads and job state live in a store designed for it. That also makes rolling deploys safe: drain an instance, replace it, no sticky routing to preserve.

Data partitioning and tenant isolation. I partition by the key that grows fastest and that I need to query together, usually tenant or customer id, and I put that key in every schema and index decision. In a portfolio of many small businesses, one tenant can grow 100 times faster than the median, so a single shared table with no isolation lets that tenant consume the connection pool and storage for everyone else. Per-tenant quotas on connections and queue depth, plus a separate shard or at least a separate schema for the largest tenants, contain that blast radius. I avoid cross-tenant joins and shared sequences, because they couple deployments that should move independently.

Backpressure and queues for work that does not need an answer now. Anything that can be deferred, notifications, reports, imports, goes on a queue with a bounded length and a dead-letter path. The API returns 202 with a job id instead of holding a request open for a 30 second report. When the queue fills, I shed load with 429 and a Retry-After header rather than letting latency grow until clients time out and retry, which multiplies load.

ApproachScales whenFails whenCost profile
Scale up one instanceLoad is predictable and data fits in memoryOne tenant or one query spikesCheap until the ceiling, then a hard stop
Scale out stateless instancesRequests are independent and state is externalDatabase or a shared cache is the bottleneckLinear in instances, easy to autoscale
Shard the dataOne shard saturates while others idleQueries need cross-shard joinsOperational cost per shard, harder migrations
Queue async workWork is deferrable and burstyUser needs the result in the same requestStorage for queued jobs, delayed feedback

Caching with a stampede guard. Caching helps only for data with a clear invalidation rule and a read ratio high enough to matter. I cache with a short TTL and single-flight refresh, so 200 concurrent requests for an expired key trigger one database fetch, not 200:

Python
# Python 3.12, single-flight cache refresh
import asyncio

_locks: dict[str, asyncio.Lock] = {}

async def get_cached(key: str, loader):
    hit = await cache.get(key)
    if hit is not None:
        return hit
    lock = _locks.setdefault(key, asyncio.Lock())
    async with lock:
        hit = await cache.get(key)
        if hit is None:
            hit = await loader()
            await cache.set(key, hit, ttl=60)
    return hit

Operability is a scaling factor. I need per-tenant and per-endpoint metrics for request rate, p99 latency, error rate, queue depth and pool saturation, with alerts on saturation rather than on raw traffic. A design I cannot observe will be scaled by guesswork. I also load test to the point of failure before launch, record where it breaks, and set autoscaling thresholds below that point, for example adding instances when CPU stays above 65 percent for five minutes or when the connection pool waits exceed 10 percent of requests.

The trade-off I keep returning to is coupling. Every shared database, shared cache namespace and shared deployment across independent units buys short-term simplicity and charges for it later, when one unit cannot deploy, migrate or scale without the others. For a long-lived product I would rather pay for explicit partitions and contracts up front than discover the coupling during an incident.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-12Tell me about a time when you faced a significant challenge at work?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I owned a nightly invoice import for a small business unit, three engineers and no platform team to hand it to. Finance reported month-end close slipping from two hours to six because about one invoice in seven was duplicated. The upstream system retried on timeout, our import had no idempotency key, and a race between two workers let both inserts through. I reproduced it on a 200,000-row extract, added a staged import with a deterministic dedupe key and a quarantine table, and backfilled the duplicates with a dry-run script finance could sign off. Duplicates fell to 0.02%, close returned to 40 minutes, and we added an alert when quarantined rows exceeded 0.1% of a batch.

What I found

The import read a CSV over SFTP, parsed it in memory, and inserted directly into invoices. Two cron workers ran when the first job ran long. The upstream retry was correct from its side. It had timed out after 30 seconds, so it resent the file. Our side had no way to tell a retry from a new file.

I pulled the last 30 days of batches and traced the duplicates:

CheckResult
------
------
------
Batches with duplicates11 of 30
Duplicate rate in affected batches9% to 18%
Duplicate patternSame external_id, different internal id, inserted 20 to 90 seconds apart
Overlap of two workers4 batches ran concurrently

That ruled out bad source data. The source was sending the same rows twice, and we were accepting both.

What I changed

I stopped inserting from the parser. The import now stages rows, computes a key from fields that identify an invoice in the source system, and inserts in one transaction per batch:

Python
# Python 3.11, checked against the import service
import hashlib

def dedupe_key(external_id: str, invoice_date: str, amount_cents: int) -> str:
    raw = f"{external_id}|{invoice_date}|{amount_cents}"
    return hashlib.sha256(raw.encode()).hexdigest()
SQL
-- invoices.dedupe_key has a UNIQUE constraint
INSERT INTO invoices (external_id, invoice_date, amount_cents, dedupe_key)
VALUES (?, ?, ?, ?)
ON CONFLICT (dedupe_key) DO NOTHING;

Rows that conflict go to invoice_quarantine with the reason, instead of failing the whole batch or silently dropping. Finance could review them in the morning rather than discovering them at close.

SFTP file arrives Stage rows Compute dedupe_key Insert, conflict does nothing Conflicts to quarantine Alert if over 0.1 percent

I also killed the second worker. One scheduler, one run, and a lock file check at startup. That removed the race instead of hoping the constraint alone would cover it.

Backfill and result

For the existing duplicates I wrote a script that listed candidates, grouped by dedupe_key, and kept the earliest created_at. It ran in dry-run mode first. Finance checked 312 candidate groups against their ledger and approved 298 for removal. The other 14 were genuine corrections from the source, so we kept them and linked them as reversals.

MeasureBeforeAfter 30 days
Duplicate invoices1,140 in the prior month17, all quarantined before posting
Month-end closeAbout 6 hours40 minutes
Manual reconciliation2 days of analyst timeHalf a day
Silent failuresDuplicates found by financeAlert fires within the batch

What I took from it

The fix was small. The harder part was that nobody owned the contract between the two systems. The upstream team assumed retries were safe, and we assumed files were sent once. I added a contract test with a sample file sent twice, and a runbook entry for the quarantine alert with the exact query to inspect a batch. In a small unit that matters more than a cleverer parser. If the next person inherits this, they should find the failure in the test suite before finance finds it at close.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-13Describe a situation where you had to work with a difficult team member?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

On a four-person team at a small business unit, I worked with a senior engineer who was technically strong but blocked every design discussion in review. He would reject a pull request with a one-line comment, offer no alternative, and then miss the handover meeting where we could have resolved it. Our release slipped two weeks, and the other two engineers stopped posting comments at all. I treated it as a delivery problem I owned, not a personality problem to escalate. I changed how we reviewed, made the disagreement visible in writing, and got the release out with the same team.

What actually happened

Assumptions I would state first: small team, no spare engineer to reassign, and the behaviour was observable in artefacts, not just my impression. That mattered because in a Constellation-style unit you keep the people you have. Escalating to a distant manager without evidence would have damaged trust and solved nothing.

The trigger was a pricing service migration. I proposed a strangler pattern behind a feature flag. He commented "this will not scale" on the pull request and closed the discussion. No numbers, no alternative. The same pattern repeated on three pull requests over ten days. Median review turnaround went from 6 hours to 31 hours, and two pull requests sat unmerged for a week.

I did not start with a complaint about attitude. I started with a direct, private conversation using specifics.

"On Tuesday and Thursday you left 'will not scale' with no alternative. I cannot act on that, and the release date moved. What would you need to see to approve, or what design would you pick instead?"

He said the flag added operational complexity and he preferred a hard cutover on a Sunday. That was a legitimate trade-off, just never stated. We agreed to test both against the same criteria: rollback time, load at peak, and on-call burden.

WeekObservable behaviourMy moveResult
1Review comments with no alternative, median turnaround 31 hPrivate conversation, asked for his preferred design and criteriaHard cutover proposed, but no rollback plan
2Same pattern on next pull requestPut both options in a one-page doc with load figures and rollback steps, asked him to mark the line he disagreed withHe marked the rollback step, not the architecture
3Handover meeting missed twiceMoved handover to async written notes plus a 20-minute slot he choseNotes posted, meeting held, decision recorded
4Reviews still slow on non-critical pull requestsAgreed review rules: comment must name a risk and an alternative, or approveMedian turnaround back to 9 h, release shipped

The load figures settled it. At our peak of roughly 1,200 requests per minute, the flag path added one extra database read per request, about 4 ms at p95 in staging. The hard cutover had a rollback of 45 minutes because it required a schema change. The flag rollback was under 2 minutes. He accepted the flag once rollback was quantified, and he owned the cutover checklist.

What I would do differently, and where this breaks

If the private conversation had failed, my next step was not HR. It was a mediated session with our engineering lead, with the written doc and the review metrics on the table. I would only escalate beyond that if the behaviour continued after a clear, agreed standard, because then it is a performance issue with a paper trail.

Yes No Yes No Observable pattern in reviews or handover Private conversation with dates and artefacts Behaviour changes? Agree written review standard and measure turnaround One-page proposal with options and figures Agreement reached? Mediated session with lead, doc and metrics as evidence

Two failure modes I watch for now. First, mistaking a blunt style for bad intent. He was blunt, but his objection about operational complexity was real, and dismissing it would have shipped a riskier migration. Second, letting the team go quiet. When two engineers stop commenting, the cost shows up later as defects in production, not in the review queue. I checked in with them separately and told them the new rule applied to everyone, including me.

The outcome I would cite in the interview: release shipped on the revised date, review turnaround measured from the pull request system rather than from memory, and no change in headcount. The lesson I kept is to make the disagreement concrete early. A vague objection costs a week. A written alternative with numbers costs an afternoon.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-14How do you prioritize tasks when faced with multiple deadlines?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I sort by hard deadline first, then by cost of delay, then by what unblocks other people. A date in a contract or a regulatory filing is not negotiable in the same way as an internal target, so I label each task with the consequence of missing it, not just the date. If two tasks share a hard date, I compare what breaks, who is blocked, and how much work remains. I write that ranking down and send it to the people who set the deadlines before I start, because at Constellation a business unit is small and autonomous. There is no central queue to hide behind. If I silently drop a commitment, the manager and the customer find out late. If I surface the trade-off early, they can move a date, cut scope, or accept the risk.

My default order is: fix anything that loses money or breaks a customer commitment, then work that unblocks a teammate, then feature work with a dated external dependency, then internal improvements. I also cap work in progress. With three deadlines in one week, starting all three usually finishes none of them.

A worked week

Assume it is Monday morning and I have four items. The figures below are the kind I would put in a short update to my manager.

TaskDeadlineConsequence of a one-week slipEffort leftCost of delay per week
Payment retry bug for a client on a renewal due FridayFri, hardRenewal at risk, support escalations2 daysHigh, contract value at stake
Export job for finance closeWed, hardFinance cannot close the month1 dayHigh, blocks other teams
New report requested by salesNext Fri, softSales uses a manual spreadsheet3 daysMedium, workaround exists
Refactor a legacy moduleNo dateNone this week5 daysLow

The ranking falls out of the table. Finance export on Monday and Tuesday because Wednesday is hard and it blocks others. Payment bug Wednesday and Thursday, with a fix and a test run on Friday morning. Sales report only if the first two finish early, and I tell sales on Monday that it is third in line. The refactor does not start. That last point matters. Naming what I am not doing is part of the answer.

I use a simple score to make the comparison explicit when the table is less clear:

Python
# Python 3.11, checked against the worked example above
from dataclasses import dataclass

@dataclass
class Task:
    name: str
    impact: int      # 1 to 5, value if done
    urgency: int     # 1 to 5, cost of a one-week slip
    effort_days: float

    @property
    def score(self) -> float:
        return (self.impact * self.urgency) / self.effort_days

tasks = [
    Task("finance export", 5, 5, 1),
    Task("payment retry bug", 5, 5, 2),
    Task("sales report", 3, 2, 3),
    Task("legacy refactor", 2, 1, 5),
]
for t in sorted(tasks, key=lambda x: x.score, reverse=True):
    print(t.name, round(t.score, 2))

That prints finance export at 25.0, payment bug at 12.5, sales report at 2.0, and refactor at 0.4. The score does not decide for me. It forces me to state impact and urgency as numbers I can defend, and it exposes a common error: a large feature with a soft date can outrank a small fix that prevents a contract loss if I only look at effort.

When the ranking breaks

Three failure modes come up often. First, every deadline is labelled urgent by the person who set it. I ask for the consequence in writing, for example a penalty clause or a named customer impact, and I re-rank on that. Second, a task depends on someone else and the dependency slips. I move the dependent task down immediately and tell the requester the same day, rather than spending the week on parts I cannot ship. Third, I discover mid-task that the estimate was wrong. If a two-day fix becomes a five-day rewrite, I stop, re-estimate, and present two options: ship a narrower fix that meets the deadline, or move the date. Constellation units tend to value that kind of candour because capital and headcount are allocated on trust over years, not on hitting one sprint.

Yes No Yes No New task arrives Is the deadline hard? Score by cost of delay Score by impact per day Does it block someone else? Move up, tell them the plan Queue behind hard deadlines Publish ranking to stakeholders

I review the list at the end of each day. Deadlines move, estimates change, and a ranking from Monday is stale by Thursday. The habit that survives is short and written: what I will finish, what I will not, and what I need from someone else to change that.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-15Can you provide an example of how you've taken the initiative in a project?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I owned a nightly reconciliation job for a payments service, about 40 engineers on the platform team, and I started fixing it without waiting for a ticket. It processed 18 million rows, ran for 5 hours 40 minutes, and failed twice a week on a lock timeout. Finance had stopped trusting its output and was running manual spot checks. I profiled it, found a full scan plus a row-by-row update, rewrote it as a set-based merge with a covering index, and shipped it behind a flag with a shadow run for three nights before cutover. Runtime dropped to 38 minutes and the timeouts stopped. The point I would make in the interview is that I did not ask for a project. I took a recurring pain inside my own scope, measured it, and carried the rollout risk myself.

What I did, in order

First, I reproduced the failure locally with a production-shaped snapshot, 2 million rows sampled, and turned on query timing. The job did a SELECT with no usable index on merchant_id, created_at, then updated each row in a loop. That is the classic N+1 pattern at batch scale.

Second, I wrote the fix as a single merge and added the index in the same change, so the two could not drift apart:

SQL
-- PostgreSQL 15, checked against our staging snapshot
CREATE INDEX CONCURRENTLY idx_payments_merchant_created
    ON payments (merchant_id, created_at DESC)
    WHERE status = 'settled';

MERGE INTO reconciliation r
USING (
    SELECT merchant_id, sum(amount_cents) AS total_cents
    FROM payments
    WHERE status = 'settled'
      AND created_at >= $1 AND created_at < $2
    GROUP BY merchant_id
) p ON r.merchant_id = p.merchant_id
WHEN MATCHED THEN UPDATE SET total_cents = p.total_cents, updated_at = now();

Third, I proved equivalence before anyone had to trust it. For three nights the new job ran in shadow mode against a read replica and wrote to a separate table. I compared row counts and totals per merchant, and diffed the exceptions list. Only when the diff was empty did I flip the flag for the real table.

MetricBeforeAfterHow measured
Runtime5 h 40 min38 minJob log, 14 nights
Lock timeout failures2 per week0 in 6 weekspg_stat_activity alerts
Rows updated per transaction1~12,000 per merchant batchBatch counter in job output
Manual finance spot checksDailyWeeklyFinance team log

What could have gone wrong, and how I checked

The index build itself was the risk. CREATE INDEX CONCURRENTLY avoids blocking writes, but it takes longer and can leave an invalid index if it fails, so I monitored pg_index.indisvalid and had a rollback script ready. The merge also changed transaction size, so I watched replication lag on the replica during the shadow runs. If lag had exceeded 5 seconds I would have split the date range into hourly chunks. It peaked at 1.2 seconds.

I also wrote it up in a short doc with the before and after numbers, the shadow diff result, and the rollback steps, then handed the job to the on-call rota with the new timing alert set at 90 minutes instead of the old 6 hours. That handover matters. Initiative that leaves a fragile one-off script behind is not finished work.

If an interviewer pushes on whether I should have asked first, my answer is that I did inform my manager the same day, with the profile data and the plan, and I stayed inside my service boundary. I did not change a schema owned by another team or spend budget. That is the line I use: act without permission when the blast radius is your own code and the change is reversible, escalate when it crosses a team boundary or costs money.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-16How would you handle a situation where your solution did not meet client expectations at Constellation Software?

Reported in Handling Missed Client Expectations

The 90-second answer

I would treat it as a measurement problem first and a communication problem second, in that order. I would ask what expectation was missed, in numbers, and whether we agreed those numbers up front. If we did not, I own that gap too. Then I would put a fix or a rollback in front of the client within days, not after a full rewrite, and I would be explicit about what it costs and what we are stopping to pay for it.

At Constellation that matters more than at a centralised product company. Operating companies run with a lot of autonomy and are judged on capital discipline over years, not on shipping a feature for a demo. A solution that misses the business case ties up engineers and delays the next acquisition integration. So my answer has to show I would protect the unit's return on the work, not just defend the code.

What I would actually do

First, reproduce the miss with the client's own data. If the complaint is "too slow", I want the trace, the percentile, and the workload. If it is "not what we asked for", I want the acceptance criteria we signed, or the absence of them, next to the delivered behaviour.

Second, separate three causes, because each has a different fix: the requirement was clear and I built the wrong thing, the requirement was ambiguous and I guessed, or the requirement changed mid-build and nobody re-priced the scope. Blaming the second or third without evidence reads as evasion in an interview and in the job.

Third, propose the smallest corrective step that can be measured in one cycle. That might be a feature flag rollback, a query rewrite, or cutting a workflow to the one path the client uses 90% of the time. I would state the cost of that step in engineer-weeks and what I am deferring to fund it.

A concrete pattern I use is a short written note, sent before the meeting, with four lines: what we expected, what we measured, what I propose, what it costs. It stops the meeting becoming a negotiation about whose memory is right.

StepArtefactDone when
1. Pin the missTrace or acceptance test from client dataOne number both sides accept, e.g. p95 650 ms vs 200 ms target
2. Name the causeDiff of spec vs build, datedClear, ambiguous, or changed scope, with evidence
3. Smallest fixFlag, patch, or cut scopeShippable in 1 to 2 weeks, with a rollback path
4. Re-priceEngineer-weeks and deferred workClient agrees the trade in writing
5. Prevent repeatDemo cadence or contract testNext miss surfaces in week 1, not week 6
No Yes Client reports miss Reproduce with client data Number agreed? Agree baseline together Measure gap Smallest fix or rollback Re-price scope in writing Demo weekly until closed

Worked example, hypothetical figures

Say a reporting endpoint was expected at p95 under 200 ms for a 50k-row export, and production shows 650 ms. At 40 exports a day that is not a cosmetic miss. It adds roughly 18 seconds of waiting per user per day and it saturates the read replica during the morning peak. My fix would not be "optimise everything". I would check the query plan first. In the cases I have seen, one missing index or a full scan on a date filter accounts for most of it. If adding an index and pre-aggregating the daily rollup brings p95 to 140 ms in staging with the client's data volume, I ship that behind a flag, measure for a week, and only then remove the old path. If it does not, I say so and propose moving the export to an async job with a download link, which changes the contract and needs the client's explicit sign-off.

Failure modes I watch for

The first is the late surprise. If the only demo is at delivery, a miss is guaranteed to be expensive. I demo working software every week, even if it is ugly, so the client reacts to behaviour rather than to a slide.

The second is silent scope absorption. Engineers quietly add the extra report, the extra import format, the extra permission rule, and then miss the original date. That looks helpful and destroys the business case. I would rather surface the extra ask, estimate it, and let the client choose what to drop.

The third is defending the architecture. If the client expected a simple CRUD screen and I delivered an event-sourced design because it was more elegant, the miss is mine. Constellation's model rewards boring, maintainable systems that a small team can run for a decade. I would say that plainly and fix toward the boring version.

What I would not do is promise a date before I have reproduced the problem, or agree to a fix without naming what stops. A strong candidate closes with a commitment they can measure: the number, the date, and the rollback if the number does not move.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-17What recent technologies or frameworks have you implemented in your projects?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I use recent technology when it removes a cost I can measure, and I keep the older stack when it does not. The project I would point to is a rebuild of an internal order and billing service for a vertical market business. It started on ASP.NET Framework 4.8, WCF services, and SQL Server 2016. We moved the HTTP surface to .NET 8 minimal APIs in C# 12, kept the domain logic in plain classes, moved reporting queries to PostgreSQL 15, and shipped the service as a Linux container behind our existing load balancer. No Kubernetes, no event bus. The team was four engineers and the service had to run for ten years with two maintainers.

That choice mattered more than the framework list. Minimal APIs gave us a single Program.cs to read, EF Core 8 gave us migrations we could review in a pull request, and PostgreSQL gave us jsonb for the flexible line item data we had been stuffing into a string column. We did not rewrite the whole system at once. We put the new API in front of the old database, ran both in parallel for six weeks, and cut over by route.

AreaBeforeAfterMeasured effect
Runtime.NET Framework 4.8 on Windows.NET 8 LTS on LinuxImage 1.9 GB to 210 MB
APIWCF + SOAP, generated proxiesMinimal API, OpenAPI from codeNew endpoint in 1 day instead of 4
DataSQL Server 2016, string column for line itemsPostgreSQL 15, jsonbReport query 2.4 s to 180 ms
DeployManual copy to two Windows hosts, 45 minContainer, rolling replace, 6 minRollback under 1 min
Latencyp95 620 ms at 40 req/sp95 210 ms at 40 req/sPool saturation moved from 40 to 160 req/s

The figures above are from that service, measured with the same load script before and after. The latency gain came mostly from removing the WCF hop and from indexing the jsonb field, not from the runtime alone.

CSHARP
// Program.cs, .NET 8, checked against the .NET 8 SDK
using Microsoft.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<OrderDbContext>(o =>
    o.UseNpgsql(builder.Configuration.GetConnectionString("orders")));
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();
app.UseSwagger();
app.MapHealthChecks("/health");

app.MapPost("/orders", async (CreateOrder req, OrderDbContext db, CancellationToken ct) =>
{
    var order = new Order { CustomerId = req.CustomerId, Lines = req.Lines };
    db.Orders.Add(order);
    await db.SaveChangesAsync(ct);
    return Results.Created($"/orders/{order.Id}", new { order.Id });
});

app.Run();

Two decisions kept the migration safe. First, we did not use EF Core change tracking for the reporting path. A read-only query that tracked 10,000 rows held memory and slowed the next write. We used AsNoTracking() and raw SQL for the two reports that scanned line items. Second, we treated the OpenAPI document as a contract test. Every pull request ran a test that called the new endpoints and compared the response shape to the old WCF contract for the fields the clients actually used. That caught a date format change in week two, before any client saw it.

What I would not do again is move the database in the same release as the API. We planned to, then split it. Moving both at once would have made a rollback a data migration instead of a traffic switch. The split cost us six weeks of running two stores, and it saved us when the first PostgreSQL cutover produced wrong totals for tax. We switched traffic back in four minutes because the old path was still live.

If I joined a team today I would ask what the current stack is, what hurts, and what the maintenance budget looks like before suggesting anything new. Recent does not help if nobody can run it at 2 a.m. in three years.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-18Describe a technical problem you solved and how you approached it?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I would pick a problem where I owned the measurement, not just the fix. At my last role we ran a nightly import for a small acquired business: about 180,000 order lines from a legacy ERP export into our Postgres database. The job had crept from 6 minutes to 45 minutes over a year, it timed out twice a week, and when it retried it created duplicate lines. Finance could not close the books until it finished.

My approach was reproduce, measure, isolate, fix, then prove it under the original conditions. I did not start by rewriting the importer.

First I reproduced it locally with a copy of one night's file, 182,431 rows, and added timing around each stage. Parsing took 40 seconds. The database write took almost all the rest. A query trace showed the pattern: one INSERT per row, each in its own transaction, plus a SELECT per row to check whether the line already existed. That is 360,000 round trips. On our network that was roughly 7 ms per round trip, which accounts for the 40 minutes on its own.

Second, I checked the schema. There was no unique constraint on the natural key, (external_order_id, line_no), so the duplicate check was a race and a full scan under load. The lookup query had no index to use even if the scan had been cheap.

The fix kept the existing file format and the existing downstream tables. I changed the write path only:

Python
# Python 3.12, psycopg 3, checked against Postgres 15
BATCH = 500

with conn.transaction():
    with conn.cursor() as cur:
        cur.executemany(
            """INSERT INTO order_lines_staging
               (external_order_id, line_no, sku, qty, price_cents)
               VALUES (%s, %s, %s, %s, %s)
               ON CONFLICT DO NOTHING""",
            batch,
        )

Staging first, one transaction per batch of 500, then a single INSERT ... SELECT into the real table with ON CONFLICT (external_order_id, line_no) DO NOTHING. I added that unique index in a separate migration and backfilled it before enabling the new code, so a retry became safe by construction rather than by a check in application code.

No Yes ERP file 182k rows Parse and validate Stage in batches of 500 Merge with ON CONFLICT DO NOTHING Reconcile counts to finance report Counts match? Publish batch as complete

What changed, in numbers

MetricBeforeAfter
---------
---------
---------
---------
Runtime for 182,431 rows44 min3 min 50 s
Database round trips~365,000~730
Duplicate lines after a forced retry1,2040
Rows written per transaction1500

I verified it three ways. I ran the old file and the new file against the same database snapshot and compared row counts and checksums per order. I killed the job halfway through a run and restarted it, then confirmed the final count matched a clean run. I also ran it at twice the file size, 360,000 rows, to check it scaled linearly rather than hitting a memory or lock limit. It finished in 7 minutes 20 seconds, close to linear.

Two things I deliberately did not do. I did not move the import to a streaming queue. That would have added infrastructure the team would have to operate for a job that runs once a night and now finishes in under four minutes. I also did not add a distributed lock. The unique constraint already made concurrent runs safe, and a lock would have been a second mechanism to maintain.

If I were doing it again I would add one thing earlier: a dead-letter table for rows that fail validation, with the row number and reason, instead of failing the whole batch. We discovered that need in week two when one malformed price stopped a 500-row batch. The lesson I took from it is to instrument the boring path first. The slow query was obvious once I looked, but I only looked because I timed the stages before changing anything.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-19Describe the time complexity of your code solutions?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I state complexity in terms of the input that actually grows, then show how I counted it. For a function over n records I say what n is, the worst case I am claiming, and the extra memory. A bare O(n log n) without that is not an answer an interviewer can check.

Take a concrete case I use in interviews: find two values in an unsorted list of n integers that sum to a target.

Python
# Python 3.11, checked against CPython 3.11
def two_sum_brute(nums: list[int], target: int) -> tuple[int, int] | None:
    for i in range(len(nums)):
        for j in range(i + 1, len(nums)):
            if nums[i] + nums[j] == target:
                return (i, j)
    return None

def two_sum_hash(nums: list[int], target: int) -> tuple[int, int] | None:
    seen: dict[int, int] = {}
    for j, value in enumerate(nums):
        if target - value in seen:
            return (seen[target - value], j)
        seen[value] = j
    return None

The brute force version checks each unordered pair once. That is n * (n - 1) / 2 comparisons, so O(n^2) time and O(1) extra space. The hash version makes one pass, doing one dict lookup and one insert per element, so O(n) average time and O(n) extra space. The trade is memory for time, and the hash version pays it only if the list fits in memory comfortably.

Worked trace

For nums = [3, 2, 4], target = 6, the hash version runs as follows:

Stepjvaluetarget - valueseen beforeAction
1033{}insert 3 -> 0
2124{3: 0}insert 2 -> 1
3242{3: 0, 2: 1}hit, return (1, 2)

Three iterations, not six pair checks. That trace is what I would point to when an interviewer asks how I know the count is linear.

Why the numbers matter

Big O hides constants, so I translate it into operations at a realistic size. At n = 100,000, n^2 is about 10^10 pair checks. Even at a generous 10^8 simple operations per second, that is roughly 100 seconds. n log n at the same size is about 1.7 x 10^6 comparisons, well under a second. That arithmetic decides whether a solution is acceptable before anyone argues about style.

I also name the cases where the headline complexity misleads. Hash based code is O(n) on average and O(n^2) in the worst case if inputs are crafted to collide, though Python dicts randomise hashing for strings and make that hard to trigger by accident. Sorting based code is O(n log n) worst case but needs O(n) or O(log n) extra space depending on the sort, and it destroys the original order. Early exit changes average time a lot when a match is found near the start, but it does not change the worst case I quote.

At Constellation Software I would expect the follow up to be about a real business system, not a puzzle. The same habit applies there: name the growing input, count the dominant operation, state the memory cost, and give the figure at the size the system actually sees. If a report over 50,000 orders goes from 40 ms to 3 seconds after a change, that measured jump tells me more than the label on the algorithm, and I would say so.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-20What motivates you to perform well in your job?

Reported in Constellation Software Software Engineer interview ...

The 90-second answer

I do my best work when I own a piece of software end to end and can see the effect of a change on the people who use it. That means deciding what to build, writing it, shipping it, and living with the pager for it. I also like problems where a small, well-chosen fix compounds. A query that drops a nightly job from four hours to forty minutes, or a form that stops generating support tickets, matters more to me than a new framework.

That is why Constellation interests me. Your operating units run with a lot of autonomy, the teams are small, and the horizon is long. I would rather maintain and improve a boring system that a real business depends on for ten years than chase a greenfield rewrite that gets replaced in two.

What that looks like day to day

MotivatorBehaviour you would seeEvidence from my last role
OwnershipI pick up on-call, write the runbook, and stay with a bug until the fix is in productionOwned the order import service, 3 services, about 40k orders a day
Visible impactI talk to support and users before I start, and check the metric after I shipAdded validation at import, support tickets for bad imports fell from roughly 30 a week to 6
CraftI leave code easier to change than I found it, even when the ticket only asked for a featureSplit a 900-line handler into testable units and added contract tests before adding a new file format

Money and title matter in the ordinary sense. I want to be paid fairly and to grow in responsibility. They are not what I optimise for week to week. I have turned down work that offered a bigger title on a platform team with no production ownership, because I knew I would disengage.

A concrete example

At my previous company we ran a billing export for a small logistics customer. It timed out twice a month and finance reconciled it by hand. Nobody had put it on a roadmap because it was not a customer-facing feature.

I volunteered for it, reproduced the timeout, and found the export was loading every invoice into memory and sorting in the application. I changed it to a keyset-paged query, streamed the file, and added a checksum so finance could verify a partial run. The work took three weeks alongside normal sprint work.

StepWhat I didResult
Week 1Profiled the job, added timing logsFound 92% of runtime in one unindexed query
Week 2Rewrote the query and streamed outputRuntime fell from 3h 50m to 38m in staging
Week 3Shipped behind a flag, watched two production runsNo timeouts in the next quarter, finance stopped manual reconciliation

That project did not use any new technology. It motivated me because the fix was mine, the users were named people I could call, and the benefit kept repeating every night.

What would demotivate me

Long approval chains where I cannot ship a small fix without a central platform team, and work where success is measured by activity rather than a working system. I also lose interest when a team rewrites working code for style reasons while known defects stay open. If I joined a unit here, I would want to know how decisions get made locally, how much time engineers get for maintenance, and how capital for a small improvement gets approved. Those answers tell me more about whether I will perform well than a description of the stack.

Curated: · Written: · Reviewed:

Difficulty: Easy

Curated: · Written: · Reviewed: