Meta
Tech-Pro Interview Questions and Answers
Q1. How would you efficiently calculate the sum of such a matrix?
Efficiently calculate the sum of a matrix
Iterate through each element in the matrix and add them to a running total
Use parallel processing or multi-threading to calculate the sum faster
Consider using optimized algorithms like Strassen's algorithm for matrix multiplication
Q2. Return the substring in a main string, which is composition of given string
Find and return all substrings in a main string that match a given string.
Iterate through the main string and check for matches with the given string
Use substring function to extract potential matches
Store all matching substrings in an array and return it
Q3. How would you represent a sparse matrix?
A sparse matrix can be represented using a dictionary of dictionaries or a list of lists.
Use a dictionary of dictionaries where the keys are the row and column indices with non-zero values as values.
Alternatively, use a list of lists where each inner list represents a row with non-zero values and their column indices.
Sparse matrices are efficient for large matrices with mostly zero values.
Example: {0: {1: 5, 3: 7}, 2: {2: 3}} represents a 3x4 matrix with non-zero values at (0...read more
Q4. Design a metrics tracker
A metrics tracker to monitor and analyze key performance indicators
Define the key metrics to track (e.g. user engagement, conversion rates)
Implement a data collection system to gather relevant data
Create visualizations and reports to analyze the metrics
Set up alerts for abnormal metric values
Regularly review and update the metrics based on business goals
Q5. make balanced parenthesis
Use a stack to ensure balanced parenthesis in a string
Iterate through each character in the string
If the character is an opening parenthesis, push it onto the stack
If the character is a closing parenthesis, pop from the stack and check if they match
If at the end the stack is empty, the parenthesis are balanced
Q6. All Palindromic substrings
Find all palindromic substrings in a given string.
Iterate through each character in the string and expand around it to find palindromic substrings.
Store all palindromic substrings in an array of strings.
Q7. Clean maze with Robot
Clean maze using a robot by navigating through paths and avoiding obstacles.
Create a map of the maze with obstacles and paths.
Implement a pathfinding algorithm for the robot to navigate through the maze.
Use sensors or algorithms to detect and avoid obstacles.
Track the robot's progress and clean the maze efficiently.
Q8. Design online coding judge.
Online coding judge to evaluate code submissions and provide feedback.
Create a web application where users can submit code in various programming languages.
Implement a compiler or interpreter to execute the code and check for errors.
Provide feedback on code correctness, efficiency, and style.
Include test cases to verify the code's functionality.
Allow users to view their submission history and track their progress.
Q9. Design live chess game
Design a live chess game
Create a server-side application to handle game logic and communication
Implement a client-side application for players to interact with the game
Use a database to store game state and player information
Implement real-time updates using websockets or similar technology
Design a user-friendly interface for players to make moves and view the board
More about working at Meta
Interview Process at Tech-Pro
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month