Cognizant Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

6 real interview questions asked at Cognizant. Covers Data Engineering / PySpark, SQL / Joins, SQL / Indexing, SQL / Normalization, SQL / Window Functions, SQL / Query Optimization. Reported by engineers who went through the Cognizant process.

Questions Interview Guides
6 questions
141 engineers asked
205 upvotes

Data Engineering / PySpark (1)

Cognizant Medium Technical round 3–5 YearsPython

What is the difference between cache() and persist() in Spark? When should you use StorageLevel.MEMORY_AND_DISK?

↑ 76 upvotes · 59 engineers asked this · Data Engineer

SQL / Joins (1)

Cognizant Easy Technical round 0-3 yearsSQL

Explain the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN with a simple example of Orders and Customers tables.

↑ 30 upvotes · 22 engineers asked this · Developer

SQL / Indexing (1)

Cognizant Medium Technical round 2-5 yearsSQL

A SELECT query filtering on a non-indexed column takes 8 seconds on a 10 million row table. Would adding an index always help? What's the trade-off of adding too many indexes?

↑ 26 upvotes · 15 engineers asked this · Developer

SQL / Normalization (1)

Cognizant Medium Technical round 1-4 yearsSQL

What problem does database normalization (1NF, 2NF, 3NF) actually solve? Give an example of an update anomaly in an unnormalized table.

↑ 21 upvotes · 12 engineers asked this · Developer

SQL / Window Functions (1)

Cognizant Hard Technical round 2-6 yearsSQL

Write a query to find, for each department, the employee with the second-highest salary, using window functions instead of a correlated subquery.

↑ 33 upvotes · 25 engineers asked this · Developer

SQL / Query Optimization (1)

Cognizant Medium Technical round 2-5 yearsSQL

How would you find out why a specific SQL query is slow before making any changes to it?

↑ 19 upvotes · 8 engineers asked this · Developer

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

Cognizant interview guides by role

Cognizant Developer Guide

Cognizant questions by technology

Cognizant SQL

More companies

Amazon Google Microsoft Flipkart Swiggy Meta Apple Netflix Uber Airbnb Stripe Razorpay PhonePe Paytm Zomato Salesforce Oracle Adobe LinkedIn Atlassian Accenture Deloitte Wipro Infosys TCS Capgemini PayU General Anthropic OpenAI TikTok JPMorgan Walmart Spotify DoorDash Goldman Sachs Revolut Canva Capital One Lyft SAP Siemens Shopify Grab LTIMindtree Myntra Hotstar Twitter Snowflake

Frequently asked questions

What is the difference between cache() and persist() in Spark? When should you use StorageLevel.MEMORY_AND_DISK?
What is the difference between cache() and persist() in Spark? When should you use StorageLevel.MEMORY_AND_DISK?
Explain the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN with a simple example of Orders and Customers tables.
Explain the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN with a simple example of Orders and Customers tables.
A SELECT query filtering on a non-indexed column takes 8 seconds on a 10 million row table. Would adding an index always help? What's the trade-off of adding too many indexes?
A SELECT query filtering on a non-indexed column takes 8 seconds on a 10 million row table. Would adding an index always help? What's the trade-off of adding too many indexes?
What problem does database normalization (1NF, 2NF, 3NF) actually solve? Give an example of an update anomaly in an unnormalized table.
What problem does database normalization (1NF, 2NF, 3NF) actually solve? Give an example of an update anomaly in an unnormalized table.
Write a query to find, for each department, the employee with the second-highest salary, using window functions instead of a correlated subquery.
Write a query to find, for each department, the employee with the second-highest salary, using window functions instead of a correlated subquery.