Skip to content

Instantly share code, notes, and snippets.

@spinningcat
Created September 2, 2025 08:31
Show Gist options
  • Select an option

  • Save spinningcat/4dd0df721ca6feeab8e0d26be86a63aa to your computer and use it in GitHub Desktop.

Select an option

Save spinningcat/4dd0df721ca6feeab8e0d26be86a63aa to your computer and use it in GitHub Desktop.
🔹 1. C# / .NET Technical Questions
What is the difference between .NET Framework and .NET Core? When would you choose one over the other?
How do you implement dependency injection in .NET Core? Why is it useful?
Explain the difference between Task, Thread, and async/await in C#. Provide a small code example.
How would you design a REST API in .NET Core for high availability?
What is the difference between IEnumerable, ICollection, and IQueryable in C#?
Sample coding task:
Write a C# method that takes a list of integers and returns the top 3 most frequent numbers. Optimize for performance.
🔹 2. Databases & ORM
What are the trade-offs between using relational databases (PostgreSQL, Oracle) and columnar databases (ClickHouse)?
Explain ACID transactions. How does concurrency affect them in a multi-threaded backend system?
How would you design a schema for storing network performance metrics (e.g., 5G cell tower KPIs) where queries require fast aggregation?
What’s the difference between lazy loading and eager loading in Entity Framework (ORM)?
Sample SQL task:
Given a table NetworkEvents(event_id, cell_id, timestamp, dropped_calls), write an SQL query to find the top 5 cells with the highest average dropped calls in the last 24 hours.
🔹 3. System Design / Scalability
If millions of mobile network events arrive per minute, how would you design the backend to ingest, process, and store them efficiently?
How would you implement caching in a .NET backend to reduce DB load? Which libraries or patterns would you use?
What are the pros and cons of microservices vs. monolithic architecture in telecom applications?
How do you ensure backward compatibility when deploying new API versions?
🔹 4. Concurrency & Performance
Explain optimistic vs. pessimistic locking in databases. When would you use each?
How would you debug and fix a deadlock issue in a multi-threaded C# application?
What’s the difference between parallelism and asynchronous programming in backend systems?
🔹 5. DevOps / CI/CD
How would you design a CI/CD pipeline for a backend system deployed in multiple environments (dev, staging, production)?
What steps would you take to automatically roll back a deployment if errors are detected?
Which logging and monitoring tools would you integrate for backend services?
🔹 6. Situational / Scenario-Based
A customer reports that after a new deployment, API response times doubled. Walk me through how you would investigate and fix this.
A junior developer introduces inefficient LINQ queries that slow down performance. How would you handle this as a senior dev?
You’re asked to integrate a new database (ClickHouse) into an existing .NET backend that currently uses PostgreSQL. What are your first steps?
-------------------------------
🔹 Part 1 – Multiple Choice (Knowledge & Concepts)
Q1. In .NET Core, what is the main benefit of dependency injection?
A) It makes applications faster
B) It improves testability and maintainability
C) It avoids using async/await
D) It eliminates database transactions
Q2. Which of the following best describes a columnar database (e.g., ClickHouse)?
A) Stores data row by row, optimized for OLTP transactions
B) Stores data column by column, optimized for analytical queries
C) Stores data in JSON documents, flexible schema
D) Stores data in distributed key-value pairs
Q3. In C#, what is the difference between IEnumerable and IQueryable?
A) IEnumerable executes queries on the server, IQueryable executes locally
B) IEnumerable is evaluated immediately, IQueryable can defer execution to the database
C) IEnumerable supports filtering, IQueryable does not
D) They are interchangeable
Q4. Which is an example of optimistic concurrency control?
A) Locking a row in the database until a transaction completes
B) Allowing multiple transactions and checking for conflicts before committing
C) Forcing single-threaded execution
D) Using stored procedures only
Q5. In CI/CD pipelines, what is the purpose of blue-green deployment?
A) Ensuring only one developer can push at a time
B) Running two versions of the app simultaneously to allow instant rollback
C) Avoiding the need for tests
D) Encrypting the deployment artifacts
🔹 Part 2 – Short Answer (Reasoning & Problem Solving)
Q6. You deploy a new API and suddenly response times double. What steps would you take to investigate the root cause?
Q7. A junior developer writes a LINQ query that pulls all records into memory before filtering. How would you improve this?
🔹 Part 3 – Coding Challenge (C#)
Q8. Write a C# method that returns the top 3 most frequent integers in a given list.
Example:
Input → [1,1,2,3,3,3,4,5,5,5]
Output → [3, 5, 1]
public List<int> Top3Frequent(List<int> numbers)
{
// Your code here
}
Q9. Write an async C# function that fetches data from two APIs in parallel and returns the combined result as a single list.
(Hint: use Task.WhenAll)
🔹 Part 4 – SQL Challenge
Q10. Given this table:
NetworkEvents(event_id, cell_id, timestamp, dropped_calls)
Write a SQL query to find the top 5 cells with the highest average dropped calls in the last 24 hours.
Q11. You need to store millions of network performance metrics per minute. Which type of database would you choose and why? (Relational vs Columnar)
🔹 Part 5 – Scenario / Architecture
Q12. You are tasked with designing a backend system to process real-time 5G network data from thousands of cell towers.
How would you design the data ingestion pipeline?
How would you ensure the system is scalable and fault-tolerant?
✅ That’s your mock assessment. If you practice answering these, you’ll be ready for both theory and applied problem-solving in TestGorilla or a technical interview.
🔹 Candidate Set 2 – Focus: C# & Concurrency
Q1. Explain the difference between lock, Monitor, and SemaphoreSlim in C#.
Q2. What’s the difference between synchronous and asynchronous I/O in .NET?
Q3. Write a C# method using async/await that downloads data from a URL.
Q4. A multithreaded C# program throws a deadlock. How do you debug it?
Q5. When should you use ConcurrentDictionary over a normal Dictionary in C#?
🔹 Candidate Set 3 – Focus: Databases
Q1. Explain the difference between indexes in PostgreSQL vs ClickHouse.
Q2. Write an SQL query to get the second highest salary from an Employees table.
Q3. What’s the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN?
Q4. How would you optimize a query that is scanning millions of rows unnecessarily?
Q5. What are the trade-offs of using stored procedures vs ORM queries?
🔹 Candidate Set 4 – Focus: System Design
Q1. Design a backend system to handle 100k requests/second for real-time analytics.
Q2. How would you design an API rate-limiting mechanism?
Q3. What’s the difference between message queues (Kafka/RabbitMQ) and REST APIs for system integration?
Q4. How would you implement caching to reduce DB load?
Q5. What’s the role of circuit breakers in distributed systems?
🔹 Candidate Set 5 – Focus: CI/CD & Testing
Q1. Explain the difference between unit tests, integration tests, and end-to-end tests.
Q2. How would you set up a CI/CD pipeline for a .NET backend with Docker?
Q3. What’s the difference between blue-green deployment and canary release?
Q4. How would you integrate static code analysis (SonarQube, StyleCop) in a pipeline?
Q5. How do you test a system that must handle network failures gracefully?
🔹 Candidate Set 6 – Focus: Situational / Problem-Solving
Q1. A production database is running slow after deployment. Walk me through your debugging steps.
Q2. Your API returns inconsistent results under heavy load. What’s your plan to fix it?
Q3. A teammate suggests rewriting an old monolith into microservices. What questions would you ask before agreeing?
Q4. Management wants to cut deployment time in half. How do you approach this without hurting quality?
Q5. A bug was introduced because of poorly documented code. How would you prevent this in the future?
Relational (PostgreSQL/Oracle):
Write a query to find the top 5 users with the highest total purchases in the last 30 days.
Explain the difference between ACID transactions and how PostgreSQL ensures them.
How would you optimize a slow query that uses multiple JOINs?
Difference between index scan and sequential scan?
How would you implement foreign keys and why?
Columnar (ClickHouse):
Why would you choose a columnar database for storing billions of network events?
What’s the difference between row-oriented and column-oriented storage?
How does ClickHouse achieve fast aggregations?
What are materialized views in ClickHouse, and when would you use them?
If you had to store real-time 5G network KPIs, how would your schema differ between PostgreSQL and ClickHouse?
You have a table NetworkEvents(event_id, cell_id, timestamp, dropped_calls).
Write an SQL query to get the top 5 cells with the highest average dropped calls in the last 24 hours.
Then explain how you would optimize this query for billions of rows (indexes, partitioning, columnar DB choice).
I’ll split them into 3 sections:
Relational SQL Queries (PostgreSQL/Oracle style)
Performance, Transactions & Indexing
Columnar DB Concepts (ClickHouse style)
📝 SQL Practice Set for Backend Developer Role
🔹 Section 1 – Relational SQL Queries
You have a table Users(user_id, name, signup_date) and Orders(order_id, user_id, amount, created_at).
Write a query to find the top 5 users by total order amount in the last 30 days.
Write a query to find the second highest salary from a table Employees(emp_id, salary).
Given a table NetworkEvents(event_id, cell_id, timestamp, dropped_calls), write a query to:
Count the total dropped calls per cell_id in the last 24 hours.
Return only cells with more than 100 dropped calls.
You have Products(product_id, category, price) and Sales(sale_id, product_id, quantity, sale_date).
Write a query to calculate the average revenue per category in the last quarter.
Write a query to find duplicate rows in a table Customers(customer_id, email).
🔹 Section 2 – Performance, Transactions & Indexing
What’s the difference between clustered and non-clustered indexes in relational databases?
How would you troubleshoot a slow SQL query? (List at least 3 techniques/tools).
Explain the difference between:
ACID transactions
Eventual consistency
Give a backend scenario where each is appropriate.
You are dealing with a high-concurrency system where multiple updates happen on the same row.
Explain optimistic vs pessimistic locking with an SQL example.
How does PostgreSQL handle deadlocks? What’s the strategy to prevent them?
🔹 Section 3 – Columnar DB (ClickHouse)
Explain the difference between row-oriented (PostgreSQL) and column-oriented (ClickHouse) storage.
Which would you use for real-time analytics on billions of rows and why?
Write a ClickHouse-style query:
You have NetworkMetrics(cell_id, timestamp, latency, throughput).
Find the average latency per cell in the last 1 hour.
Return only the top 10 worst-performing cells.
In ClickHouse, what are MergeTree tables? Why are they important for time-series data like 5G KPIs?
Explain materialized views in ClickHouse.
How could they help in building real-time network monitoring dashboards?
Suppose you need to store 10 billion call records. How would you decide between:
PostgreSQL with indexes + partitioning
ClickHouse with columnar compression
Walk through the trade-offs.
✅ That’s 15 SQL-focused questions that touch on:
Writing efficient relational queries
Database performance, indexing & transactions
Columnar DB design and use cases
🔹 1. Reverse a String
Write a function to reverse a string without using Array.Reverse().
public string ReverseString(string input)
{
// Your code here
}
🔹 2. Palindrome Check
Check if a given string is a palindrome (ignoring spaces and case).
public bool IsPalindrome(string input)
{
// Your code here
}
🔹 3. Count Characters
Write a method that counts how many times each character appears in a string.
public Dictionary<char, int> CountChars(string input)
{
// Your code here
}
🔹 4. FizzBuzz
Print numbers 1–100, but for multiples of 3 print "Fizz", for 5 print "Buzz", and for 3 & 5 print "FizzBuzz".
public void FizzBuzz()
{
// Your code here
}
🔹 5. Find Duplicates in an Array
Return all duplicate numbers in an integer array.
public List<int> FindDuplicates(int[] numbers)
{
// Your code here
}
🔹 6. Top N Frequent Elements
Given a list of integers, return the top 3 most frequent numbers.
public List<int> Top3Frequent(List<int> numbers)
{
// Your code here
}
🔹 7. Async/Await Example
Write an async method that fetches two URLs in parallel and returns their combined content.
public async Task<string> FetchDataAsync(string url1, string url2)
{
// Your code here
}
🔹 8. LINQ Query
Given a list of employees with Name and Salary, return the names of employees earning more than 50,000, sorted by salary descending.
public List<string> HighEarners(List<Employee> employees)
{
// Your code here
}
🔹 9. Remove Duplicates from a Linked List
Given a singly linked list, remove duplicate values.
public ListNode RemoveDuplicates(ListNode head)
{
// Your code here
}
🔹 10. Thread-Safe Counter
Implement a thread-safe counter class with Increment() and GetValue() methods.
public class SafeCounter
{
private int count = 0;
public void Increment()
{
// Your code here
}
public int GetValue()
{
// Your code here
}
}
🔹 Strings & Arrays
Write a method to check if two strings are anagrams.
Implement a function that finds the first non-repeated character in a string.
Rotate an array by k positions (e.g., [1,2,3,4,5], k=2 → [4,5,1,2,3]).
Find the longest word in a given sentence.
Count how many vowels are in a string.
🔹 Collections & LINQ
From a list of integers, return only the even numbers, sorted ascending.
Given a list of employees with Department and Salary, find the average salary per department.
Find the most common word in a list of strings.
Merge two sorted arrays into one sorted array.
Group a list of people by age range (<20, 20–40, 40+).
🔹 Algorithms
Implement binary search on a sorted integer array.
Write a function to compute the factorial of a number using recursion.
Implement Fibonacci sequence using memoization.
Find the maximum subarray sum (Kadane’s Algorithm).
Write a function that checks if a bracket sequence is valid (balanced parentheses).
🔹 Object-Oriented
Design a BankAccount class with Deposit, Withdraw, and GetBalance methods. Ensure withdrawals can’t exceed the balance.
Create an interface IVehicle with methods Start and Stop. Implement it in Car and Bike classes.
Implement a Shape abstract class with derived classes Circle and Rectangle that calculate Area().
Create a Singleton class in C# (thread-safe).
Implement a Publisher-Subscriber pattern with events in C#.
1. What are web components and how do they promote code reusability?
2. Can you explain the box model in CSS and how it affects layout?
3. How does event delegation in JavaScript improve performance and maintainability?
Event delegation involves attaching a single event listener to a parent element rather than adding event listeners to multiple child elements.
4. Explain the difference between Flexbox and Grid in CSS.
5. What are service workers and how can they be used to improve web application performance?
6. Describe a project where you implemented responsive design. What were the biggest challenges?
7. How do you approach debugging a JavaScript issue that only appears in certain browsers?
1. What are the differences between monolithic and microservices architectures?
2. What are some best practices for creating a RESTful API in Node.js?
3. What is Object-Relational Mapping (ORM)? Give examples of ORM frameworks.
4. Can you explain the concept of dependency injection and its benefits?
5. What are the benefits and drawbacks of using GraphQL over REST?
6. Describe a situation where you had to optimize server performance. What strategies did you use?
Here, candidates should explain their diagnostic process and the optimization strategies they used.
7. How would you refactor a legacy back-end system?
Which technical skills do backend developers need to have?
Which soft skills do backend developers need to be successful?
Name the main backend development responsibilities you had in your previous role.
Which backend developer skills do you lack? How are you trying to improve?
Which is your favorite programming language?
Which programming language is your least favorite?
How are web services beneficial?
What are the advantages of using Go?
Explain the advantages of microservice architecture.
Describe your experience working as a part of a team.
What do you hope to have achieved in three years?
How would your current co-workers describe you?
Which method do you use to remain up-to-date with the latest trends in backend development?
Describe your greatest coding strength.
Explain how your coding career began.
How do you receive and make use of negative feedback as a backend developer?
How do you share negative feedback with your co-workers?
Describe your object-oriented programming experience.
Explain what NoSQL databases are.
Define containerization.
Name four different examples of NoSQL databases.
Explain and define the CAP theorem.
Explain what SQL injection is.
Explain what continuous integration is.
Explain what REST means in backend development.
Explain the difference between software design and architecture.
Explain what JavaScript is. When do developers and engineers use it?
Explain what acceptance tests are.
Explain what functional tests are.
How are acceptance tests different from functional tests?
Explain what high availability refers to.
Explain and define the ACID acronym.
Explain and define “session affinity.”
Name some disadvantages of REST web services.
Explain what clustered indexes are.
Explain what non-clustered indexes are.
Explain how non-clustered and clustered indexes are different.
Explain what continuous integration is.
Explain what continuous delivery is.
Explain what continuous deployment is.
Explain what monolithic architecture is.
Explain what service-oriented architecture is.
Explain what microservice architecture is.
Explain what the API Gateway pattern is.
Explain what SSL is.
Explain how SSL works.
Explain how b-trees indexes work.
Explain distributed transactions.
Explain what a God class is.
Explain what spike testing refers to.
Can you explain what the base property of systems is?
Explain what faking refers to in backend development.
Explain what mocking refers to in backend development.
Explain what stubbing refers to in backend development.
Explain why application layering is crucial.
Explain what “stack” is in backend development.
Explain what “heap” is in backend development.
Explain what stack overflow refers to.
Explain what cohesion refers to.
Describe your debugging process.
Which method would you use to locate expensive queries on a server?
Which method would you use to prevent SQL injection risks?
Name the steps you would take to complete performance testing processes.
Which best practices would you follow as part of the performance testing process?
In which situation would you use Redis?
In which situation would you use MongoDB?
Which method would you use to implement SSO authentication for microservices?
Which method would you use to handle large amounts of data with limited memory?
Which method would you use to handle the API versioning of web services?
In which situation would you implement asynchronous communication with different systems?
Describe your best project. What made it successful? Were there any challenges?
Have you ever encountered a major roadblock when working on a project? How did you handle it?
Explain async/await in C# and give an example of when you would use it.
How do you prevent race conditions in a multi-threaded backend service?
Write a LINQ query to find the top 3 highest-paid employees.
How would you design a retry mechanism for a failed API call?
Describe a time you had to optimize a database query that was causing slow response times.
How would you implement caching for frequently requested data in a .NET backend?
How would you handle API versioning without breaking existing clients?
Explain JWT authentication and how it differs from session-based auth.
How do you design a system for real-time processing of high-volume data streams?
What’s your approach to logging and monitoring in a distributed microservices architecture?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment