Top SQL Azure Interview Questions to Ace Your Interview
Azure SQL interview questions typically blend general SQL/database knowledge with Azure-specific concepts around deployment, scaling, and management.
Core Azure SQL Concepts
- What is Azure SQL Database? — a fully managed relational database service built on the SQL Server engine, handling patching, backups, and high availability automatically
- What's the difference between Azure SQL Database and SQL Managed Instance? — SQL Database is a simpler, single/elastic-pool PaaS offering, while Managed Instance offers near-complete SQL Server compatibility for easier migrations
- What are DTUs and vCores? — two different pricing/performance models for Azure SQL Database, with DTUs bundling compute, storage, and IO into a single unit, and vCores allowing independent scaling
Performance and Reliability
- How does Azure SQL Database handle high availability? — through built-in redundancy and automatic failover, with options for zone-redundant configurations
- What is elastic pool used for? — sharing resources across multiple databases with variable usage patterns to optimize cost
- How would you troubleshoot slow query performance? — using Query Performance Insight, examining execution plans, and reviewing index usage
Security
- How do you secure an Azure SQL Database? — using firewall rules, Azure AD authentication, transparent data encryption, and auditing
Tips for the Interview
- Be ready to write or explain basic T-SQL queries, since SQL fundamentals often come up alongside Azure-specific questions
- Understand backup and point-in-time restore options, as they're commonly asked about
Ready to master Microsoft Azure?
Join Microsoft Azure Training Course at Uncodemy and learn with hands-on projects and mentor support.
Deployment and Scaling Questions
What is the serverless compute tier?
Serverless is a vCore option for a single database where compute scales automatically between a minimum and maximum you set, and the database can pause during idle periods. It suits development databases and apps with unpredictable, intermittent use. Mention that the first connection after a pause takes a little longer while the database resumes.
When would you choose Hyperscale?
Hyperscale separates compute from a distributed storage layer, so it handles very large databases, fast backups and quick scale-out of read replicas. Choose it when a database is expected to grow well beyond what other tiers comfortably handle or when you need several readable secondaries.
Active geo-replication versus failover groups?
Geo-replication creates readable secondaries of individual databases in other regions, and failover is triggered per database. A failover group wraps one or more databases and gives you listener endpoints that keep the same connection string after failover, which makes application changes unnecessary. Interviewers like candidates who explain this connection-string benefit.
Security and Compliance Questions
- TDE vs Always Encrypted: Transparent Data Encryption protects data files and backups at rest and is on by default. Always Encrypted keeps chosen columns encrypted even from database administrators, because keys stay with the client application.
- Dynamic data masking: hides parts of sensitive values, such as showing only the last four digits of a phone number, to users without unmask permission. It does not encrypt the stored data.
- Row-level security: uses a predicate function so each user sees only the rows they are allowed to see, for example only their own branch.
- Microsoft Entra ID authentication: lets users and managed identities sign in without SQL passwords, and supports multi-factor authentication.
Expect to write a statement or two. These are common ones:
-- Database-level firewall rule (run inside the user database)
EXECUTE sp_set_database_firewall_rule N'OfficeNetwork', '203.0.113.10', '203.0.113.10';
-- Contained user for an Entra ID identity
CREATE USER [reporting-app] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [reporting-app];
Scenario Questions and How to Answer Them
"Queries became slow after a release. What do you check?"
Walk through a sequence: look at Query Store for regressed queries and plan changes, compare resource usage against the service tier limits, review missing index suggestions, and check for blocking. Then explain the fix, such as forcing the last good plan in Query Store while the code is corrected.
SELECT TOP 5 qt.query_sql_text,
rs.avg_duration, rs.count_executions
FROM sys.query_store_runtime_stats rs
JOIN sys.query_store_plan p ON rs.plan_id = p.plan_id
JOIN sys.query_store_query q ON p.query_id = q.query_id
JOIN sys.query_store_query_text qt ON q.query_text_id = qt.query_text_id
ORDER BY rs.avg_duration DESC;
"Someone deleted rows by mistake an hour ago."
Describe a point-in-time restore to a new database, then copying the missing rows back. Stress that a restore never overwrites the live database, which keeps the recovery safe.
"How would you migrate an on-premises SQL Server?"
Assess compatibility first with Azure migration tooling, pick SQL Database or Managed Instance based on features like SQL Agent jobs or cross-database queries, then choose an online or offline migration depending on allowed downtime.
Preparation Pitfalls
- Quoting exact limits or prices from memory; say you would confirm them in current documentation.
- Mixing up a logical server (a management boundary) with a physical machine.
- Forgetting that some SQL Server features, such as SQL Agent, exist in Managed Instance but not in single databases.
- Giving feature lists without a reason; always link a feature to the problem it solves.