Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Interviews in C# and .NET

        Work in the tool while you explain your decisions.

        Choose a role and level. Each interview has a new task, follow-up questions and a report that checks your work and your explanation.

        Speak or type. Sign in to save your results across devices.

        Timed assessment

        • 12 practical questions
        • 90 minutes
        • Mid level

        Questions are drawn from a bank of 36. Your report includes a skill breakdown and lessons to practice next.

        Practice interviews

        Junior tasks cover the fundamentals. Mid and senior tasks add debugging, changing requirements and review decisions.

        12 interviews

        • Backend engineer
        • Junior
        • 24 min

        Parcel counts and boxed copies

        Implement Trace. Create a ParcelCount from start, copy it and add delta to the copy. Box the original as IParcelCount and add twice delta through that interface. Return the original, copied and boxed values in that order. All arithmetic fits in int.

        Start interview
        Skills and rubricParcel counts and boxed copies
        • Assigning this struct copies its value, and boxing creates another copy. I would mutate each destination separately because neither operation gives the original shared mutable fields.
        • With start 5 and delta 3, the values are 5, 8 and 11. A zero delta preserves all three, while a negative delta reduces only the two copies.
        • Trace a concrete input, then compare the expected value with the actual workspace result.
        • Software engineer
        • Junior
        • 24 min

        Generic identity with a supplied comparer

        Implement the generic DistinctInOrder method. Keep the first value in each equality group, using the supplied comparer. Preserve encounter order. Values may be zero or negative, and strings may use a case-insensitive comparer. Empty input returns an empty array.

        Start interview
        Skills and rubricGeneric identity with a supplied comparer
        • The HashSet must receive the same comparer as the contract. I would append only when Add succeeds because that keeps the first representative and its original position.
        • Under an ordinal case-insensitive comparer, r7 and R7 form one group and the first spelling survives. Integer zero remains a value, and empty input has no groups.
        • Trace a concrete input, then compare the expected value with the actual workspace result.
        • Test automation engineer
        • Junior
        • 24 min

        One enumeration for a report summary

        Implement Summary. Select values greater than or equal to minimum and return their count and signed sum. The input may allow only one enumeration. Enumerate it once at most. The count and sum fit in int.

        Start interview
        Skills and rubricOne enumeration for a report summary
        • A deferred query runs again when each aggregate enumerates it. I would materialize once or accumulate count and sum in one loop because the source may be a one-use stream.
        • A value equal to minimum is included. Empty input returns count 0 and sum 0. Signed values must retain their sign, so a negative qualifying value can reduce the sum.
        • Trace a concrete input, then compare the expected value with the actual workspace result.
        • Backend engineer
        • Junior
        • 24 min

        A deferred tenant page

        Implement Page over an IQueryable of QueueRow records. Filter by tenant and Id strictly greater than after, order by Id and take at most take rows. Return an IQueryable without enumerating it. The browser runs LINQ to Objects, so these tests don't establish SQL translation or database performance.

        Start interview
        Skills and rubricA deferred tenant page
        • Keeping the operators on IQueryable preserves an expression for the provider. I would filter the tenant before taking the page because a limit over mixed tenants can return incomplete or unauthorized results.
        • Rows at the cursor are excluded, and take 0 returns no rows. Adding a qualifying row after Page returns must affect later enumeration because the result is still deferred.
        • Trace a concrete input, then compare the expected value with the actual workspace result.
        • Software engineer
        • Mid
        • 32 min

        Cancellation before the next callback

        Implement CopyAsync. Check cancellation before work starts and before every callback. Await step for each input in order, passing the original token unchanged. Return the transformed array. A cancellation request must escape as OperationCanceledException rather than a successful partial result.

        Start interview
        Skills and rubricCancellation before the next callback
        • Cancellation is cooperative, so I would check the token at each boundary and pass it into the callback. Awaiting preserves exceptions and prevents the next operation from starting after a cancellation observed between items.
        • A token canceled on entry causes zero callbacks. If the first callback requests cancellation, the second never starts. Empty uncanceled input returns an empty array.
        • The loop performs linear callback work with one pending callback and a result array proportional to input size.
        • Test automation engineer
        • Mid
        • 32 min

        Concurrent starts and stable result order

        Implement CollectAsync. Invoke every start callback before awaiting completion. Await all returned tasks and return their values in callback order, even if completion order differs. Empty input returns an empty array. Let a task failure propagate. These are asynchronous operations on the browser runtime, not parallel CPU threads.

        Start interview
        Skills and rubricConcurrent starts and stable result order
        • Materializing the task list starts all callbacks before the first await. Task.WhenAll returns results in input task order, so I would preserve that order rather than append values as individual tasks finish.
        • Completing the second promise before the first still returns the first value first. An empty task list completes successfully, while one fault makes the combined task fault.
        • The task and result arrays need linear space; elapsed time depends on the slowest operation and runtime scheduling.
        • Backend engineer
        • Mid
        • 32 min

        Owned resources during a failed render

        Implement Render. Acquire exactly one PrintLease, pass it to render while it's still open and return the text. Dispose the acquired lease exactly once before leaving, on success or exception. Propagate the original exception. If acquisition throws, don't call render.

        Start interview
        Skills and rubricOwned resources during a failed render
        • A using declaration lowers to cleanup in a finally block. I would keep rendering inside that scope because the resource must remain open until the work completes, and the garbage collector doesn't call Dispose for me.
        • A render failure still disposes the lease once. The callback observes zero disposals while it runs. An acquisition failure has no acquired lease to dispose.
        • This wrapper holds one resource and adds constant bookkeeping; the callback determines the remaining work.
        • Software engineer
        • Mid
        • 32 min

        One scope for each dispatch item

        Implement Dispatch. Create and dispose a new service scope for each label. Resolve DispatchSession inside that scope, assign its Label and return the session IDs in input order. Repeated labels still need different sessions. Empty input creates no sessions. This workspace uses the course's documented dependency-injection stand-in.

        Start interview
        Skills and rubricOne scope for each dispatch item
        • The service is scoped to one work item, so I would resolve it from a fresh child scope inside the loop. Disposing that scope releases the container-owned session before the next item starts.
        • Two identical labels still produce two distinct session IDs. Every created session is disposed before Dispatch returns, and an empty list creates no scope-owned session.
        • The loop creates one scope per item and retains the result IDs; only one scope remains open at a time.
        • Test automation engineer
        • Senior
        • 40 min

        Minimal API input and response boundaries

        Implement Map. Register POST /batches. Reject a blank Code or Count outside 1 through 40 with 400. For valid input trim Code and return 201 with the normalized BatchInput and a /batches/ Location followed by the escaped code. Other methods stay unmapped. This is the documented minimal-API stand-in, without an HTTP server or the ASP.NET Core middleware pipeline.

        Start interview
        Skills and rubricMinimal API input and response boundaries
        • I would validate before constructing the success response because invalid input must never look like a created resource. Trimming applies to both the returned body and the escaped Location, so callers receive one consistent resource identity.
        • I would define idempotency and a database uniqueness rule before promising that retries can't create duplicates. I would also test authentication, authorization, model binding and exception handling in the actual ASP.NET Core host because the local stand-in doesn't run that middleware pipeline.
        • Validation scans the code text; this model performs no database or network operation.
        • Backend engineer
        • Senior
        • 40 min

        A tracked adjustment that survives a new context

        Implement AdjustAsync. Find the Stock by id, add the signed delta and save the tracked change. Return true only when the row exists, even when delta is zero. Missing rows return false and create nothing. This workspace uses the documented EF Core stand-in; it doesn't run a relational provider.

        Start interview
        Skills and rubricA tracked adjustment that survives a new context
        • A tracked entity changes only inside the current unit of work until SaveChanges persists it. I would read it with a fresh context after saving because reading the same tracked instance can hide a missing save.
        • Tracking is local to a context, so it doesn't coordinate competing writers. I would use a concurrency token with conflict handling or an appropriate atomic database update. A relational integration test must exercise the competing saves because this stand-in doesn't model transactions or concurrency conflicts.
        • One lookup and one save are modeled here; production cost depends on the provider and database access plan.
        • Software engineer
        • Senior
        • 40 min

        Related totals without a query per manifest

        Implement Totals. Return every manifest as id:sum in ascending id order, including manifests with no parcels as id:0. Keep signed parcel units and exclude unrelated parcels. Use one modeled query, with Include, instead of querying parcels for each manifest. The documented EF stand-in counts enumerations, not real SQL round trips.

        Start interview
        Skills and rubricRelated totals without a query per manifest
        • I would load each navigation through the single modeled Include query before summing its parcels. An inner join can drop empty manifests, and a child lookup inside the loop creates work proportional to the number of parents.
        • I would first try a server-side aggregate projection because loading every child transfers data the report doesn't need. I would inspect generated SQL, cardinality and the query plan. Split-query behavior and provider translation need integration tests; the browser query counter proves neither.
        • This model loads the related rows in one counted operation; it doesn't measure database latency, SQL count or index behavior.
        • Test automation engineer
        • Senior
        • 40 min

        Async tests that detect two faulty implementations

        Write DeliveryTests using the xUnit-shaped test stand-in. DeliveryFee.GetAsync returns units multiplied by 40; zero returns zero, and negative units throw ArgumentOutOfRangeException. Include an awaited theory for zero and positive units and an awaited exception test. Your tests must pass the correct implementation and fail both hidden faulty versions.

        Start interview
        Skills and rubricAsync tests that detect two faulty implementations
        • I would await both the returned task and the exception assertion because an unobserved task can let the test finish before the failure. Independent zero, positive and negative cases expose the contract instead of mirroring its implementation.
        • I would inject a clock and an API boundary, then supply deterministic test doubles because live time and network responses make a unit test depend on outside state. Separate integration tests would cover the actual provider, including failure mapping and cancellation. I would avoid sleeping to simulate elapsed time.
        • These isolated tests perform bounded local work; they measure behavioral coverage rather than production throughput.

        Interview Hub access

        The Interview Hub is included in All Access. Choose a plan or sign in to your account to continue.

        View plansSign in or join

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.