Faster and better experience!
Filter interviews by
I applied via Company Website and was interviewed before Feb 2023. There were 4 interview rounds.
Closure is a feature in programming languages that allows a function to access variables from its outer scope even after it has finished executing.
Closure is created when a nested function references variables from its parent function.
It allows for data encapsulation and privacy in JavaScript.
Closures are commonly used in event handlers, callbacks, and asynchronous programming.
They can be used to create private variabl...
JS hoisting is a mechanism where variable and function declarations are moved to the top of their scope during compilation.
Variable declarations are hoisted but not their initializations.
Function declarations are fully hoisted, including their definitions.
Hoisting can lead to unexpected behavior if not understood properly.
Example: console.log(x); var x = 5; // Output: undefined
CSS position properties determine how an element is positioned on a web page.
static: default position, elements flow in document order
relative: positioned relative to its normal position
absolute: positioned relative to its nearest positioned ancestor
fixed: positioned relative to the browser window
sticky: positioned based on scroll position
React has several component lifecycles, including mounting, updating, and unmounting.
Mounting: when a component is being created and inserted into the DOM
Updating: when a component is being re-rendered due to changes in props or state
Unmounting: when a component is being removed from the DOM
Ref is used in React to access and manipulate the DOM directly.
Ref provides a way to access and modify DOM elements or React components.
It is commonly used for focusing input fields, triggering animations, or integrating with third-party libraries.
Ref can be created using the useRef() hook or by using the ref attribute in class components.
Example: const inputRef = useRef();
Example: const button
Designing the database for Slack
Create tables for users, channels, messages, and teams
Use foreign keys to establish relationships between tables
Include columns for user details, channel details, message content, and timestamps
Consider indexing frequently queried columns for performance optimization
To improve db performance, optimize queries, use indexing, cache data, and scale horizontally.
Optimize queries by using appropriate indexes and avoiding unnecessary joins
Cache frequently accessed data to reduce database load
Scale horizontally by distributing the database across multiple servers
Use database monitoring tools to identify and resolve performance bottlenecks
CDN stands for Content Delivery Network. It is a distributed network of servers that helps deliver web content efficiently.
CDN improves website performance by caching content closer to the user
It reduces latency and improves page load times
CDN helps handle high traffic loads and prevents server overload
It provides global coverage and ensures content availability worldwide
CDN can deliver various types of content like im...
To improve API latency, optimize database queries, use caching, implement load balancing, and optimize code.
Optimize database queries by using indexes, reducing unnecessary joins, and optimizing query execution plans.
Implement caching to store frequently accessed data in memory, reducing the need for repeated database queries.
Use load balancing to distribute incoming requests across multiple servers, preventing any sin...
Top trending discussions
Algorithm to find LCM of all numbers from 1 to n and its time complexity
Find prime factors of all numbers from 1 to n
For each prime factor, find the highest power it appears in any number from 1 to n
Multiply all prime factors raised to their highest power to get LCM
Time complexity: O(n*log(log(n)))
NoSQL databases are flexible, scalable, and can handle large amounts of unstructured data.
NoSQL databases are schema-less, allowing for easy and flexible data modeling.
They can handle large amounts of unstructured data, making them suitable for big data applications.
NoSQL databases are highly scalable and can easily handle high traffic and large user bases.
They provide horizontal scalability by distributing data across...
The question asks to find the count of words in a dictionary that can be formed by a given number.
Iterate through each word in the dictionary
Check if the characters in the word can be formed using the given number
Increment the count if the word can be formed
Finding lowest common ancestor of two nodes in binary tree
Traverse the tree from root to both nodes and store the paths in separate arrays
Compare the paths to find the last common node
Return the last common node as the lowest common ancestor
Use recursion to traverse the tree efficiently
To find the merging point of two linked lists
Traverse both linked lists and find their lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
Reverse a linked list iteratively
Create three pointers: prev, curr, and next
Initialize prev to null and curr to head
Loop through the list and set next to curr's next node
Set curr's next node to prev
Move prev and curr one step forward
Return prev as the new head
The number of rectangles in an MxN matrix can be calculated using a formula.
The formula is (M * (M + 1) * N * (N + 1)) / 4
The matrix can be divided into smaller sub-matrices to count the rectangles
The number of rectangles can also be calculated by counting all possible pairs of rows and columns
The number is 7744.
The number must end in 00 or 44.
The square root of the number must be a whole number.
The only possible number is 7744.
I am a software developer with experience in multiple programming languages and a passion for problem-solving.
Proficient in Java, Python, and C++
Experience with web development using HTML, CSS, and JavaScript
Familiarity with agile development methodologies
Strong problem-solving and analytical skills
Passionate about learning new technologies and staying up-to-date with industry trends
Java function to return subnet mask of IP and URL after www.
Read the file and store IP addresses and URLs in separate arrays
Use regex to extract subnet mask from IP address
Use substring to extract URL after www.
Return subnet mask and URL as separate strings
Inner join returns only the matching rows between two tables, while outer join returns all rows from one table and matching rows from the other.
Inner join combines rows from two tables based on a matching column.
Outer join returns all rows from one table and matching rows from the other.
Left outer join returns all rows from the left table and matching rows from the right table.
Right outer join returns all rows from the...
To find the length of non-looped linked list, we need to traverse the list and count the number of nodes.
Traverse the linked list using a pointer and count the number of nodes until the end of the list is reached.
If a loop is encountered, break out of the loop and continue counting until the end of the list.
Return the count as the length of the non-looped linked list.
PreOrder traversal without recursion is done using a stack to simulate the function call stack.
Create an empty stack and push the root node onto it.
While the stack is not empty, pop a node from the stack and process it.
Push the right child of the popped node onto the stack if it exists.
Push the left child of the popped node onto the stack if it exists.
Yes
Create an empty binary search tree (BST)
Loop over the unsorted array
For each element, insert it into the BST using the appropriate insertion logic
Repeat until all elements are inserted
The resulting BST will be built from the unsorted array
The question asks to find two elements in an array whose sum is equal to a given number.
Iterate through the array and for each element, check if the difference between the given number and the current element exists in the array.
Use a hash set to store the elements as you iterate through the array for efficient lookup.
Return the pair of elements if found, otherwise return a message indicating no such pair exists.
There are two types of triggers: DML triggers and DDL triggers.
DML triggers are fired in response to DML (Data Manipulation Language) statements like INSERT, UPDATE, DELETE.
DDL triggers are fired in response to DDL (Data Definition Language) statements like CREATE, ALTER, DROP.
Examples: A DML trigger can be used to log changes made to a table, while a DDL trigger can be used to enforce certain rules when a table is alt
Yes, triggers can be used with select statements in SQL.
Triggers are database objects that are automatically executed in response to certain events, such as insert, update, or delete operations.
While triggers are commonly used with insert, update, and delete statements, they can also be used with select statements.
Using triggers with select statements allows you to perform additional actions or validations before or af...
Indexing in MySQL improves query performance. There are several types of indexing in MySQL.
Indexes are used to quickly locate data without scanning the entire table.
Types of indexing in MySQL include B-tree, hash, full-text, and spatial indexes.
B-tree indexes are the most common and suitable for most use cases.
Hash indexes are used for exact match lookups.
Full-text indexes are used for searching text-based data efficie...
Engines in MySQL are the underlying software components that handle storage, indexing, and querying of data.
MySQL supports multiple storage engines, each with its own strengths and features.
Some commonly used engines in MySQL are InnoDB, MyISAM, and Memory.
InnoDB is the default engine in MySQL and provides support for transactions and foreign keys.
MyISAM is known for its simplicity and speed but lacks transaction suppo...
Yes, a constructor can be private.
A private constructor can only be accessed within the class itself.
It is often used in singleton design pattern to restrict object creation.
Private constructors are also useful for utility classes that only contain static methods.
A program to check if a number is a palindrome or not.
Convert the number to a string
Reverse the string
Compare the original and reversed string
If they are the same, the number is a palindrome
For Snapdeal's shoe section, I would design a DBMS with separate entities for Sports and Casual Shoes.
Create a main entity for shoes with attributes like brand, size, color, etc.
Create separate entities for Sports and Casual Shoes with attributes specific to each category.
Link the Sports and Casual Shoe entities to the main Shoe entity using a foreign key.
Use indexing and normalization techniques to optimize performanc...
DNS servers translate domain names into IP addresses to enable communication between devices on the internet.
DNS servers act as a phone book for the internet, translating domain names into IP addresses.
When a user types a domain name into their browser, the browser sends a request to a DNS server to resolve the domain name into an IP address.
DNS servers operate in a hierarchical system, with root servers at the top, fo...
Merge two sorted arrays into one sorted array of larger size
Create a new array of size m+n
Compare the last elements of both arrays and insert the larger one at the end of the new array
Repeat until all elements are merged
If any elements are left in the smaller array, insert them at the beginning of the new array
Time complexity: O(m+n)
Example: arr1=[1,3,5,7,0,0,0], arr2=[2,4,6], output=[1,2,3,4,5,6,7]
To find square root of a number, use Math.sqrt() function in JavaScript.
Use Math.sqrt() function in JavaScript to find square root of a number.
For example, Math.sqrt(16) will return 4.
If the number is negative, Math.sqrt() will return NaN.
based on 1 interview
Interview experience
based on 1 review
Rating in categories
Graphic Designer
53
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Graphic Designer
16
salaries
| ₹0 L/yr - ₹0 L/yr |
Machine Learning Engineer
14
salaries
| ₹0 L/yr - ₹0 L/yr |
Image Editor
7
salaries
| ₹0 L/yr - ₹0 L/yr |
Data Analyst
6
salaries
| ₹0 L/yr - ₹0 L/yr |
Myntra
Flipkart
Paytm
Snapdeal