Naukri Interview Questions
Practice with real Naukri interview questions
01
A Full Stack Developer was asked
Asked in 2024
Q. What are arrays and strings in data structures? Provide examples of basic operations.
Ans. Arrays and strings are fundamental data structures used to store collections of data.
1. Arrays: An array is a collection of elements identified by index or key. Each element in an array is of the same data type.
- Example Operations:
- Edge Case: Handling an empty array.
2. Strings: A string is a sequence of characters. Strings are immutable in many programming languages (like Python).
- Example Operations:
- Edge Case: Handling an empty string.
Arrays and strings are essential for managing and manipulating collections of data in programming.
Full Stack DeveloperCore Concept
02
A Software Engineer was asked
Asked in 2024
Q. What are subqueries and nested queries in SQL? Provide an example of each and explain their differences.
Ans. Subqueries and nested queries are SQL features that allow you to perform operations based on the results of other queries.
- Subquery: A query nested inside another SQL query. Subqueries can return individual values or a set of records.
- Nested Query: Often used interchangeably with subqueries, but usually refers to a more complex query structure where a query is within another as part of the
FROM or WHERE clause.
Example of a Subquery:
This query retrieves usernames from the Users table for users who have made orders after January 1, 2023.
Example of a Nested Query:
Here, the nested query counts the number of orders for each user, returning the username and their respective order count.
Differences:
- Subqueries can return values used in the main query, while nested queries are typically part of the main SQL logic in the SELECT, FROM, or WHERE clauses.Software EngineerCore Concept
