CRED Interview Questions
Practice with real CRED interview questions
01
A Software Engineer was asked
Asked in 2024
Q. How do SQL aggregate functions like MAX, MIN, and AVG work? Provide SQL queries demonstrating their usage.
Ans. SQL aggregate functions perform calculations on a set of values and return a single value. The most commonly used aggregate functions include:
- MAX: Returns the maximum value.
- MIN: Returns the minimum value.
- AVG: Returns the average value.
Here’s how you can use these functions in SQL:
These queries demonstrate how to use SQL aggregate functions to summarize data in the 'Sales' table. Each function processes the 'Amount' column and returns the corresponding maximum, minimum, and average values.
Software EngineerCore Concept
02
A Software Engineer was asked
Asked in 2024
Q. Can you explain the basic operations on arrays and strings in programming? Provide a code example for both.
Ans. Arrays and strings are fundamental data structures in programming.
Arrays are collections of elements identified by index or key. Operations typically include insertion, deletion, and traversal. Strings are arrays of characters that represent text.
Example Code for Array Operations:
Example Code for String Operations:
Both examples illustrate basic manipulation of arrays and strings. Edge cases like empty arrays and strings should be handled appropriately in a full implementation.
Software EngineerCore Concept
