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 326–350 of 364

Career & HR topics

By tech stack

Popular tracks

Senior PDF
Design a Microservices Architecture in Azure?

Short answer: for a Real Product Strong Answer (Architecture Thinking) In production, I design microservices with independent scalability, loose coupling, and resilience. Explain a bit more Real-world Scenario: E-commerc…

Azure Read answer
Senior PDF
Design a Microservices Architecture in Azure for a Real Product Strong Answer (Architecture Thinking) In production, I design microservices with independent scalability, loose coupling, and resilience. Real-world Scenario: E-commerce Platform Services: ● Order Service (ASP.NET Core API) ● Payment Service ● Inventory Service ● Notification Service

Short answer: zure Architecture: API Gateway → Azure API Management Services → Azure App Service / Containers Communication → Azure Service Bus (async) Database → Azure SQL (per service) Cache → Azure Redis Monitoring →…

Azure Read answer
Senior PDF
When to use Azure Kubernetes Service (AKS) vs App Service?

Short answer: dvanced insight: KS adds: Complexity Operational overhead 👉 Don’t use AKS unless required Real-world example (ShopNest) ShopNest’s API runs on Azure App Service with staging slots—swap staging to productio…

Azure Read answer
Senior PDF
How do you handle Distributed Transactions in Microservices?

Short answer: Strong Answer Distributed transactions are handled using eventual consistency, not traditional DB transactions. Solution Pattern: Saga Pattern Real-world Example: Order process: Say this in the interview De…

Azure Read answer
Senior PDF
How do you monitor microservices in Azure?

Short answer: Strong Answer Tools: Application Insights Azure Monitor Log Analytics What I track: Request latency Failure rate Dependency calls Real-world Example: Detected slow API: Found DB query bottleneck Fixed index…

Azure Read answer
Senior PDF
How do you monitor microservices in Azure?

Short answer: dvanced insight: Implement distributed tracing Use correlation IDs Real-world example (ShopNest) ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitor…

Azure Read answer
Senior PDF
How do you implement caching in distributed systems?

Short answer: Strong Answer Strategy: Use Azure Redis Cache Real-world Example code Product catalog API: Cache frequently accessed data TTL = 5 minutes Advanced patterns: Cache-aside pattern Write-through caching Intervi…

Azure Read answer
Senior PDF
How do you implement caching in distributed systems?

Short answer: dvanced patterns: Cache-aside pattern Write-through caching Interview tip: Mention: “Cache invalidation is hardest problem” Real-world example (ShopNest) ShopNest on Azure typically uses App Service + SQL D…

Azure Read answer
Senior PDF
How do you handle failures in distributed systems?

Short answer: Strong Answer Patterns: Retry (Polly) Circuit breaker Fallback Dead-letter queue Real-world Example: Payment service failure handled via retries + DLQ Say this in the interview Define — one clear sentence (…

Azure Read answer
Senior PDF
Mock Interview Scenario — “Design a Scalable Order System” Interviewer: “Design an order processing system using Azure for high traffic.” Weak Answer (Most candidates give): “I will use App Service, SQL Database, and Service Bus.” 👉 Rejected immediately (too generic) Strong Answer (What gets selected): I would design the system using event-driven microservices architecture to ensure scalability

Short answer: And fault tolerance. rchitecture: API Layer → Azure App Service Order DB → Azure SQL Messaging → Azure Service Bus Background processing → Azure Functions Cache → Redis Monitoring → Application Insights Flo…

Azure Read answer
Senior PDF
Common Resume Mistakes (REJECTION REASONS) Mistakes: ● Listing tools without usage ● No measurable results ● No architecture explanation ● No cloud-specific implementation Fix:

Short answer: lways include: Action + Technology + Result Real-world example (ShopNest) ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring. Say this in the in…

Azure Read answer
Senior PDF
Real Interview Question “Explain your Azure project” Strong Answer: I worked on a microservices-based system where we used Azure App Service for hosting

Short answer: PIs, Service Bus for async communication, Redis for caching, and Key Vault for secure secret management. We also implemented CI/CD pipelines and reduced API latency significantly. Real-world example (ShopNe…

Azure Read answer
Senior PDF
How do you enable distributed tracing?

Short answer: Distributed tracing tracks requests across services and microservices. Application Insights supports W3C trace context. Example in ASP.NET Core: builder.Services.AddApplicationInsightsTelemetry(options =&gt…

Azure Read answer
Senior PDF
What is a recommended architecture for serverless APIs?

Short answer: Azure Functions for business logic API Management as gateway Azure Storage / Cosmos DB for persistence Application Insights for monitoring Event Grid / Service Bus for event-driven communication Real-world…

Azure Read answer
Senior PDF
What is DNS-based service discovery, and how does it work in microservices?

Short answer: ddresses. It simplifies service discovery by relying on existing DNS infrastructure and ensuring that microservices can dynamically find each other without hardcoding addresses. How it works: Service Regist…

Microservices Read answer
Senior PDF
How do you secure microservices using Azure services?

Short answer: Use Azure AD for authentication and authorization. Protect APIs with OAuth 2.0 / JWT tokens. Use API Management to enforce policies like rate limiting. Enable Private Endpoints / VNET integration for networ…

Azure Read answer
Senior Detailed
Write a recursive CTE for an employee–manager hierarchy.

Short answer: Anchor member selects the root manager; recursive member joins employees whose ManagerId equals the CTE EmpId. UNION ALL combines them. Watch MAXRECURSION. Sample solution T-SQL WITH Hierarchy AS ( SELECT E…

Senior Detailed
What is CROSS APPLY vs OUTER APPLY?

Short answer: APPLY invokes a table-valued expression per outer row. CROSS APPLY is like INNER JOIN (outer row must produce rows). OUTER APPLY is like LEFT JOIN (keeps outer rows with NULLs). Useful for TOP N per group a…

APPLY Read answer
Senior Detailed
Write a MERGE statement example for upsert.

Short answer: MERGE matches source to target ON a key, then WHEN MATCHED UPDATE, WHEN NOT MATCHED INSERT. Discuss concurrency and that some teams prefer separate UPDATE/INSERT. Sample solution T-SQL MERGE INTO Employees…

Senior Detailed
How do you find consecutive login days in SQL Server?

Short answer: Gaps-and-islands: ROW_NUMBER() ordered by date, subtract from date to form an island key, then GROUP BY user + island key and count days. Sample solution T-SQL WITH d AS ( SELECT UserId, LoginDate, DATEADD(…

Gaps & Islands Read answer
Senior Career Detailed
What skills should I add to my resume?

Short answer: Add skills that are both role-relevant and demonstrably used in your projects or experience. Recruiters quickly reject skill lists that look inflated or disconnected from work history. Curate for depth and…

Resume & ATS Read answer
Senior Career Detailed
How to optimize a resume for ATS?

Short answer: ATS optimization is about semantic match and parse accuracy. You need relevant keywords, standard structure, and clear chronology so screening systems score your profile correctly. Optimization should impro…

Resume & ATS Read answer
Senior Career Detailed
Resume mistakes to avoid?

Short answer: Most resume rejection happens due to preventable errors: irrelevance, weak evidence, and formatting noise. A clean, targeted resume with quantified outcomes wins more interviews than a lengthy generic docum…

Resume & ATS Read answer
Senior
How do you find customers who ordered every month in a year?

Short answer: Filter orders to the year, group by customer, and HAVING COUNT(DISTINCT month) = 12. Sample solution T-SQL SELECT CustomerId FROM Orders WHERE OrderDate >= '2025-01-01' AND OrderDate < '2026-01-01' GR…

GROUP BY & HAVING Read answer
Senior
Write a query to get the median salary in SQL Server.

Short answer: Use PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Salary) OVER (), or pick middle ROW_NUMBER values for odd/even counts. Sample solution T-SQL SELECT DISTINCT PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Salar…

Window Functions Read answer

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: for a Real Product Strong Answer (Architecture Thinking) In production, I design microservices with independent scalability, loose coupling, and resilience.

Explain a bit more

Real-world Scenario: E-commerce Platform Services: Order Service (ASP.NET Core API) Payment Service Inventory Service Notification Service Azure Architecture: API Gateway → Azure API Management Services → Azure App Service / Containers Communication → Azure Service Bus (async) Database → Azure SQL (per service) Cache → Azure Redis Monitoring → Application Insights Flow:

Example code

for a Real Product Strong Answer (Architecture Thinking) In production, I design microservices with independent scalability, loose coupling, and resilience. Real-world Scenario: E-commerce Platform Services: Order Service (ASP.NET Core API) Payment Service Inventory Service Notification Service Azure Architecture: API Gateway → Azure API Management Services → Azure App Service / Containers Communication → Azure Service Bus (async) Database → Azure SQL (per service) Cache → Azure Redis Monitoring → Application Insights Flow:

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: zure Architecture: API Gateway → Azure API Management Services → Azure App Service / Containers Communication → Azure Service Bus (async) Database → Azure SQL (per service) Cache → Azure Redis Monitoring → Application Insights Flow:

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: dvanced insight: KS adds: Complexity Operational overhead 👉 Don’t use AKS unless required

Real-world example (ShopNest)

ShopNest’s API runs on Azure App Service with staging slots—swap staging to production after smoke tests.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Strong Answer Distributed transactions are handled using eventual consistency, not traditional DB transactions. Solution Pattern: Saga Pattern Real-world Example: Order process:

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Strong Answer Tools: Application Insights Azure Monitor Log Analytics What I track: Request latency Failure rate Dependency calls Real-world Example: Detected slow API: Found DB query bottleneck Fixed indexing Advanced insight: Implement distributed tracing Use correlation IDs

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: dvanced insight: Implement distributed tracing Use correlation IDs

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Strong Answer Strategy: Use Azure Redis Cache Real-world

Example code

Product catalog API: Cache frequently accessed data TTL = 5 minutes Advanced patterns: Cache-aside pattern Write-through caching Interview tip: Mention: “Cache invalidation is hardest problem”

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: dvanced patterns: Cache-aside pattern Write-through caching Interview tip: Mention: “Cache invalidation is hardest problem”

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Strong Answer Patterns: Retry (Polly) Circuit breaker Fallback Dead-letter queue Real-world Example: Payment service failure handled via retries + DLQ

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: And fault tolerance. rchitecture: API Layer → Azure App Service Order DB → Azure SQL Messaging → Azure Service Bus Background processing → Azure Functions Cache → Redis Monitoring → Application Insights Flow:

Real-world example (ShopNest)

ShopNest’s API runs on Azure App Service with staging slots—swap staging to production after smoke tests.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: lways include: Action + Technology + Result

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: PIs, Service Bus for async communication, Redis for caching, and Key Vault for secure secret management. We also implemented CI/CD pipelines and reduced API latency significantly.

Real-world example (ShopNest)

ShopNest’s API runs on Azure App Service with staging slots—swap staging to production after smoke tests.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Distributed tracing tracks requests across services and microservices. Application Insights supports W3C trace context. Example in ASP.NET Core: builder.Services.AddApplicationInsightsTelemetry(options => {

Example code

options.EnableDependencyTrackingTelemetryModule = true; });

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Azure Functions for business logic API Management as gateway Azure Storage / Cosmos DB for persistence Application Insights for monitoring Event Grid / Service Bus for event-driven communication

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

Microservices Microservices with .NET · Microservices

Short answer: ddresses. It simplifies service discovery by relying on existing DNS infrastructure and ensuring that microservices can dynamically find each other without hardcoding addresses. How it works: Service Registration: Each microservice registers its IP address and port with a DNS resolver or service registry. Service Lookup: When a microservice… needs to……… communicate with another, it queries the DNS for the service's…

Explain a bit more

name (e.g., service-name.namespace.svc.cluster.local in Kubernetes), which returns the corresponding IP address. Dynamic Updates: As new service instances are added or removed, DNS entries re automatically updated. Example: Kubernetes uses CoreDNS for service discovery, where each microservice gets a DNS name that resolves to the service's IP.

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

Microsoft Azure Microsoft Azure Tutorial · Azure

Short answer: Use Azure AD for authentication and authorization. Protect APIs with OAuth 2.0 / JWT tokens. Use API Management to enforce policies like rate limiting. Enable Private Endpoints / VNET integration for network isolation.

Real-world example (ShopNest)

ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.

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

SQL & Databases SQL Server Tutorial · CTE

Short answer: Anchor member selects the root manager; recursive member joins employees whose ManagerId equals the CTE EmpId. UNION ALL combines them. Watch MAXRECURSION.

Sample solution

T-SQL
WITH Hierarchy AS (
    SELECT EmpId, ManagerId, Name, 0 AS Lvl
    FROM Employees
    WHERE ManagerId IS NULL   -- root
    UNION ALL
    SELECT e.EmpId, e.ManagerId, e.Name, h.Lvl + 1
    FROM Employees e
    INNER JOIN Hierarchy h ON e.ManagerId = h.EmpId
)
SELECT * FROM Hierarchy
ORDER BY Lvl, Name
OPTION (MAXRECURSION 100);

Edge cases to mention

  • Cycles in hierarchy
  • Multiple roots
  • Deep trees hitting recursion limit
Say “anchor + recursive member + termination” — that structure is the interview checklist.
Permalink & share

SQL & Databases SQL Server Tutorial · APPLY

Short answer: APPLY invokes a table-valued expression per outer row. CROSS APPLY is like INNER JOIN (outer row must produce rows). OUTER APPLY is like LEFT JOIN (keeps outer rows with NULLs). Useful for TOP N per group and TVFs.

Sample solution

T-SQL
-- Top 2 orders per customer
SELECT c.CustomerId, c.Name, o.OrderId, o.Amount
FROM Customers c
CROSS APPLY (
    SELECT TOP (2) OrderId, Amount
    FROM Orders o
    WHERE o.CustomerId = c.CustomerId
    ORDER BY Amount DESC
) o;
TOP N per group via CROSS APPLY is a classic SQL Server interview flex.
Permalink & share

SQL & Databases SQL Server Tutorial · DML

Short answer: MERGE matches source to target ON a key, then WHEN MATCHED UPDATE, WHEN NOT MATCHED INSERT. Discuss concurrency and that some teams prefer separate UPDATE/INSERT.

Sample solution

T-SQL
MERGE INTO Employees AS t
USING (SELECT @EmpId AS EmpId, @Name AS Name, @Salary AS Salary) AS s
ON t.EmpId = s.EmpId
WHEN MATCHED THEN
    UPDATE SET Name = s.Name, Salary = s.Salary
WHEN NOT MATCHED THEN
    INSERT (EmpId, Name, Salary) VALUES (s.EmpId, s.Name, s.Salary);
Know that MERGE has historically had race/edge-case caveats — saying so shows maturity.
Permalink & share

SQL & Databases SQL Server Tutorial · Gaps & Islands

Short answer: Gaps-and-islands: ROW_NUMBER() ordered by date, subtract from date to form an island key, then GROUP BY user + island key and count days.

Sample solution

T-SQL
WITH d AS (
    SELECT UserId, LoginDate,
           DATEADD(DAY, -ROW_NUMBER() OVER (PARTITION BY UserId ORDER BY LoginDate), LoginDate) AS grp
    FROM UserLogins
)
SELECT UserId, MIN(LoginDate) AS StartDate, MAX(LoginDate) AS EndDate, COUNT(*) AS Days
FROM d
GROUP BY UserId, grp
HAVING COUNT(*) >= 3;
Naming “gaps and islands” immediately signals senior SQL fluency.
Permalink & share

Resume & ATS Career & HR Interview Guide · Resume & ATS

Short answer: Add skills that are both role-relevant and demonstrably used in your projects or experience. Recruiters quickly reject skill lists that look inflated or disconnected from work history. Curate for depth and relevance rather than volume.

Step-by-step approach

  1. Collect top 20 recurring skills from 10 target job descriptions.
  2. Mark skills you have production-level experience in versus learning-stage familiarity.
  3. Prioritize core stack, adjacent tools, and domain-specific capabilities.
  4. Ensure each critical skill appears in at least one project/experience bullet.
  5. Group skills into logical clusters like Languages, Frameworks, Cloud, and Data.
  6. Remove stale or irrelevant skills every quarter.

Real-world example

Neha listed 38 skills on her Flipkart resume, but many were unused in real projects. Arjun at Zoho asked her to keep only those she could defend in interviews and map each to shipped outcomes. Her skill section became shorter but more credible. Technical panels stopped probing basic contradictions and interviews improved.

Mistakes to avoid

  • Adding tools just because they are trending online.
  • Mixing beginner-level and expert-level skills without distinction.
  • Keeping skills unsupported by project evidence.
  • Ignoring domain skills like payments, security, or analytics context.
If you cannot discuss it deeply, do not list it.
Permalink & share

Resume & ATS Career & HR Interview Guide · Resume & ATS

Short answer: ATS optimization is about semantic match and parse accuracy. You need relevant keywords, standard structure, and clear chronology so screening systems score your profile correctly. Optimization should improve clarity, not turn your resume into keyword spam.

Step-by-step approach

  1. Collect must-have terms from target JD and prioritize them by frequency.
  2. Place critical keywords in Summary, Skills, and Experience where they fit naturally.
  3. Use consistent date and title formats to avoid parsing confusion.
  4. Remove decorative formatting, unusual fonts, and multi-column complexity.
  5. Validate with ATS checker and compare score changes across versions.
  6. Finalize only after both ATS score and human readability are strong.

Real-world example

Priya from Zoho had strong experience but ATS score stayed low for SDE-2 roles. Rahul helped her mirror JD terminology like "distributed systems," "message queues," and "observability" in relevant sections. She also simplified date formats and removed icon-heavy blocks. ATS match improved and she got shortlisted by two product companies.

Mistakes to avoid

  • Forcing exact keyword repetition unnaturally.
  • Using acronym-only skill names without expanded forms.
  • Ignoring section naming conventions ATS expects.
  • Optimizing for ATS and forgetting recruiter readability.

Toolliyo resources

ATS optimization should increase clarity, not clutter.
Permalink & share

Resume & ATS Career & HR Interview Guide · Resume & ATS

Short answer: Most resume rejection happens due to preventable errors: irrelevance, weak evidence, and formatting noise. A clean, targeted resume with quantified outcomes wins more interviews than a lengthy generic document. Review your resume like a recruiter with limited time.

Step-by-step approach

  1. Run a relevance audit and remove low-signal sections that do not support target role.
  2. Fix grammar, tense consistency, and formatting alignment issues.
  3. Replace vague responsibility bullets with measurable delivery outcomes.
  4. Check for ATS blockers like icons, columns, and broken date formats.
  5. Validate contact links and ensure all project URLs are active.
  6. Review with one technical peer and one recruiter-minded reviewer.

Real-world example

Karan’s resume from TCS had typo errors, broken links, and repeated bullets across two jobs. Isha from Razorpay helped him run a mistake checklist and rewrite impact lines with concrete metrics. He also removed outdated coursework and fixed ATS-unfriendly formatting. His shortlist ratio improved noticeably in the next application cycle.

Mistakes to avoid

  • Submitting resume without final proofreading pass.
  • Using copied bullet points from internet templates.
  • Keeping irrelevant legacy technologies for modern roles.
  • Ignoring broken links and incorrect contact details.
Small resume mistakes create big trust loss.
Permalink & share

SQL & Databases SQL Server Tutorial · GROUP BY & HAVING

Short answer: Filter orders to the year, group by customer, and HAVING COUNT(DISTINCT month) = 12.

Sample solution

T-SQL
SELECT CustomerId
FROM Orders
WHERE OrderDate >= '2025-01-01' AND OrderDate < '2026-01-01'
GROUP BY CustomerId
HAVING COUNT(DISTINCT DATEPART(MONTH, OrderDate)) = 12;
COUNT(DISTINCT month) is the key — COUNT(*) alone is wrong if multiple orders/month.
Permalink & share

SQL & Databases SQL Server Tutorial · Window Functions

Short answer: Use PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Salary) OVER (), or pick middle ROW_NUMBER values for odd/even counts.

Sample solution

T-SQL
SELECT DISTINCT
       PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY Salary) OVER () AS MedianSalary
FROM Employees;
PERCENTILE_CONT is continuous; PERCENTILE_DISC picks an actual data value.
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