Dosi Bridge

Dosi Bridge Digital Operations & Software Innovation – Business Research Infrastructure for Development, Growth & Engineering

StringComparer.OrdinalIgnoreCase prevents casing bugs in .NET lookups. Without an explicit comparer, role names, tenant ...
07/10/2026

StringComparer.OrdinalIgnoreCase prevents casing bugs in .NET lookups. Without an explicit comparer, role names, tenant codes, and feature keys can behave differently than users expect.

I see this mistake in backend code because the happy path looks correct: the dictionary has the key, the set has the value, and the test uses the same casing as the seed data.

For beginners: StringComparer tells .NET how two strings should be compared. Default string lookup is case-sensitive ordinal comparison, which is not always what you want for protocol-like values.

In real projects, my suggestion is simple:
- decide whether the value is user text or a code
- use StringComparer.OrdinalIgnoreCase for stable technical codes when casing should not matter
- normalize once at the boundary when you store or log the value
- add casing tests for roles, tenants, headers, and feature keys
- never hide authorization rules inside casual string handling

This matters for clients because small casing mismatches can look like random access failures, broken tenant routing, or features that work for one user but not another.

Which rule do you prefer in API code: normalize once at the boundary, choose a comparer everywhere, or use both?

ASP.NET Core response compression can speed up large API payloads, but blind gzip everywhere can waste CPU, add security...
07/10/2026

ASP.NET Core response compression can speed up large API payloads, but blind gzip everywhere can waste CPU, add security risk, and make tiny responses slower for real users before rollout.

I see beginners treat compression like a free performance switch. It is useful, but it is still a tradeoff: the server spends CPU to reduce bytes on the network.

For beginners: response compression means the server sends a smaller response, usually gzip or Brotli, and the browser or client expands it back.

In real projects, my suggestion is simple:
- compress large text responses such as JSON
- avoid guessing on secret-heavy responses
- do not compress files already compressed
- measure CPU, latency, and payload size together
- document the rule in API reviews

This matters for clients because a slow API is not always a database problem. Sometimes the performance fix creates a new bottleneck or a security review problem.

What response compression rule do you check first in API reviews: MIME types, response size, secret data, or CPU cost?

C # switch expressions look clean in interviews, but a default arm can hide new enum states. In real APIs, that turns a ...
07/10/2026

C # switch expressions look clean in interviews, but a default arm can hide new enum states. In real APIs, that turns a release change into the wrong status for users and clients fast.

A common mistake is using the default arm as a safe fallback for every enum value, especially when mapping domain states to API responses.

For beginners: a switch expression chooses one result from several cases. The default arm catches anything that was not matched above.

In real projects, new enum values appear during releases. If the default arm hides them, clients may receive a believable but wrong status.

My suggestion: map known states explicitly, and let unknown states fail loudly unless you truly have a product-approved fallback.

Do you prefer a default arm in enum mapping, or forcing new states to fail fast during review?

C # foreach remove List is a small interview trap with real API impact. If you change a List while looping it, cleanup c...
07/10/2026

C # foreach remove List is a small interview trap with real API impact. If you change a List while looping it, cleanup code can throw at runtime and turn simple batch work into a failed request.

A common mistake is removing items from the same List inside a foreach loop because the code looks direct and easy to read.

For beginners: foreach uses an enumerator. If the collection changes while that enumerator is reading, .NET protects you by throwing.

In real projects, this shows up in cleanup jobs, import validation, order filtering, and small maintenance APIs that only fail with certain data.

My suggestion: use RemoveAll for a simple List cleanup, or build a new filtered list when the rule needs more explanation.

Which collection bug do you see more often in code reviews: modifying during foreach, or repeated enumeration?

Cursor pagination keeps API lists stable when new rows arrive. Without a predictable order and cursor, clients can see d...
06/10/2026

Cursor pagination keeps API lists stable when new rows arrive. Without a predictable order and cursor, clients can see duplicates, miss records, or blame your product for random list behavior.

I see teams start with page number pagination because it is easy to understand. That can be fine for admin screens, but changing product feeds, orders, tickets, and audit lists need stronger rules.

For beginners: a cursor is a small token that says where the last page ended. The next request continues after that position instead of guessing from a page number.

In real projects, my suggestion is simple:
- always define a stable sort order
- use a tie-breaker like id when timestamps match
- fetch one extra row to know if another page exists
- keep the cursor opaque to clients
- document max page size and response shape

This matters for clients because list bugs look like lost data, duplicate work, or unreliable search even when the database is correct.

What pagination rule do you enforce first in API reviews: stable order, max page size, cursor signing, or response shape?

ASP.NET Core request logging helps when production breaks, but raw bodies and headers can expose passwords, tokens, or t...
05/10/2026

ASP.NET Core request logging helps when production breaks, but raw bodies and headers can expose passwords, tokens, or tenant data. The fix is a redaction rule before logs reach storage.

I see teams add more logging after a painful incident. That is understandable, but raw request logging can create a second incident: private data sitting in dashboards, exports, and alerts.

For beginners: redaction means removing or masking sensitive values before they are saved. It is not the same as deleting logs later.

In real projects, my suggestion is simple:
- log the route, status, trace id, tenant id, and user id
- avoid raw Authorization, Cookie, password, token, and card-like fields
- use an allowlist for request body fields
- keep a redaction test beside the logging code
- review who can read production logs

This matters for clients because logs often travel farther than the API response: dashboards, alert emails, support tickets, and exported files.

What fields do you always remove or mask before request logs reach shared storage?

ASP.NET Core trace IDs turn random production errors into a path your team can follow. Without them, support tickets, lo...
05/10/2026

ASP.NET Core trace IDs turn random production errors into a path your team can follow. Without them, support tickets, logs, and API failures stay disconnected while clients wait for answers.

I see beginners log the exception message and stop there. That feels enough until a real user reports an issue and nobody can connect the ticket to the exact request.

For beginners: a trace id is a small request identifier. If you return it in the error response and write it into logs, everyone can search the same value.

In real projects, my suggestion is simple:
- include a trace id in ProblemDetails responses
- write structured logs with named fields
- keep user, tenant, route, and dependency names safe and searchable
- never log secrets just to make debugging easier
- copy the trace id into support notes during incidents

This matters for clients because faster debugging means shorter incidents, clearer communication, and less guessing under pressure.

What field do you always want in logs when an API incident starts: trace id, user id, tenant id, route, or dependency name?

C # CancellationToken is an interview topic that shows up in real APIs. When a user leaves, ignored tokens can keep HTTP...
05/10/2026

C # CancellationToken is an interview topic that shows up in real APIs. When a user leaves, ignored tokens can keep HTTP calls, queries, and background work running after the request is gone.

A common mistake is accepting a token in the controller, then not passing it into HTTP calls, EF queries, or other async dependencies.

For beginners: CancellationToken does not kill work by magic. It is a signal that cooperative APIs can observe and stop early.

In real projects, this matters for API responsiveness, graceful shutdown, background jobs, logs, and avoiding wasted cloud resources.

My suggestion: accept the token at the edge and pass it down unless you have a deliberate reason not to cancel that operation.

Where do you most often see CancellationToken forgotten: HTTP calls, EF queries, queues, or background services?

C # async delay is a small interview topic with real production impact. Thread.Sleep blocks a worker thread, while Task....
05/10/2026

C # async delay is a small interview topic with real production impact. Thread.Sleep blocks a worker thread, while Task.Delay waits without stealing capacity from busy APIs or background jobs.

A common mistake is treating Thread.Sleep and Task.Delay as the same kind of pause because both wait for time to pass.

For beginners: Thread.Sleep stops the current thread. Task.Delay gives back control and resumes the async method later.

In real projects, this matters in retry logic, background jobs, health checks, tests, and APIs that need to stay responsive under load.

My suggestion: inside async code, avoid blocking waits unless you have a very specific reason and understand the throughput cost.

Where have you seen blocking waits cause trouble: APIs, background jobs, tests, or UI code?

EF Core migration safety is not only a database task. If every app instance changes schema at startup, one deploy can lo...
04/10/2026

EF Core migration safety is not only a database task. If every app instance changes schema at startup, one deploy can lock tables and turn a normal release into downtime for real users.

I see beginners treat migrations like harmless app startup code. It works locally, then production adds multiple instances, real traffic, bigger tables, and rollback pressure.

For beginners: a migration changes your database schema. That means it can lock tables, fail halfway, or take longer than your deploy window.

In real projects, my suggestion is simple:
- generate an idempotent SQL script
- review risky operations before deploy
- use expand-contract changes for renames and deletes
- run migration work as a controlled release step
- watch locks, errors, and API latency during rollout

This matters for clients because the database is often the hardest part of a release to undo quickly.

What is your safest rule for database changes in production: startup migration, manual review, idempotent script, or migration job?

Address

Dhaka
1207

Alerts

Be the first to know and let us send you an email when Dosi Bridge posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Shortcuts

Share