150 Important FAANG Interview Questions
console.log('Hello, Duniya!')
Data Structures and Algorithms:
Arrays and Strings:
- Two Sum
- Container With Most Water
- Trapping Rain Water
- Longest Substring Without Repeating Characters
- Merge Intervals
- Valid Parentheses
- Product of Array Except Self
- Rotate Image
- Group Anagrams
- Longest Palindromic Substring
Linked Lists:
- Reverse Linked List
- Merge Two Sorted Lists
- Detect Cycle in a Linked List
- Remove Nth Node From End of List
- Intersection of Two Linked Lists
- Copy List with Random Pointer
Stacks and Queues:
- Valid Parentheses
- Implement Stack using Queues
- Design Circular Queue
- Largest Rectangle in Histogram
Trees and Graphs:
- Maximum Depth of Binary Tree
- Validate Binary Search Tree
- Lowest Common Ancestor of a Binary Tree
- Course Schedule
- Word Ladder
- Number of Islands
- Clone Graph
Sorting and Searching:
- Search in Rotated Sorted Array
- Find First and Last Position of Element in Sorted Array
- Kth Largest Element in an Array
Dynamic Programming:
- Climbing Stairs
- Longest Increasing Subsequence
- Maximum Subarray
- Edit Distance
- Coin Change
- Word Break
- Regular Expression Matching
Backtracking:
- N-Queens
- Combination Sum
- Subsets
System Design:
- Design a URL Shortening Service
- Design a Cache System
- Design a Distributed File System
- Design a News Feed System
- Design Twitter
Object-Oriented Design:
- Design a Parking Lot
- Design a Library Management System
- Design an Elevator System
- Design an Online Shopping System
Behavioral Questions:
- Tell me about yourself.
- Describe a challenging project you've worked on.
- How do you handle stress and pressure?
- Describe a conflict you had with a colleague and how you resolved it.
- What is your greatest professional achievement?
- How do you prioritize tasks and manage time?
- Tell me about a time when you failed and what you learned from it.
- Why do you want to work for [Company]?
SQL:
- Write a SQL query to find the second-highest salary.
- Write a SQL query to find duplicate rows in a table.
- Write a SQL query to calculate the average salary for each department.
System Architecture:
- Explain the difference between horizontal and vertical scaling.
- How does a load balancer work?
Operating Systems:
- Explain the difference between process and thread.
- What is virtual memory?
Networking:
- What happens when you type a URL into your browser's address bar?
Coding Challenges:
- Implement a basic calculator.
- Implement a trie (prefix tree).
- Implement a stack that supports push, pop, top, and retrieving the minimum element in constant time.
- Serialize and deserialize a binary tree.
- Implement a LRU (Least Recently Used) cache.
More Algorithms:
- Longest Common Subsequence
- Minimum Window Substring
- Unique Paths
- Maximum Subarray Sum Circular
- Reconstruct Itinerary
Behavioral Questions (Continued):
- How do you handle ambiguity?
- Tell me about a time you had to learn a new technology quickly.
More System Design:
- Design a TinyURL system.
- Design a recommendation system.
- Design a chat application.
Database Design:
- Normalize a database schema.
Coding Challenges (Continued):
- Implement an LR (Least Recently) cache.
- Implement a min-max stack.
More Trees and Graphs:
- Word Search
- Symmetric Tree
- Topological Sort
- Graph Valid Tree
More Behavioral Questions (Continued):
- How do you handle constructive criticism?
- Tell me about a time when you had to meet a tight deadline.
More System Design (Continued):
- Design a video streaming service.
- Design a social media platform.
Coding Challenges (Continued):
- Implement a Trie (Prefix Tree).
- Longest Palindromic Subsequence
More Dynamic Programming:
- Longest Valid Parentheses
- Maximum Subarray Sum
- Best Time to Buy and Sell Stock III
More Object-Oriented Design:
- Design a Parking Lot (Extended)
- Design a Coffee Machine
Coding Challenges (Continued):
- Longest Increasing Subsequence
- Maximum Depth of N-ary Tree
Behavioral Questions (Continued):
- How do you handle tight deadlines and multiple projects?
- Tell me about a time when you had to deal with a difficult project stakeholder.
More Sorting and Searching:
- Median of Two Sorted Arrays
- Search a 2D Matrix
- First Missing Positive
More Linked Lists:
- Reverse Nodes in k-Group
- Copy List with Random Pointer
More Trees and Graphs (Continued):
- Diameter of Binary Tree
- Top K Frequent Elements
More System Design (Continued):
- Design a file storage system.
- Design an online marketplace.
More SQL:
- Write a SQL query to find the third-highest salary.
- Write a SQL query to find the names of employees who have duplicates in the Employee table.
Coding Challenges (Continued):
- Implement an efficient substring search algorithm (e.g., KMP algorithm).
- Implement an algorithm to detect a cycle in a directed graph.
More Dynamic Programming (Continued):
- Decode Ways
- Longest Palindromic Substring
More Behavioral Questions:
- Describe a situation where you had to handle a difficult team member.
- How do you stay updated with the latest industry trends?
More Object-Oriented Design:
- Design a restaurant reservation system.
- Design a collaborative document editing system.
More Coding Challenges:
- Implement an efficient algorithm for string pattern matching (e.g., Rabin-Karp algorithm).
- Implement a function to check if a binary tree is balanced.
More Behavioral Questions:
- How do you handle working with a difficult team member?
- Tell me about a time when you had to make a decision without all the necessary information.
More Sorting and Searching:
- Search in Rotated Sorted Array II
- Find Peak Element
More Trees and Graphs (Continued):
- Diameter of N-ary Tree
- Alien Dictionary
More System Design (Continued):
- Design a ride-sharing system.
- Design an online coding platform.
More SQL:
- Write a SQL query to find the employees with the highest salary in each department.
- Write a SQL query to find the second-highest salary without using the LIMIT clause.
Coding Challenges (Continued):
- Implement a simple database engine.
- Implement an algorithm to find the shortest path in a weighted graph (Dijkstra's algorithm).
More Dynamic Programming (Continued):
- Longest Increasing Path in a Matrix
- Word Break II
More Behavioral Questions:
- Describe a situation where you had to deal with a demanding project manager.
- How do you handle disagreements within a team?
More System Design:
- Design an online polling system.
- Design a video conferencing system.
More Coding Challenges:
- Implement a garbage collector.
- Implement an algorithm to check if a directed graph is a tree.
More Object-Oriented Design:
- Design a file synchronization system.
- Design a music streaming service.
More Behavioral Questions:
- How do you handle tight deadlines and multiple competing priorities?
- Tell me about a time when you had to lead a team through a challenging project.
More Coding Challenges:
- Implement a distributed key-value store.
- Implement an algorithm to find the strongly connected components in a directed graph.
More Behavioral Questions:
- How do you handle failure and learn from mistakes?