C# interview questions for web devs

iamprovidence
13 min readAug 17, 2024

--

Just a list of subjects, topics, and questions that I believe developers at junior, middle, and senior levels should know. You can use it as a roadmap, to prepare for an interview, or to conduct one 🙃.

Enjoy 😉

Code conventions

junior

  • knows programming language’s conventions

middle

  • can introduce changes to the codebase without breaking existing conventions

senior

  • can set up linting to automate code conventions (Roslyn Analysers, StyleCop, FxCop, SonarLint)

Refactoring

junior

  • what is Refactoring?
  • what is Clean Code?
  • can simplify if/else statement

middle

senior

  • knows code metrics (depth of inheritance, coupling, cyclomatic complexity)

Debugging

junior

  • debugging in Visual Studio
  • settings breakpoints
  • conditional breakpoints
  • changing runtime values

middle

  • Stopwatch

senior

  • remote debugging
  • knows how to debug multi-thread app

Git

junior

  • GitHub
  • basic operations (init, clone, fetch, pull, commit, push)
  • branching
  • .gitignore

middle

  • stash
  • rebase vs merge
  • branching models (GitFlow, GitHub Flow, etc)
  • git blame

senior

  • .gitattributes
  • checkout on a commit
  • cherry-pick
  • squash

Source Code Review

junior

  • knows what a Pull Request is

middle

  • knows how to conduct code review and provide useful and understandable feedback

senior

  • can set up, drive, and control code review practices within a team
  • has a check-list for PR review
  • writes architecture tests to sustain conventions
  • automatization of code review

Data Structures

junior

  • array
  • matrix
  • linked list
  • LIFO vs FIFO
  • stack
  • queue
  • binary tree

middle

  • hash table. how does a hash table behave when there is a collision?
  • hash function. what happens when mutable fields are used in the hash function? what is a collision in hash tables?

senior

  • graph

Algorithms

junior

  • O notation, space/time complexity
  • swap values in an array
  • min, max, average in an array
  • recursion
  • sorting (bubble sort, insertion sort, selection sort)
  • searching (linear search, binary search, knows precondition for binary search)

middle

  • quick sort

senior

  • tree traversal (with queue, with stack, NLR, LRN, RLN)
  • divide-and-conquer algorithms

Object Oriented Programming

junior

middle

senior

  • aspect-oriented programming. how to implement cross-cutting concerns?

Functional Programming

junior

middle

senior

.NET

junior

  • what .NET is
  • can create a custom library

middle

  • .Net CLI
  • difference between compile time and runtime

senior

  • global.json
  • dotnet-tool.json
  • can create custom nuget
  • CLR, CIL, CTS, CLS, GAC, DLL, EXE

Core C#

junior

  • basic types, enums, value types vs reference types
  • struct vs class
  • string, StringBuilder, interpolation, string.Format()
  • boxing, unboxing
  • type casting (is, as, type conversion operator)
  • method overload vs method optional parameters, named parameters
  • in, ref, out, params
  • interface vs abstract class, inheritance
  • access modifiers (public, private, protected)
  • virtual vs new vs override
  • static class and static class members
  • indexers and properties
  • generics, generic constraints
  • exceptions, finally
  • linq. First() vs FirstOrDefault() vs Single() vs SingleOrDefault()
  • garbage collection, IDisposable vs Finalizer, using statement

middle

  • what’s new in C#?
  • sealed class, partial class
  • access modifiers (internal)
  • tuple, named tuple, deconstruction
  • const vs static readonly
  • understand regex and its usage
  • Equals(), inherit EqualityComparer<T>, Comparer<T>.Default
  • GetHashCode(), HashCode.Combine()
  • rethrowing exception (throw ex vs throw), when in a catch clause
  • deferred linq execution
  • basic of working with files. File, FileInfo, Streams (Stream, FileStream, etc)

senior

Collections

junior

  • array
  • generic collections (List<T>, LinkedList<T>, Dictionary<K, V>, HashSet<T>, Stack<T>, Queue<T>, PriorityQueue<T, P>)

middle

  • interfaces (ICollection<T>, IList<T>, IDictionary<K, V>)
  • readonly interfaces (IEnumerable<T>, IReadOnlyList<T>, IReadOnlyDictionary<K, V>)
  • ObservableCollection<T>
  • iterators, IEnumerator (MoveNext(), Current, Reset())

senior

  • ILookup<K, V>
  • Enumerable.SequenceEqual()
  • base classes for custom collections (Collection<T>, KeyedCollection<K, V>)
  • readonly collections (ReadOnlyCollection<T>, ReadOnlyDictionary<K,V>), Array.AsReadOnly()
  • concurrent collections (BlockingCollection<T>, ConcurrentBag<T>, ConcurrentDictionary<K, V>, ConcurrentQueue<T>, ConcurrentStack<T>)
  • immutable collections
  • frozen collections
  • create empty collection (Array.Empty<int>(), Enumerable.Empty<int>(), ImmutableArray<T>.Empty, ImmutableDictionary<TKey,TValue>.Empty, FrozenDictionary<TKey,TValue>.Empty, etc)
  • yield return in details
  • IAsyncEnumerable

Delegates

junior

  • delegates, lambda expressions
  • understand events
  • Action, Func, Predicate

middle

  • create custom delegate
  • local functions

senior

  • lambda closures
  • combine delegates
  • create event, EventHandler, EventArgs
  • event forwarding (add, remove keyword)

Reflection

junior

  • basic understanding of reflection
  • attributes
  • .GetType() vs typeof()

middle

  • create a custom attribute, AttributeUsage

senior

  • capable of applying reflection
  • expression trees
  • Activator.CreateInstance<T>(), Activator.CreateInstance(Type t)
  • invoking instance’s methods, invoking static methods

Multithreading

junior

  • being able to use Task

middle

senior

Libraries

junior

middle

senior

Networking

junior

  • JSON and XML
  • HTTP methods (GET, POST, PUT, DELETE, etc). GET vs POST
  • HTTP response groups (1XX, 2XX, 3XX, 4XX, 5XX)
  • HTTP headers
  • REST
  • knows the basic difference between HTTP and HTTPS

middle

  • capable of issuing HTTP requests using Postman

senior

  • can explain the basics of the HTTP request flow
  • webhooks
  • knows Postman in advance (creating the environment, using variables, etc)
  • API Versioning

ASP .NET API

junior

middle

senior

ASP.NET MVC

junior

  • MPA
  • understand ASP.Net MVC conventions
  • creating a view, passing data between views and controllers
  • razor syntax

middle

senior

Web Security

junior

  • authorization vs authentication
  • knows how to store passwords in DB (encryption, hashing, salt)
  • knows what hash function is
  • hashing vs encryption vs encoding vs serializing

middle

senior

SQL Databases

junior

middle

  • ACID
  • CAP
  • normalization (1NF, 2NF, 3NF)
  • clustered and non-clustered indexes. should we create an index for a bool column? what about IsDeleted? Index sequential number vs GUID?
  • unique and foreign keys
  • check constraints
  • transactions
  • views, materialized views
  • cursors
  • soft delete vs hard delete

senior

NoSQL Databases

junior

  • NoSQL concepts

middle

  • SQL vs NoSQL. Advantages/disadvantages of NoSQL Databases over Relational Databases

senior

  • BASE
  • can review and use NoSQL databases based on a project needs
  • has experience with MongoDb/Elasticsearch/Redis etc

Entity Framework

junior

  • what is DbContext
  • configuring the db model. data annotations vs FluentAPI
  • EF approaches (Code First, Database First, Model First)
  • implement CRUD
  • one-to-one, one-to-many, many-to-many relations conventions
  • configure relations with FluentAPI
  • load data: lazy vs explicit vs eager
  • IEnumerable vs IQueryable
  • create and apply a migration

middle

senior

  • inheritance strategies (TPH, TPT, TPC)
  • raw SQL queries
  • working with stored procedures
  • working with views
  • transactions, transaction in SaveChanges(), TransactionScope
  • interceptors
  • unit test code with DbContext
  • view generated SQL (.ToString(), log, profiler)
  • linqpad

Monitoring

junior

  • benefits of logging
  • can use ILogger<T>

middle

  • different log levels (Trace, Debug, Info, Warning, Error, Fatal)
  • health checks

senior

  • tools how to track events in cloud (Grafana, Prometheus, etc). when to use?
  • diagnostic/health check
  • trace identifier/correlation id
  • structure log
  • audit log
  • monitoring on-premises systems (Grafana, ELK stack, Seq, etc)

Performance

junior

  • can find performance issues in the app?

middle

  • can optimize algorithms
  • can optimize memory usage

senior

Cache

junior

  • understand what cache is
  • can explain when we need caching and when we don’t

middle

  • IMemoryCache vs IDistibutedCache vs HybridCache
  • AbsoluteExpiration vs SlidingExpiration
  • Redis
  • memoization

senior

  • сaching strategies
    - Cache-Aside (Lazy loading)
    - Read-Through Cache
    - Write-Through Cache
    - Write-Around
    - Write-Back
  • cache invalidation methods
    - time-based invalidation (TTL)
    - event-based invalidation
    - version-based invalidation
    - least recently used (LRU) invalidation
    - manual invalidation
  • cache metrics
    - cache hit ratio
    - latency
    - throughput
    - cache size
    - cache miss rate

Tests

junior

  • unit tests
  • unit test characteristics (quick, consistent, isolated, atomic, etc)
  • Mock objects
  • Arrange-Act-Assert (AAA) pattern
  • Assert statement
  • TDD. knows when to apply
  • unit test naming conventions

middle

  • integration tests
  • run web service in the integration test
  • BDD
  • Given-When-Then (GWT) pattern
  • FluentAssertion
  • Bogus
  • Assert vs Expect statement
  • Stub objects

senior

Design patterns

junior

middle

senior

Architecture

junior

  • breaking a problem into multiple functions

middle

senior

Domain Driven Design

junior

  • entity
  • dto
  • factory pattern

middle

senior

  • ubiquitous language
  • business invariant
  • aggregate root
  • value object
  • domain events. integration events
  • rich vs anemic model
  • validation. always-valid model vs not-always-valid-model
  • specification pattern
  • bounded context
  • anti-corruption layer
  • shared kernel

Microservices

junior

  • 🤷‍♂️

middle

  • what are microservices? what is the use-case for using them?
  • microservice vs monolith
  • can one microservice access another microservice’s database?

senior

  • strong consistency vs eventual consistency
  • synchronous communication (HTTP vs GraphQL vs gRPC)
  • asynchronous communication (AMQP)
  • what is a proxy server? API gateway? BFF? load balancers? Ocelot
  • load balancing strategies. sticky session
  • message brokers, pull vs push models. publish/subscriber
  • message queues. dead-letter queues
  • transactions management. SAGA (orchestration vs choreography), state machine, compensation events
  • vertical vs horizontal scaling. which to choose? what are the limits?
  • distributed locks
  • distributed cache
  • idempotency in microservices
  • queue-based load leveling
  • inbox pattern
  • outbox pattern
  • messaging guarantees
    - at most once (uniqueness)
    - at least once (delivery)
    - exactly once (delivery, uniqueness)
  • circuit breaker
  • retry HTTP calls.
    how to avoid a self-inflicted DDoS Attack? exponential backoff.
    which HTTP status codes should be retried and which shouldn’t?
  • ETL

Cloud computing

junior

  • 🤷‍♂️

middle

  • on-premise vs cloud deployment
  • benefits and drawbacks of going cloud
  • cloud models (PaaS vs IaaS vs SaaS)

senior

  • serverless concept
  • vertical/horizontal scaling
  • cold start problem in lambdas
  • blob storage
    types of resources (an account, a container, a blob)
    access tiers (hot, cool, cold, archive)
  • vendor lock-in

DevOps

junior

  • 🤷‍♂️

middle

senior

Containers

junior

  • 🤷‍♂️

middle

senior

Software development methodologies

junior

  • basics of work organization using ticket management software (i.e., Jira or Trello)

middle

  • SCRUM basics: roles, meetings, processes, artifacts
  • Kanban basics: Kanban board, tickets processing
  • pair programming
  • task hierarchy
    - epic
    - user story
    - task

senior

  • set-up Scrum or Kanban on the project
  • work breakdown structure (WBS)

Estimation

junior

  • knows fibonacci numbers
  • knows T-shirt sizes

middle

  • pocker estimation

senior

  • critical path method
  • three-point estimation
  • knows when an investigation is required
  • include in the estimate
    - task estimate
    - risk estimate
    - tests
    - investigation/documentation

Project documentation

junior

  • functional specification
  • can gather requirements from stakeholders

middle

  • understand technical specifications (how to setup/configure project, development process, branch names)
  • understand functional specification (sequence diagrams, use-case diagrams, etc)
  • release-notes
  • when task considered to be completed? acceptance criteria
  • UML. different types of diagrams

senior

  • non-functional specification
  • deployment specification
  • can write project documentation
  • C4 model. Difference between Container and Components
  • GDPR compliance

For the End

I hope I didn’t upset anyone because the list does not match their expectation 😅. It’s simply my personal perspective, and it’s perfectly fine if you have a different view.

Do not worry if you don’t know something, and do not get arrogant if you master a section before somebody else. Remember that everybody learns stuff at a different pace. The labels of junior, mid-level, and senior do not mean anything. As practice shows, what a junior developer has not learned yet, a senior developer has already forgotten 😁.

💬 Let me know in the comment sections what other topics deserve to be on the list

⬇️ Check out my other articles

👏 Don’t forget to clap

☕️ You can buy me a coffee with a link below

✅ Subscribe

🙃 And stay awesome

--

--

iamprovidence

👨🏼‍💻 Full Stack Dev writing about software architecture, patterns and other programming stuff https://www.buymeacoffee.com/iamprovidence