Interview Q&A

Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.

4608 total questions 4508 technical 100 career & HR 4272 from PDF library

Showing 1–13 of 13

Popular tracks

Mid PDF
Custom Attributes in C#?

Short answer: Real Use Cases Validation frameworks Logging metadata Role-based security API documentation metadata Custom Attribute Example [AttributeUsage(AttributeTargets.Property)] public class RequiredAttribute : Att…

Power Questions Read answer
Mid PDF
Abstract Class vs Interface?

Short answer: Interface Meaning Defines capability and behavior contract Use when: Multiple inheritance is required System uses plug-in extensibility Loose coupling is necessary public interface IPayment { void Pay(decim…

Power Questions Read answer
Mid PDF
Thread-Safe Singleton?

Short answer: Incorrect (not thread-safe) public class Singleton Example code { private static Singleton _instance; } Correct using double-check locking public sealed class Singleton { private static Singleton _instance;…

Power Questions Read answer
Mid PDF
Producer–Consumer using BlockingCollection?

Short answer: BlockingCollection<int> queue = new BlockingCollection<int>(); Task.Run(() => { for(int i = 1; i <= 5; i++) { queue.Add(i); } queue.CompleteAdding(); }); Task.Run(() => { foreach(var it…

Power Questions Read answer
Mid PDF
Custom LINQ Operator?

Short answer: public static class LinqExtensions { public static IEnumerable<T> WhereNot<T>(this IEnumerable<T> source, Func<T,bool> predicate) { foreach (var item in source) if (!predicate(item))…

Power Questions Read answer
Mid PDF
Mini Dependency Injection Container?

Short answer: public class MyContainer { private Dictionary<Type, Type> map = new(); public void Register<TInterface, TImplementation>() { map[typeof(TInterface)] = typeof(TImplementation); } public TInterfac…

Power Questions Read answer
Mid PDF
Scalable Logging Framework?

Short answer: public interface ILoggerTarget { void Log(string message); } Central Logger public class Logger { private readonly List<ILoggerTarget> targets = new(); public void AddTarget(ILoggerTarget target) =&gt…

Power Questions Read answer
Mid PDF
Async Deadlocks?

Short answer: Bad example var result = GetData().Result; Correct approach await GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end Example code Bad example var result = GetData().Result; Correct approach a…

Power Questions Read answer
Mid PDF
Async Deadlocks Bad example var result = GetData().Result; Correct approach?

Short answer: wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-…

Power Questions Read answer
Mid PDF
Span<T> / Memory<T>?

Short answer: Used for high performance scenarios involving: File processing Large memory structures Reduced garbage collection overhead Example Span&lt;int&gt; numbers = stackalloc int[3] { 1, 2, 3 }; Example code numbe…

Power Questions Read answer
Mid PDF
LRU Cache?

Short answer: Removes least recently used entries when full. public class LruCache&lt;TKey,TValue&gt; Example code { private readonly int capacity; private readonly Dictionary&lt;TKey, LinkedListNode&lt;(TKey,TValue)&gt;…

Power Questions Read answer
Mid PDF
Multi-Threaded Bank System?

Short answer: public class BankAccount { private object _lock = new object(); public decimal Balance { get; private set; } public void Deposit(decimal amount) { lock(_lock) { Balance += amount; } } public void Withdraw(d…

Power Questions Read answer
Mid PDF
API Rate Limiter?

Short answer: public class RateLimiter { private readonly int limit; private readonly TimeSpan window; private readonly Dictionary&lt;string, Queue&lt;DateTime&gt;&gt; store = new(); public RateLimiter(int limit, TimeSpa…

Power Questions Read answer

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: Real Use Cases Validation frameworks Logging metadata Role-based security API documentation metadata Custom Attribute Example [AttributeUsage(AttributeTargets.Property)] public class RequiredAttribute : Attribute {} Usage Example public class Employee

Example code

{ [Required] public string Name { get; set; }
} Validation Logic public static void Validate(object obj)
{
var properties = obj.GetType().GetProperties();
foreach (var prop in properties)
{
var isRequired = prop.GetCustomAttributes(typeof(RequiredAttribute), false).Any();
if (isRequired && prop.GetValue(obj) == null) throw new Exception($"{prop.Name} is required"); }
}

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: Interface Meaning Defines capability and behavior contract Use when: Multiple inheritance is required System uses plug-in extensibility Loose coupling is necessary public interface IPayment { void Pay(decimal amount); } Abstract Class Meaning Provides base behavior with shared implementation Represents IS-A inheritance relationship public abstract class PaymentBase

Example code

{
public void Log() => Console.WriteLine("Payment logged");
public abstract void Pay(decimal amount);
} Summary Interface = Capability Abstract Class = Shared Base Behavior

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: Incorrect (not thread-safe) public class Singleton

Example code

{
private static Singleton _instance;
} Correct using double-check locking public sealed class Singleton
{
private static Singleton _instance;
private static readonly object _lock = new object();
private Singleton() {}
public static Singleton Instance
{ get {
if (_instance == null)
{ lock(_lock) {
if (_instance == null)
_instance = new Singleton();
}
}
return _instance;
}
}
} Best and simplest public sealed class Singleton
{
public static readonly Singleton Instance = new Singleton();
private Singleton(){}
}

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: BlockingCollection<int> queue = new BlockingCollection<int>(); Task.Run(() => { for(int i = 1; i <= 5; i++) { queue.Add(i); } queue.CompleteAdding(); }); Task.Run(() => { foreach(var item in queue.GetConsumingEnumerable()) { Console.WriteLine("Consumed " + item); } }); Provides automatic thread synchronization and prevents race conditions.

Example code

BlockingCollection<int> queue = new BlockingCollection<int>(); Task.Run(() => {
for(int i = 1; i <= 5; i++)
{ queue.Add(i); } queue.CompleteAdding(); }); Task.Run(() => {
foreach(var item in queue.GetConsumingEnumerable())
{ Console.WriteLine("Consumed " + item); } }); Provides automatic thread synchronization and prevents race conditions.

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: public static class LinqExtensions { public static IEnumerable<T> WhereNot<T>(this IEnumerable<T> source, Func<T,bool> predicate) { foreach (var item in source) if (!predicate(item)) yield return item; } } Usage var employees = list.WhereNot(e => e.IsDeleted);

Example code

public static class LinqExtensions
{
public static IEnumerable<T> WhereNot<T>(this IEnumerable<T> source, Func<T,bool> predicate) {
foreach (var item in source)
if (!predicate(item)) yield return item; }
} Usage var employees = list.WhereNot(e => e.IsDeleted);

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: public class MyContainer { private Dictionary<Type, Type> map = new(); public void Register<TInterface, TImplementation>() { map[typeof(TInterface)] = typeof(TImplementation); } public TInterface Resolve<TInterface>() { var impl = map[typeof(TInterface)]; return (TInterface)Activator.CreateInstance(impl); } }

Example code

public class MyContainer
{
private Dictionary<Type, Type> map = new();
public void Register<TInterface, TImplementation>()
{
map[typeof(TInterface)] = typeof(TImplementation);
}
public TInterface Resolve<TInterface>()
{
var impl = map[typeof(TInterface)];
return (TInterface)Activator.CreateInstance(impl);
}
}

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: public interface ILoggerTarget { void Log(string message); } Central Logger public class Logger { private readonly List<ILoggerTarget> targets = new(); public void AddTarget(ILoggerTarget target) => targets.Add(target); public void Log(string message) { foreach (var t in targets) t.Log(message); } } Supports: Console File Database Cloud Follows Open–Closed Principle.

Example code

public interface ILoggerTarget
{ void Log(string message); } Central Logger public class Logger
{
private readonly List<ILoggerTarget> targets = new();
public void AddTarget(ILoggerTarget target)
=> targets.Add(target);
public void Log(string message)
{
foreach (var t in targets) t.Log(message); }
} Supports: Console File Database Cloud Follows Open–Closed Principle.

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: Bad example var result = GetData().Result; Correct approach await GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end

Example code

Bad example var result = GetData().Result; Correct approach await GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end wait GetData(); Rules: Avoid Result Avoid Wait Remain async end-to-end

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: Used for high performance scenarios involving: File processing Large memory structures Reduced garbage collection overhead Example Span<int> numbers = stackalloc int[3] { 1, 2, 3 };

Example code

numbers[1] = 10; Runs on stack → extremely fast.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: Removes least recently used entries when full. public class LruCache<TKey,TValue>

Example code

{
private readonly int capacity;
private readonly Dictionary<TKey, LinkedListNode<(TKey,TValue)>> cache = new();
private readonly LinkedList<(TKey,TValue)> list = new();
public LruCache(int capacity) => this.capacity = capacity;
public TValue Get(TKey key)
{
if (!cache.ContainsKey(key)) return default;
var node = cache[key];
list.Remove(node);
list.AddFirst(node);
return node.Value.Item2;
}
public void Put(TKey key, TValue value)
{
if (cache.ContainsKey(key))
list.Remove(cache[key]);
if (cache.Count == capacity)
{
var last = list.Last; cache.Remove(last.Value.Item1); list.RemoveLast();
}
var newNode = new LinkedListNode<(TKey,TValue)>((key,value));
list.AddFirst(newNode);
cache[key] = newNode;
}
}

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: public class BankAccount { private object _lock = new object(); public decimal Balance { get; private set; } public void Deposit(decimal amount) { lock(_lock) { Balance += amount; } } public void Withdraw(decimal amount) { lock(_lock) { if (Balance >= amount) Balance -= amount; } } } Ensures thread safety and prevents financial inconsistency.

Example code

public class BankAccount
{
private object _lock = new object();
public decimal Balance { get; private set; }
public void Deposit(decimal amount)
{ lock(_lock) {
Balance += amount;
}
}
public void Withdraw(decimal amount)
{ lock(_lock) {
if (Balance >= amount)
Balance -= amount;
}
}
} Ensures thread safety and prevents financial inconsistency.

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share

High-Impact Interview Questions Career Preparation · Power Questions

Short answer: public class RateLimiter { private readonly int limit; private readonly TimeSpan window; private readonly Dictionary<string, Queue<DateTime>> store = new(); public RateLimiter(int limit, TimeSpan window) { this.limit = limit; this.window = window; } public bool IsAllowed(string user) { if(!store.ContainsKey(user)) store[user] = new Queue<DateTime>(); var q = store[user]; while(q.Count > 0 && q.Peek() < DateTime.Now…

Explain a bit more

- window) q.Dequeue(); if(q.Count >= limit) return false; q.Enqueue(DateTime.Now); return true; } } Prevents abuse such as excessive requests, bots, and denial-of-service attempts.

Example code

public class RateLimiter
{
private readonly int limit;
private readonly TimeSpan window;
private readonly Dictionary<string, Queue<DateTime>> store = new();
public RateLimiter(int limit, TimeSpan window)
{
this.limit = limit;
this.window = window;
}
public bool IsAllowed(string user)
{
if(!store.ContainsKey(user))
store[user] = new Queue<DateTime>();
var q = store[user]; while(q.Count > 0 && q.Peek() < DateTime.Now - window) q.Dequeue(); if(q.Count >= limit)
return false; q.Enqueue(DateTime.Now); return true;
}
} Prevents abuse such as excessive requests, bots, and denial-of-service attempts.

Real-world example (ShopNest)

Answer with: definition → one ShopNest-style story → trade-off → how you would verify it in production.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Permalink & share
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details