Filter interviews by
To delete customer table in SQL, use the DROP TABLE command.
Use the DROP TABLE command followed by the table name.
Make sure to backup the data before deleting the table.
Ensure that there are no dependencies on the table before deleting it.
Creating customer table in SQL
Define the table structure with appropriate data types for each column
Include columns for customer ID, name, address, email, phone number, etc.
Set appropriate constraints such as primary key, unique, not null, etc.
Consider adding additional columns for date of birth, gender, etc. if required
Create indexes on frequently queried columns for better performance
Updating customer table
Use UPDATE statement with SET clause to update table
Specify the column to be updated and the new value
Use WHERE clause to specify the condition for updating specific rows
Joins are used to combine data from two or more tables based on a related column.
Types of joins: inner, left, right, full outer
Syntax: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column
Can also use aliases for table names and columns
Joins can be nested or chained together
Indexes are used to improve the performance of SQL queries by reducing the time taken to retrieve data.
Indexes are created on one or more columns of a table.
They can be clustered or non-clustered.
Clustered indexes determine the physical order of data in a table.
Non-clustered indexes create a separate structure to hold the indexed data.
Indexes should be used judiciously as they can slow down data modification opera...
Triggers are special types of stored procedures that are automatically executed in response to certain events.
Triggers are used to enforce business rules or to perform complex calculations that involve multiple tables.
They can be used to audit changes to data, or to replicate data across multiple tables.
Triggers can be defined to execute before or after an INSERT, UPDATE, or DELETE statement.
They can also be defin...
Cursors are used to retrieve data from a result set one row at a time.
Cursors are used when we need to perform operations on individual rows of a result set.
They are declared, opened, fetched, and closed.
They can be used to update or delete data in a table.
They can be slow and memory-intensive, so should be used sparingly.
Example: DECLARE cursor_name CURSOR FOR SELECT * FROM table_name;
Example: OPEN cursor_name; F...
Types of joins in SQL are Inner Join, Left Join, Right Join, Full Outer Join, Cross Join.
Inner Join returns only the matching rows from both tables.
Left Join returns all the rows from the left table and matching rows from the right table.
Right Join returns all the rows from the right table and matching rows from the left table.
Full Outer Join returns all the rows from both tables.
Cross Join returns the Cartesian p...
Subsets of SQL are different types of SQL languages used for specific purposes.
Data Definition Language (DDL) - used to define database schema
Data Manipulation Language (DML) - used to manipulate data in database
Data Control Language (DCL) - used to control access to database
Transaction Control Language (TCL) - used to manage transactions
Examples: CREATE, SELECT, INSERT, UPDATE, DELETE, GRANT, REVOKE, COMMIT, ROLL...
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down a table into smaller tables and defining relationships between them.
There are different levels of normalization, with each level having specific rules to follow.
Normalization helps to prevent data inconsistencies and anomalies.
Example: A customer table can be normalized...
I applied via Company Website and was interviewed in Dec 2021. There was 1 interview round.
Updating customer table
Use UPDATE statement with SET clause to update table
Specify the column to be updated and the new value
Use WHERE clause to specify the condition for updating specific rows
To delete customer table, use DROP TABLE statement.
Use DROP TABLE statement followed by table name to delete the table.
Make sure to take backup of the table before deleting it.
Ensure that there are no dependencies on the table before deleting it.
Creating customer table in SQL
Define the table structure with appropriate data types for each column
Include columns for customer ID, name, address, email, phone number, etc.
Set appropriate constraints such as primary key, unique, not null, etc.
Consider adding additional columns for date of birth, gender, etc. if required
Create indexes on frequently queried columns for better performance
Triggers are special types of stored procedures that are automatically executed in response to certain events.
Triggers are used to enforce business rules or to perform complex calculations that involve multiple tables.
They can be used to audit changes to data, or to replicate data across multiple tables.
Triggers can be defined to execute before or after an INSERT, UPDATE, or DELETE statement.
They can also be defined to...
Cursors are used to retrieve data from a result set one row at a time.
Cursors are used when we need to perform operations on individual rows of a result set.
They are declared, opened, fetched, and closed.
They can be used to update or delete data in a table.
They can be slow and memory-intensive, so should be used sparingly.
Example: DECLARE cursor_name CURSOR FOR SELECT * FROM table_name;
Example: OPEN cursor_name; FETCH ...
Joins are used to combine data from two or more tables based on a related column.
Types of joins: inner, left, right, full outer
Syntax: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column
Can also use aliases for table names and columns
Joins can be nested or chained together
Indexes are used to improve the performance of SQL queries by reducing the time taken to retrieve data.
Indexes are created on one or more columns of a table.
They can be clustered or non-clustered.
Clustered indexes determine the physical order of data in a table.
Non-clustered indexes create a separate structure to hold the indexed data.
Indexes should be used judiciously as they can slow down data modification operations...
Subsets of SQL are different types of SQL languages used for specific purposes.
Data Definition Language (DDL) - used to define database schema
Data Manipulation Language (DML) - used to manipulate data in database
Data Control Language (DCL) - used to control access to database
Transaction Control Language (TCL) - used to manage transactions
Examples: CREATE, SELECT, INSERT, UPDATE, DELETE, GRANT, REVOKE, COMMIT, ROLLBACK
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down a table into smaller tables and defining relationships between them.
There are different levels of normalization, with each level having specific rules to follow.
Normalization helps to prevent data inconsistencies and anomalies.
Example: A customer table can be normalized into...
Types of joins in SQL are Inner Join, Left Join, Right Join, Full Outer Join, Cross Join.
Inner Join returns only the matching rows from both tables.
Left Join returns all the rows from the left table and matching rows from the right table.
Right Join returns all the rows from the right table and matching rows from the left table.
Full Outer Join returns all the rows from both tables.
Cross Join returns the Cartesian produc...
I applied via Company Website and was interviewed in Dec 2021. There was 1 interview round.
To update customer table, use UPDATE statement with SET clause and WHERE clause.
Use UPDATE statement to modify data in customer table
Use SET clause to specify the columns to be updated and their new values
Use WHERE clause to specify the rows to be updated based on a condition
Example: UPDATE customer SET name='John Doe' WHERE id=1
To delete customer table in SQL, use the DROP TABLE command.
Use the DROP TABLE command followed by the table name.
Make sure to backup the data before deleting the table.
Ensure that there are no dependencies on the table before deleting it.
To create a customer table, define columns for customer information and set primary key.
Define columns for customer information such as name, address, phone number, email, etc.
Set primary key for unique identification of each customer.
Consider adding constraints for data validation and normalization.
Example: CREATE TABLE customers (id INT PRIMARY KEY, name VARCHAR(50), address VARCHAR(100), phone VARCHAR(20), email VAR...
Triggers are special types of stored procedures that are automatically executed in response to certain events.
Triggers are used to enforce business rules or data integrity.
They can be used to audit changes to data.
Triggers can be defined to execute before or after a data modification statement.
They can be defined at the table or schema level.
Examples include: enforcing referential integrity, logging changes to a table,...
Cursors are used to retrieve data row by row from a result set.
Cursors are used when we need to perform operations on individual rows.
They are declared, opened, fetched, and closed.
They can be used to iterate through a result set.
They can be static, dynamic, or forward-only.
Example: DECLARE cursor_name CURSOR FOR SELECT * FROM table_name;
Example: OPEN cursor_name; FETCH NEXT FROM cursor_name INTO @variable;
Example: CLO...
Joins are used to combine data from two or more tables based on a related column.
Types of joins: inner, left, right, full outer
Syntax: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column
Can also use aliases for table names and columns
Joins can be nested or chained together
Indexes are used to improve the performance of SQL queries by allowing faster data retrieval.
Indexes are created on one or more columns of a table.
They can be clustered or non-clustered.
Clustered indexes determine the physical order of data in a table.
Non-clustered indexes create a separate structure to hold the index data.
Indexes should be used judiciously as they can slow down data modification operations.
Subsets of SQL are subsets of SQL language that are used for specific purposes.
Common subsets include DDL, DML, DCL, and TCL
DDL (Data Definition Language) is used to define database schema
DML (Data Manipulation Language) is used to manipulate data in the database
DCL (Data Control Language) is used to control access to the database
TCL (Transaction Control Language) is used to manage transactions
Other subsets include DQL...
Normalization is the process of organizing data in a database to reduce redundancy and dependency.
Normalization is divided into several normal forms (1NF, 2NF, 3NF, etc.)
Each normal form has a set of rules that must be followed to achieve it
Normalization helps to improve data consistency, reduce data redundancy, and improve database performance
Example: A customer table should not contain order details, instead, it shou...
Types of joins in SQL are Inner Join, Left Join, Right Join, and Full Outer Join.
Inner Join returns only the matching rows from both tables.
Left Join returns all the rows from the left table and matching rows from the right table.
Right Join returns all the rows from the right table and matching rows from the left table.
Full Outer Join returns all the rows from both tables.
Joining tables using a common column is the mos...
Top trending discussions
I applied via Referral and was interviewed before Jan 2020. There were 5 interview rounds.
I applied via Naukri.com and was interviewed before Apr 2020. There was 1 interview round.
I applied via Naukri.com and was interviewed before Nov 2018. There were 3 interview rounds.
posted on 10 Mar 2015
Algorithm to find 2 numbers in an array whose sum is equal to a target integer
Use a hash table to store the difference between target and each element in the array
Iterate through the array and check if the current element exists in the hash table
Return the pair of elements that sum up to the target integer
Hashtable is faster for finding an item than a sorted list.
Hashtable has constant time complexity O(1) for finding an item.
Sorted list has logarithmic time complexity O(log n) for finding an item.
Hashtable uses hashing to directly access the item's location.
Sorted list requires binary search to find the item's location.
Hashtable is ideal for large datasets with frequent lookups.
Sorted list is ideal for datasets that re...
JSON and XML are the most popular data interchange formats when using APIs.
JSON (JavaScript Object Notation) is a lightweight format that is easy to read and write. It is widely used in web APIs.
XML (Extensible Markup Language) is a more complex format that is also widely used in web APIs.
Other formats include CSV (Comma Separated Values), YAML (YAML Ain't Markup Language), and Protocol Buffers.
Popular APIs for Social Commerce services
Facebook Graph API for social media integration
Instagram API for photo sharing and tagging
Twitter API for real-time updates and customer engagement
Pinterest API for product discovery and sharing
Google Maps API for location-based services
PayPal API for secure payment processing
Use a script to iterate through each HTML page, locate phone numbers, and update their format.
Write a script using a programming language like Python or JavaScript to iterate through each HTML page
Use regular expressions to locate phone numbers in the pages
Update the format of the phone numbers as needed (e.g. adding country code, changing separators)
Save the updated HTML pages with the new phone number format
Designing Google Suggest system
I would start by analyzing user search patterns and frequently searched keywords
Then, I would create a database of these keywords and their associated search results
I would use indexing services to quickly retrieve relevant results for each keyword
I would also implement machine learning algorithms to improve the accuracy of suggestions over time
Check if a number is a power of 2 and odd.
To check if a number is a power of 2, use bitwise AND operator with the number and its predecessor. If the result is 0, it is a power of 2.
To check if a number is odd, use modulus operator with 2. If the result is 1, it is odd.
Example code in Python:
def is_power_of_two(num):
return num & (num - 1) == 0
def is_odd(num):
return num % 2 == 1
By introducing new menu items, optimizing pricing strategy, and improving the overall dining experience.
Conduct a survey to understand the preferences of employees
Introduce healthy and affordable meal options
Offer discounts for bulk orders or loyalty programs
Partner with local vendors to source fresh ingredients
Improve the ambiance and seating arrangements
Implement online ordering and delivery services
Reviewing 30 million ads from 42 languages in Google AdWords and rejecting non-compliant ads requires a systematic approach.
Create a set of specific rules and guidelines for ad compliance
Use automated tools to filter out ads that violate the rules
Assign a team of reviewers to manually check the remaining ads
Ensure that the reviewers are fluent in the languages of the ads they are reviewing
Regularly update the rules and...
Find the intersection of two square images represented as trees based on color rules.
A white node (W) intersects with another white node (W) results in W.
A black node (B) intersects with another black node (B) results in B.
A white node (W) intersects with a black node (B) results in W.
A mixed node (M) will have 4 children representing the intersection of its quadrants.
Determine the order of alien alphabets using a sorted dictionary of words.
Create a graph where each node is an alien character.
Add directed edges based on the order of characters in the given words.
Perform topological sorting on the graph to determine the order.
Example: For words ['abc', 'ab'], 'c' comes after 'b'.
Handle cases with multiple characters differing at the same position.
Multiple data structures are used to print nodes in a specific order. One data structure cannot be used alone.
The given order suggests a depth-first search traversal of a tree-like structure.
A stack can be used to keep track of the nodes to be visited.
A queue can be used to store the children of a node in the order they are visited.
An array can be used to store the nodes in the required order.
A linked list can be used ...
Check if one string is a subsequence of another by verifying character order.
A subsequence maintains the order of characters but not necessarily consecutiveness.
Example: 'abc' is a subsequence of 'aebdc' (a, b, c appear in order).
Example: 'abc' is NOT a subsequence of 'acb' (order is violated).
To check, iterate through both strings and match characters sequentially.
Find largest pen using minimum comparisons with tops.
Divide pens into two groups and compare largest pen from each group with largest top.
Repeat the process with the group containing the largest pen until only one pen is left.
The remaining pen is the largest pen.
Total number of comparisons required is 2n-3.
Given n dice with 'a' sides and sum b, return no. of ways to obtain b. Optimize time and space complexity.
Use dynamic programming to reduce time complexity
Create a 2D array to store the number of ways to obtain each sum for each number of dice
Use rolling arrays to optimize space complexity
Example: n=2, a=6, b=7 -> 6 ways to obtain sum 7
Example: n=3, a=4, b=8 -> 21 ways to obtain sum 8
Sort 128 GB data on 2 machines with 64 GB RAM each. Extend to 1000 machines.
Use external sorting algorithm like merge sort or quick sort
Divide data into smaller chunks and sort them individually
Merge sorted chunks using additional RAM
For 1000 machines, use distributed sorting algorithms like MapReduce or Hadoop
Ensure data consistency and fault tolerance in distributed sorting
I appeared for an interview in Aug 2016.
based on 2 reviews
Rating in categories
Software Engineer
14
salaries
| ₹2.2 L/yr - ₹4.8 L/yr |
Softwaretest Engineer
11
salaries
| ₹2.4 L/yr - ₹4.5 L/yr |
UI Developer
7
salaries
| ₹3.1 L/yr - ₹3.6 L/yr |
Software Developer
6
salaries
| ₹3 L/yr - ₹4.2 L/yr |
SQL Developer
4
salaries
| ₹2 L/yr - ₹3 L/yr |
Cognizant
Teleperformance
iEnergizer
Reliance Retail