profile pic Database
Upvote 0 Downvote
Secure Data Engineering System Design with AWS and Machine Learning DevOps Engineer @ Yahoo Difficulty medium

You are tasked with designing a secure database system for Yahoo's Paranoids team, focusing on a Linux environment hosted on AWS. The system should ensure data integrity and protection against cyber threats. Additionally, propose a machine learning approach to detect and mitigate potential security breaches. Describe your approach, the technologies you would use, and the steps involved in the implementation.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Cybersecurity in Database Design with AWS, Linux, and Machine Learning DevOps Engineer @ Yahoo Difficulty hard

Design a secure database system for a cybersecurity team, focusing on a Linux environment hosted on AWS. The system must ensure data integrity and protection against cyber threats. Additionally, propose a machine learning solution to detect and mitigate potential security breaches. Detail your approach, the technologies you would use, and the steps involved in the implementation.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
ACID Properties and Their Significance in Database Transactions Data Engineer @ Google Difficulty medium

Discuss ACID properties and their significance in database transactions.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Complex Query for Analyzing Customer Orders and Product Sales Data Engineer @ Google Difficulty hard

Given the following database schema for an e-commerce platform:

Customers Table:

  • customer_id (Primary Key)
  • first_name
  • last_name
  • email

Orders Table:

  • order_id (Primary Key)
  • customer_id (Foreign Key)
  • order_date
  • total_amount

OrderDetails Table:

  • order_detail_id (Primary Key)
  • order_id (Foreign Key)
  • product_id (Foreign Key)
  • quantity
  • price

Products Table:

  • product_id (Primary Key)
  • product_name
  • category

Write a complex SQL query to retrieve the top 5 customers who have spent the most on products in the 'Electronics' category over the past year. The query should also return the total amount spent by these customers and the number of orders they placed in the past year.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Rental Car Service Design System Architect @ Uber Difficulty hard

Design a rental car service. Your solution should include considerations for the following aspects:

  1. Database Schema: Outline the schema for storing information about cars, rentals, and customers.
  2. Microservices Architecture: Describe the microservices that would be necessary for this system.
  3. API Endpoints: List key API endpoints for managing car rentals, including adding a new rental, returning a car, and checking car availability.
  4. Scalability: Discuss how you would ensure the system scales to handle a large number of rental transactions.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Complex SQL Query Using Joins, Unions, Window Functions, and Subqueries Data Engineer @ Google Difficulty hard

Given the following database schema for a retail platform:

Customers Table:

  • customer_id (Primary Key)
  • first_name
  • last_name
  • email

Orders Table:

  • order_id (Primary Key)
  • customer_id (Foreign Key)
  • order_date
  • total_amount

OrderDetails Table:

  • order_detail_id (Primary Key)
  • order_id (Foreign Key)
  • product_id (Foreign Key)
  • quantity
  • price

Products Table:

  • product_id (Primary Key)
  • product_name
  • category

Write a complex SQL query that performs the following tasks:

  1. Use a JOIN to retrieve the customer's name and email along with the total amount they spent on each order.
  2. Use a UNION to combine the result with a similar query that retrieves the total number of products ordered by each customer.
  3. Use a WINDOW FUNCTION to rank customers based on their total spending.
  4. Use a SUBQUERY to find customers who have placed more than 5 orders.

The final result should include the customer's name, email, total amount spent, total products ordered, and their spending rank.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Advanced SQL: Consecutive Numbers and Date Segregation Data Analyst @ Amazon Difficulty hard

Explain how you would use advanced SQL techniques to identify consecutive numbers and segregate absent and present dates.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Capping Seller Items and Selection Criteria Data Analyst @ Amazon Difficulty hard

How would you put a cap on the number of items a seller is allowed to have on the Amazon marketplace? What would be the criteria for selecting which items stay on the marketplace if this limit was imposed and sellers were over the limit?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Troubleshooting Broken Reports Data Analyst @ Apple Difficulty medium

How would you diagnose and resolve issues when a business intelligence report breaks in a production environment?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Understanding OLAP and Its Differences from Other Database Types Data Analyst @ Google Difficulty medium

What is OLAP and what are its differences compared to other database types?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Creating a Joined Table from Two SQL Tables Data Analyst @ Microsoft Difficulty medium

If you have two SQL database tables that are not joined together, how would you create another table to join them.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Data Normalization in SQL Data Analyst @ Google Difficulty medium

You are given a database containing customer orders. The database currently has redundant and repetitive data, leading to inconsistency and excess storage usage. Explain how you would apply normalization techniques to this database. What specific steps would you take to achieve Third Normal Form (3NF)? Provide example tables before and after normalization.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Creating a Test Plan Quality Assurance @ Amazon Difficulty medium

Imagine you are tasked with creating a test plan for a new inventory management system for a company. Describe the steps and key elements you would include in your test plan to ensure comprehensive and effective coverage of the system.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Software Testing and Development: Coding Questions Involving Basic Data Structures Quality Assurance @ Amazon Difficulty medium

Explain and provide examples of software testing and development coding questions that involve basic data structures. Consider questions that cover arrays, linked lists, stacks, and queues. Provide a detailed solution for each example.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Identifying and Resolving Sales Data Anomalies Quality Assurance @ Amazon Difficulty medium

You are analyzing sales data and notice that there are anomalies in the data for several key regions over the past quarter. Specifically, the sales figures for certain products are either too high or too low compared to historical data. Describe a step-by-step approach to identify and address these anomalies using SQL and Python.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Test Scenarios for a Banking Application Quality Assurance @ Amazon Difficulty medium

Test scenario was Banking Application:

  1. Registration page
  2. Login page
  3. Transaction
  4. Ticket raise

types of testing: -> functional and non functional and its differences -> monkey testing -> guerrilla testing -> unit testing -> integration testing -> system testing -> acceptance testing and a lot more.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Removing Duplicate Characters from a String Quality Assurance @ Amazon Difficulty medium

Given a string, write a function in Python to remove all duplicate characters while preserving the original order of characters.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Traversing an Array from Back to Front and Vice Versa Quality Assurance @ Amazon Difficulty easy

Write a function in Python to traverse an array both from back to front and vice versa. Print the elements in both orders.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Suggestions for Improving Code Efficiency (Big O) Quality Assurance @ Amazon Difficulty medium

As a software engineer, you are tasked with optimizing a given piece of code to improve its efficiency in terms of Big O notation. Describe at least five general strategies you would employ to enhance the code's performance.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Counter Examples to the Time Complexity of Binary Search Tree (BST) Quality Assurance @ Google Difficulty medium

Provide counter examples to the time complexity analysis of a Binary Search Tree (BST).

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Difference Between Compatibility Testing vs Integrity Testing Quality Assurance @ Amazon Difficulty medium

What is the difference between Compatibility Testing and Integrity Testing in the context of software and data systems? Provide a detailed comparison highlighting the purpose, scope, and techniques used in each type of testing.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Optimizing Product Recommendation Algorithm Quality Assurance @ Amazon Difficulty medium

Imagine you are a Data Analyst at Amazon working on improving the product recommendation algorithm. You are given a dataset with user_id, product_id, rating, and timestamp. Your task is to identify the top 5 most popular products (most purchased) in the last 30 days. What steps would you take to solve this problem using Python and SQL?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Find Non-Duplicate Element in an Array Quality Assurance @ Google Difficulty medium

Given an array of integers where every element appears twice except for one, write a function to find that single element. Explain the approach and also provide a code solution in Python.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Compare Elements of Two Unsorted Arrays Quality Assurance @ Google Difficulty medium

Given two unsorted arrays of integers, write a function to determine if the arrays contain the same elements, regardless of their order. Explain your approach and provide a Python code solution.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
SQL Queries Involving HAVING Clause and Aggregate Functions Quality Assurance @ Amazon Difficulty medium

Explain the use of the HAVING clause and Aggregate Functions in SQL. Provide examples of SQL queries that demonstrate their usage with a detailed explanation for each.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Understanding Integrity Testing in Data Systems Quality Assurance @ Amazon Difficulty easy

What is Integrity Testing in the context of data systems? Describe its importance and a common approach to perform integrity testing when migrating data from one system to another.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Difference Between Test Data vs Train Data in a Project Quality Assurance @ Amazon Difficulty easy

What's the difference between test data and train data in your project?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Find the Number of Occurrences of Each Character in a String Quality Assurance @ Amazon Difficulty easy

Find the number of occurrences of each character in a given string.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Binary Tree Structure Modification Quality Assurance @ Google Difficulty hard

Given a binary tree, write a function to invert the binary tree (i.e., swap the left and right children of every node).

Implement this transformation in Python.

Example:

Input:

    4
   / \
  2   7
 / \ / \
1  3 6  9

Output:

    4
   / \
  7   2
 / \ / \
9  6 3  1
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Time Complexity of Binary Search Tree (BST) Quality Assurance @ Google Difficulty easy

Explain the time complexity of operations in a Binary Search Tree (BST). Provide both average-case and worst-case complexities.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Group Anagrams - LeetCode Problem Quality Assurance @ Amazon Difficulty medium

Write a program to group anagrams from a given list of strings. This is a common problem on LeetCode.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Finding the Sum of Digits in a Number Quality Assurance @ Amazon Difficulty easy

Write a function in Python to find the sum of all digits in a given number.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Coding Interview - Nearest Palindrome and Last Two Digits of Product Quality Assurance @ Amazon Difficulty hard
  1. Given a number, find the nearest palindrome.
  2. Given an array of length n containing numbers between 1 to 99, print the last two digits of the result after multiplying all n numbers in the array.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Test Case Enumeration, Removing Consecutive Duplicates, and Finding Sum Series Quality Assurance @ Amazon Difficulty medium
  1. Write test cases for a video calling app on a mobile device.
  2. Write a program to find consecutive duplicate letters in each word of the sentence and print the sentence without duplicate letters.
  3. Find a series of numbers in an array which gives the sum value as 3.
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Find the Union of Two Strings Quality Assurance @ Amazon Difficulty easy

Write a function in Python and Java to find the union of two strings. The union of two strings includes all unique characters present in either of the strings.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Analyzing Web Data for Business Insights Quality Assurance @ Oracle Difficulty medium

You're provided with a database containing customer interaction data collected from a web application. Using SQL, extract the list of customers who have logged in more than 5 times in the past 30 days but have not made any purchases. Explain the steps and SQL query you would use to achieve this. Assume the database has the following tables:

  • logins (fields: customer_id, login_date)
  • purchases (fields: customer_id, purchase_date, amount)
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Calculating Customer Engagement Metrics Quality Assurance @ Oracle Difficulty medium

In the context of a business analysis for a web application, you are given two data tables: logins and purchases. You are asked to find out the engagement level of customers who have interacted with the application. Write a SQL query to determine the list of customers who have logged in more than 5 times in the last 30 days and have made at least one purchase. Provide the steps and the final SQL query. The table structures are:

  • logins (fields: customer_id, login_date)
  • purchases (fields: customer_id, purchase_date, amount)
Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Reversing an Integer in SQL Quality Assurance @ Oracle Difficulty medium

You need to write a SQL query to reverse the digits of a given integer. Assume the integer is stored in a table called numbers with a single column value. Provide an example integer and show how your query processes it to produce the reversed number.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Analyzing Concurrent Data Processing Quality Assurance @ Oracle Difficulty medium

In a multi-threaded environment, you have a log table thread_logs with the columns thread_id, start_time, end_time, and operation. You need to analyze the performance of each thread by calculating the total time spent on operations by each thread. Write an SQL query to summarize the total processing time for each thread. Provide the steps and the final SQL query.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Using HashMap for Efficient Data Retrieval in SQL Quality Assurance @ Oracle Difficulty medium

You are given a table employees with columns employee_id, name, and department_id. You also have a table departments with columns department_id and department_name. Describe how you would leverage a HashMap (or equivalent data structure) approach to optimize querying the department name for each employee in an SQL environment. Provide the steps and the final SQL query.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Identifying Prime Numbers in SQL Quality Assurance @ Oracle Difficulty medium

You need to write an SQL query that identifies whether a given integer in a table is a prime number. Assume the table numbers has a single column value containing positive integers. Write a query to determine if each number is prime and return the value along with a is_prime flag. Provide the steps and the final SQL query.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Checking for Duplicates in a List with HashSet Quality Assurance @ IBM Difficulty medium

You are given a list of customer IDs in a Python list, which might contain duplicates. Write a Python function that uses a HashSet to determine if there are any duplicates in the list.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Finding a Pair in an Array with the Maximum Product Quality Assurance @ Amazon Difficulty medium

Write a function in Python to find a pair of numbers in an array such that their product is the maximum possible.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Reverse a Linked List in Groups of K Quality Assurance @ Amazon Difficulty medium

Write a function to reverse a linked list in groups of K (any number) in Python and Java.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Utilizing Hash Tables for Quick Data Lookup in SQL Quality Assurance @ Oracle Difficulty medium

You are given a table orders with columns order_id, customer_id, and order_date. Additionally, you have a table customers with columns customer_id, customer_name, and customer_email. Explain how you can use principles similar to a Hash Table to efficiently retrieve customer details for each order in an SQL database. Provide the steps and the final SQL query.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Finding Missing Values in a Dataset Quality Assurance @ IBM Difficulty medium

Suppose you are working with a SQL database, and you have a table sales_data with columns product_id, region, and sales_amount. You have noticed that there are some missing values in the sales_amount column for certain regions.

Write a SQL query to identify all regions where any sales_amount value is missing.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Reversing a Linked List Quality Assurance @ IBM Difficulty medium

You are given a singly linked list and you need to write a function in Python to reverse the linked list. Assume the linked list node is defined as follows:

class ListNode:
    def __init__(self, value=0, next=None):
        self.value = value
        self.next = next

Write a function reverse_linked_list that takes the head of the linked list as an argument and returns the new head of the reversed list.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
How Would You Design a Database? Quality Assurance @ IBM Difficulty medium

Explain the key steps and considerations in designing a database. Include how you would handle requirements gathering, schema design, normalization, indexing, and ensuring data integrity.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Finding the Shortest Path Between Two Points on a 2D Matrix Quality Assurance @ Amazon Difficulty hard

Write a function to find the shortest path between two points on a 2D matrix. The matrix contains cells that can either be empty (0) or blocked (1). You can move up, down, left, or right but cannot move through blocked cells.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
What is Binary Search Tree? What is Doubly Circular Linked List? Quality Assurance @ Amazon Difficulty medium

What is a Binary Search Tree? What is a Doubly Circular Linked List?

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Check if Parentheses are Closed in a String Quality Assurance @ Amazon Difficulty medium

Write a function in Python and Java to check if parentheses are closed correctly in a given string. The function should support different types of parentheses: (), {}, and [].

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
SQL Queries: Third Highest Salary and Employee Count by Department Quality Assurance @ Oracle Difficulty medium

Write an SQL query to find the third highest salary from an Employee table. Additionally, write a query to find the count of employees in each department from the Employee and Department tables.

Assume the Employee table (Emp) has columns: EmpID, EmpName, DeptID, Salary, and the Department table (Dept) has columns: DeptID, DeptName.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Counting the Frequency of Each Word in a Text Field Quality Assurance @ Oracle Difficulty medium

You are given a table articles containing a column content which holds textual data. Write an SQL query to count the frequency of each word in the content column across all rows. Explain the steps and the final SQL query to achieve this. Assume your SQL environment supports common table expressions (CTEs) and string functions.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
How Can We Check if There is a Loop in a Linked List? Quality Assurance @ IBM Difficulty medium

Describe the method to check if there is a loop in a linked list. Provide the algorithm and example code in Python.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Handling Non-Reproducible Bugs Quality Assurance @ Amazon Difficulty medium

As a QA Engineer, you encounter a bug that appears to affect some users, but you are unable to reproduce it. Describe the steps you would take to investigate and resolve this issue.

Solution:

Please sign-in to view the solution

Upvote 0 Downvote
Various Examples: Closest Palindrome, Array Duplicates, and Rhombus Shape Quality Assurance @ Amazon Difficulty medium
  1. Write a function to find the closest palindrome number to a given number.
  2. Write a function to determine if an array contains duplicate numbers.
  3. Write a function to print numbers in a rhombus shape:
    1
    121
    12321
    121
    1
    
Solution:

Please sign-in to view the solution