DSA Guide
Advanced Level DSA Sheet

150 Important FAANG Interview Questions

console.log('Hello, Duniya!')

Data Structures and Algorithms:

Arrays and Strings:

  1. Two Sum
  2. Container With Most Water
  3. Trapping Rain Water
  4. Longest Substring Without Repeating Characters
  5. Merge Intervals
  6. Valid Parentheses
  7. Product of Array Except Self
  8. Rotate Image
  9. Group Anagrams
  10. Longest Palindromic Substring

Linked Lists:

  1. Reverse Linked List
  2. Merge Two Sorted Lists
  3. Detect Cycle in a Linked List
  4. Remove Nth Node From End of List
  5. Intersection of Two Linked Lists
  6. Copy List with Random Pointer

Stacks and Queues:

  1. Valid Parentheses
  2. Implement Stack using Queues
  3. Design Circular Queue
  4. Largest Rectangle in Histogram

Trees and Graphs:

  1. Maximum Depth of Binary Tree
  2. Validate Binary Search Tree
  3. Lowest Common Ancestor of a Binary Tree
  4. Course Schedule
  5. Word Ladder
  6. Number of Islands
  7. Clone Graph

Sorting and Searching:

  1. Search in Rotated Sorted Array
  2. Find First and Last Position of Element in Sorted Array
  3. Kth Largest Element in an Array

Dynamic Programming:

  1. Climbing Stairs
  2. Longest Increasing Subsequence
  3. Maximum Subarray
  4. Edit Distance
  5. Coin Change
  6. Word Break
  7. Regular Expression Matching

Backtracking:

  1. N-Queens
  2. Combination Sum
  3. Subsets

System Design:

  1. Design a URL Shortening Service
  2. Design a Cache System
  3. Design a Distributed File System
  4. Design a News Feed System
  5. Design Twitter

Object-Oriented Design:

  1. Design a Parking Lot
  2. Design a Library Management System
  3. Design an Elevator System
  4. Design an Online Shopping System

Behavioral Questions:

  1. Tell me about yourself.
  2. Describe a challenging project you've worked on.
  3. How do you handle stress and pressure?
  4. Describe a conflict you had with a colleague and how you resolved it.
  5. What is your greatest professional achievement?
  6. How do you prioritize tasks and manage time?
  7. Tell me about a time when you failed and what you learned from it.
  8. Why do you want to work for [Company]?

SQL:

  1. Write a SQL query to find the second-highest salary.
  2. Write a SQL query to find duplicate rows in a table.
  3. Write a SQL query to calculate the average salary for each department.

System Architecture:

  1. Explain the difference between horizontal and vertical scaling.
  2. How does a load balancer work?

Operating Systems:

  1. Explain the difference between process and thread.
  2. What is virtual memory?

Networking:

  1. What happens when you type a URL into your browser's address bar?

Coding Challenges:

  1. Implement a basic calculator.
  2. Implement a trie (prefix tree).
  3. Implement a stack that supports push, pop, top, and retrieving the minimum element in constant time.
  4. Serialize and deserialize a binary tree.
  5. Implement a LRU (Least Recently Used) cache.

More Algorithms:

  1. Longest Common Subsequence
  2. Minimum Window Substring
  3. Unique Paths
  4. Maximum Subarray Sum Circular
  5. Reconstruct Itinerary

Behavioral Questions (Continued):

  1. How do you handle ambiguity?
  2. Tell me about a time you had to learn a new technology quickly.

More System Design:

  1. Design a TinyURL system.
  2. Design a recommendation system.
  3. Design a chat application.

Database Design:

  1. Normalize a database schema.

Coding Challenges (Continued):

  1. Implement an LR (Least Recently) cache.
  2. Implement a min-max stack.

More Trees and Graphs:

  1. Word Search
  2. Symmetric Tree
  3. Topological Sort
  4. Graph Valid Tree

More Behavioral Questions (Continued):

  1. How do you handle constructive criticism?
  2. Tell me about a time when you had to meet a tight deadline.

More System Design (Continued):

  1. Design a video streaming service.
  2. Design a social media platform.

Coding Challenges (Continued):

  1. Implement a Trie (Prefix Tree).
  2. Longest Palindromic Subsequence

More Dynamic Programming:

  1. Longest Valid Parentheses
  2. Maximum Subarray Sum
  3. Best Time to Buy and Sell Stock III

More Object-Oriented Design:

  1. Design a Parking Lot (Extended)
  2. Design a Coffee Machine

Coding Challenges (Continued):

  1. Longest Increasing Subsequence
  2. Maximum Depth of N-ary Tree

Behavioral Questions (Continued):

  1. How do you handle tight deadlines and multiple projects?
  2. Tell me about a time when you had to deal with a difficult project stakeholder.

More Sorting and Searching:

  1. Median of Two Sorted Arrays
  2. Search a 2D Matrix
  3. First Missing Positive

More Linked Lists:

  1. Reverse Nodes in k-Group
  2. Copy List with Random Pointer

More Trees and Graphs (Continued):

  1. Diameter of Binary Tree
  2. Top K Frequent Elements

More System Design (Continued):

  1. Design a file storage system.
  2. Design an online marketplace.

More SQL:

  1. Write a SQL query to find the third-highest salary.
  2. Write a SQL query to find the names of employees who have duplicates in the Employee table.

Coding Challenges (Continued):

  1. Implement an efficient substring search algorithm (e.g., KMP algorithm).
  2. Implement an algorithm to detect a cycle in a directed graph.

More Dynamic Programming (Continued):

  1. Decode Ways
  2. Longest Palindromic Substring

More Behavioral Questions:

  1. Describe a situation where you had to handle a difficult team member.
  2. How do you stay updated with the latest industry trends?

More Object-Oriented Design:

  1. Design a restaurant reservation system.
  2. Design a collaborative document editing system.

More Coding Challenges:

  1. Implement an efficient algorithm for string pattern matching (e.g., Rabin-Karp algorithm).
  2. Implement a function to check if a binary tree is balanced.

More Behavioral Questions:

  1. How do you handle working with a difficult team member?
  2. Tell me about a time when you had to make a decision without all the necessary information.

More Sorting and Searching:

  1. Search in Rotated Sorted Array II
  2. Find Peak Element

More Trees and Graphs (Continued):

  1. Diameter of N-ary Tree
  2. Alien Dictionary

More System Design (Continued):

  1. Design a ride-sharing system.
  2. Design an online coding platform.

More SQL:

  1. Write a SQL query to find the employees with the highest salary in each department.
  2. Write a SQL query to find the second-highest salary without using the LIMIT clause.

Coding Challenges (Continued):

  1. Implement a simple database engine.
  2. Implement an algorithm to find the shortest path in a weighted graph (Dijkstra's algorithm).

More Dynamic Programming (Continued):

  1. Longest Increasing Path in a Matrix
  2. Word Break II

More Behavioral Questions:

  1. Describe a situation where you had to deal with a demanding project manager.
  2. How do you handle disagreements within a team?

More System Design:

  1. Design an online polling system.
  2. Design a video conferencing system.

More Coding Challenges:

  1. Implement a garbage collector.
  2. Implement an algorithm to check if a directed graph is a tree.

More Object-Oriented Design:

  1. Design a file synchronization system.
  2. Design a music streaming service.

More Behavioral Questions:

  1. How do you handle tight deadlines and multiple competing priorities?
  2. Tell me about a time when you had to lead a team through a challenging project.

More Coding Challenges:

  1. Implement a distributed key-value store.
  2. Implement an algorithm to find the strongly connected components in a directed graph.

More Behavioral Questions:

  1. How do you handle failure and learn from mistakes?