Filter interviews by
Queue can be implemented using two stacks by maintaining the order of elements in the stacks.
Create two stacks, let's call them stack1 and stack2
When an element is enqueued, push it to stack1
When an element is dequeued, pop all elements from stack1 and push them to stack2
Pop the top element from stack2 and return it as the dequeued element
If stack2 is empty, repeat step 3
To get the front element of the queue, peek the
Left join returns all records from left table and matching records from right table. Full outer join returns all records from both tables.
Left join is used to combine two tables based on a common column.
In left join, all records from the left table are returned along with matching records from the right table.
If there is no match in the right table, NULL values are returned.
Example: SELECT * FROM table1 LEFT JOIN table...
Magic functions are special methods in PHP that start with __. Autoloading is a way to automatically load classes.
Magic functions are used to handle certain events in PHP, such as object creation or property access.
Autoloading allows PHP to automatically load classes when they are needed, without requiring manual includes.
Magic functions can be used in conjunction with autoloading to dynamically load classes or handle
Given three sorted arrays, find common elements.
Create three pointers to traverse each array
Compare the elements at the pointers and move the pointer of the smallest element
If all pointers point to the same element, add it to the result and move all pointers
Repeat until any pointer reaches the end of its array
Check if a number is a power of 2 or not.
A power of 2 has only one bit set in its binary representation.
Use bitwise AND operator to check if the number is a power of 2.
If n is a power of 2, then n & (n-1) will be 0.
Event bubbling is the propagation of an event from the innermost child element to the outermost parent element.
Events triggered on a child element will also trigger on its parent elements
The event travels up the DOM tree until it reaches the document object
Can be stopped using event.stopPropagation()
Can be useful for event delegation
The .on('click',function() is a more flexible method than .click(function())
The .on() method can handle multiple events and selectors
The .click() method can only handle one event and one selector
The .on() method can also handle dynamically added elements
The .click() method cannot handle dynamically added elements
Function to check if two strings are anagram or not
Create two character arrays from the strings
Sort the arrays
Compare the sorted arrays
Function to determine the order of integers in an array.
Check first and last element to determine if increasing or decreasing
Check for inflection point to determine if order changes
Return order type as string
Optimize images, minify code, reduce HTTP requests, use caching, and lazy loading.
Optimize images using compression and appropriate file formats
Minify code to reduce file size and improve load times
Reduce HTTP requests by combining files and using sprites
Use caching to store frequently accessed data locally
Implement lazy loading to defer loading of non-critical resources
Design a database schema for a movie site with user ratings and recommendations.
Create tables for movies, users, ratings, and recommendations
Use foreign keys to link tables
Include columns for movie genre and user watch history
Algorithm for recommendations can use user watch history and ratings to suggest similar movies
Function to simulate dice roll with equal probability without using random function
Use a toss function that returns either 0 or 1 with equal probability
Call the toss function 3 times and convert the result to a binary number
If the binary number is greater than 0 and less than or equal to 6, return it
If the binary number is greater than 6, repeat the process
Query to fetch duplicate email from table
Use GROUP BY and HAVING clause to filter out duplicates
SELECT email, COUNT(*) FROM table_name GROUP BY email HAVING COUNT(*) > 1;
This will return all the duplicate emails in the table
Left join is a type of join in SQL that returns all the records from the left table and matching records from the right table.
Left join is used to combine rows from two or more tables based on a related column between them.
The result of a left join includes all the rows from the left table and the matching rows from the right table.
If there is no match, NULL values are returned for the columns of the right table.
Exampl...
Magic functions and autoloading are features in PHP that provide flexibility and automation in class definition and loading.
Magic functions in PHP are special methods that are automatically called when certain events occur, such as object instantiation or property access.
Autoloading in PHP is a mechanism that automatically loads classes when they are needed, without the need for manual inclusion.
Magic functions like __...
Given three sorted arrays, find common elements.
Iterate through all arrays simultaneously using three pointers.
If all pointers point to the same element, add it to the result and increment all pointers.
If any pointer points to an element smaller than the others, increment that pointer.
Repeat until any pointer reaches the end of its array.
Function to determine the type of array based on order of integers.
Check if the array is strictly increasing or strictly decreasing to determine the type.
If the array alternates between increasing and decreasing, it is of type 3 or 4.
Compare the first and last elements to determine if it is type 4.
Improving frontend performance of a site involves optimizing code, reducing HTTP requests, and utilizing caching techniques.
Optimize images and videos to reduce file sizes
Minify and concatenate CSS and JavaScript files
Utilize browser caching to store static resources locally
Implement lazy loading for images and videos
Reduce the number of HTTP requests by combining resources
Use a content delivery network (CDN) to serve
Design a database schema for a movie site with user ratings and recommendations.
Create tables for movies, users, genres, ratings, and recommendations
Use foreign keys to establish relationships between tables
Include columns for movie title, genre, user ratings, and recommended movies
Use algorithms like collaborative filtering or content-based filtering to show recommended movies to users
Use a toss function to simulate a fair dice roll without using random function.
Create a toss function that generates a random number between 1 and 2.
Call the toss function twice and map the results to get numbers 1-6.
Ensure each number has an equal probability of being generated.
Practo interview questions for popular designations
Top trending discussions
Some of the top questions asked at the Practo interview -
The duration of Practo interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 41 interviews
Interview experience
based on 493 reviews
Rating in categories
2-5 Yrs
Not Disclosed
Business Development Manager
244
salaries
| ₹3 L/yr - ₹9.6 L/yr |
Product Support Specialist
126
salaries
| ₹1 L/yr - ₹5 L/yr |
Territory Sales Manager
109
salaries
| ₹3 L/yr - ₹10 L/yr |
Team Lead
62
salaries
| ₹4 L/yr - ₹12.9 L/yr |
Assistant Area Manager
58
salaries
| ₹5 L/yr - ₹14 L/yr |
Lybrate
Mfine
DocsApp
Portea Medical