Promotion title
Promotion description
Button Text

Software Engineering Interview Questions (With Answers)

Discover top software engineering interview questions with answers, including real questions asked at Google, Amazon, Meta, Microsoft, and other major tech companies.
Michael Guan
Written by
Michael Guan
Ruiying Li
Edited by
Ruiying Li
Jaya Muvania
Reviewed by
Jaya Muvania
Updated on
Jan 1, 2026
Read time
5 min read

A few years ago, people used to say that software engineering was the safest career you could pick. Today, it’s the job that shows up in almost every layoff headline. Hiring slowed down, interviews became tougher, and AI suddenly became the “reason” everyone started blaming.

But the real story is more layered. In our detailed blog on the Software Engineering Job Market, we showed how hiring first exploded around 2021–2022, then sharply corrected, and never fully bounced back. Companies overhired during the digitization rush, remote work opened global talent pools, and then cost-cutting began. AI became a convenient scapegoat, but the deeper issue was simple: demand didn’t match the hiring spree.

So where does that leave you, someone preparing for software engineering interviews? The good news is that software engineering jobs didn’t disappear. They just matured. Basic coding roles are shrinking. High-skill engineering roles are growing.

Companies today want engineers who can:

  • think clearly
  • understand systems, not just syntax
  • design, debug, and reason about trade-offs
  • work alongside AI tools instead of being replaced by them

And that’s exactly what interviews now test, like more system design and more “why did you choose this approach?” and fewer pure LeetCode dumps and more real-world thinking.

So in this blog, we’ll focus on software engineering interview questions that actually reflect today’s market, the questions companies are asking in 2026 to find engineers who can think, design, and adapt.

What are Software Engineering interview questions?

Software engineering interview questions are designed to assess a candidate's technical skills, problem-solving abilities, and understanding of software development principles. These questions often cover topics such as algorithms, data structures, system design, and coding proficiency. They aim to evaluate both theoretical knowledge and practical application in real-world scenarios.

Why do interviewers ask Software Engineering questions?

The main purpose of software engineering interview questions is to evaluate a candidate's technical expertise, problem-solving skills, and ability to apply software development principles in practical scenarios. Interviewers ask these questions to ensure that the candidate can effectively contribute to the team and handle the challenges of the role.

25 Software Engineering interview questions

Here are some essential software engineering interview questions to help you prepare:

  1. Write a function to reverse a string.
  2. Implement a function to check if a string is a palindrome.
  3. Write a program to find the factorial of a number using recursion.
  4. Create a function that returns the Fibonacci sequence up to a given number.
  5. Write a function to find the largest element in an array.
  6. Implement a function to sort an array using bubble sort.
  7. Write a program to merge two sorted arrays into one sorted array.
  8. Create a function to check if two strings are anagrams of each other.
  9. Write a function to count the number of vowels in a given string.
  10. Implement a function to find the intersection of two arrays.
  11. Write a program to find the first non-repeating character in a string.
  12. Create a function to remove duplicates from an array.
  13. Write a function to implement binary search on a sorted array.
  14. Implement a function to find the longest substring without repeating characters.
  15. Write a program to check if a given number is prime.
  16. Create a function to calculate the greatest common divisor (GCD) of two numbers.
  17. Write a function to rotate an array to the right by a given number of steps.
  18. Implement a function to find the missing number in an array containing n distinct numbers.
  19. Write a program to generate all permutations of a given string.
  20. Create a function to find the maximum sum of a contiguous subarray (Kadane's algorithm).
  21. Write a function to implement depth-first search (DFS) on a binary tree.
  22. Implement a function to check if a binary tree is balanced.
  23. Write a program to serialize and deserialize a binary tree.
  24. Create a function to find the shortest path in a grid using breadth-first search (BFS).
  25. Write a function to implement a basic LRU (Least Recently Used) cache.

1. Write a function to reverse a string.

Why you might get asked this: Reversing a string is a fundamental problem that tests your understanding of basic string manipulation and algorithmic thinking, which are crucial skills for any software engineering role.

How to answer:

  • Explain the logic behind reversing a string by swapping characters from both ends.
  • Write a simple iterative solution using a loop to swap characters.
  • Discuss the time complexity of the solution, which is O(n).

Example answer:

"To reverse a string, you can use a two-pointer approach where you swap characters from the beginning and end of the string until you meet in the middle. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python:

def reverse_string(s):    left, right = 0, len(s) - 1    s = list(s)    while left < right:        s[left], s[right] = s[right], s[left]        left += 1        right -= 1    return ''.join(s)

2. Implement a function to check if a string is a palindrome.

Why you might get asked this: Checking if a string is a palindrome tests your ability to manipulate strings and understand algorithmic efficiency, which are essential skills for roles such as software development and data analysis.

How to answer:

  • Explain the concept of a palindrome and how it reads the same forwards and backwards.
  • Describe a two-pointer technique to compare characters from both ends of the string.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"A palindrome is a string that reads the same forwards and backwards. To check if a string is a palindrome, you can use a two-pointer approach to compare characters from both ends of the string."

Here is a simple implementation in Python:

def is_palindrome(s):    left, right = 0, len(s) - 1    while left < right:        if s[left] != s[right]:            return False        left += 1        right -= 1    return True

3. Write a program to find the factorial of a number using recursion.

Why you might get asked this: Finding the factorial of a number using recursion tests your understanding of recursive functions and mathematical concepts, which are fundamental skills for software engineering roles, such as backend development.

How to answer:

  • Explain the concept of recursion and how it can be used to solve the problem.
  • Describe the base case for the recursion, which is when the number is 0 or 1.
  • Discuss the recursive case where the function calls itself with the number minus one.

Example answer:

"To find the factorial of a number using recursion, you define a base case where the factorial of 0 or 1 is 1. Then, you recursively call the function with the number minus one and multiply the result by the number."

Here is a simple implementation in Python:

def factorial(n):    if n == 0 or n == 1:        return 1    else:        return n * factorial(n - 1)

4. Create a function that returns the Fibonacci sequence up to a given number.

Why you might get asked this: Creating a function that returns the Fibonacci sequence up to a given number tests your understanding of recursion and iterative algorithms, which are essential skills for software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of the Fibonacci sequence and its recursive nature.
  • Describe both the recursive and iterative approaches to generate the sequence.
  • Mention the time complexity of each approach, highlighting the efficiency of the iterative method.

Example answer:

"To generate the Fibonacci sequence up to a given number, you can use an iterative approach to avoid the exponential time complexity of the recursive method. This ensures that the solution is efficient and scalable."

Here is a simple implementation in Python:

def fibonacci(n):    fib_sequence = [0, 1]    while len(fib_sequence) < n:        fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])    return fib_sequence[:n]

5. Write a function to find the largest element in an array.

Why you might get asked this: Finding the largest element in an array tests your understanding of basic array manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as frontend development, for example.

How to answer:

  • Explain the logic of iterating through the array to compare each element.
  • Describe how to keep track of the maximum value found during the iteration.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To find the largest element in an array, you can iterate through the array while keeping track of the maximum value found so far. This approach ensures an efficient O(n) time complexity."

Here is a simple implementation in Python:

def find_largest_element(arr):    max_element = arr[0]    for element in arr:        if element > max_element:            max_element = element    return max_element

6. Implement a function to sort an array using bubble sort.

Why you might get asked this: Implementing a function to sort an array using bubble sort tests your understanding of basic sorting algorithms and their efficiency, which are fundamental skills for software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of bubble sort and how it repeatedly swaps adjacent elements if they are in the wrong order.
  • Describe the process of iterating through the array multiple times until it is sorted.
  • Mention the time complexity of bubble sort, which is O(n^2) in the worst case.

Example answer:

"To sort an array using bubble sort, you repeatedly swap adjacent elements if they are in the wrong order. This process continues until the array is sorted, ensuring an O(n^2) time complexity in the worst case."

Here is a simple implementation in Python:

def bubble_sort(arr):    n = len(arr)    for i in range(n):        for j in range(0, n-i-1):            if arr[j] > arr[j+1]:                arr[j], arr[j+1] = arr[j+1], arr[j]    return arr

7. Write a program to merge two sorted arrays into one sorted array.

Why you might get asked this: Merging two sorted arrays into one sorted array tests your understanding of array manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of merging two sorted arrays by comparing elements from both arrays.
  • Describe how to use two pointers to keep track of the current position in each array.
  • Mention the time complexity of the solution, which is O(n + m).

Example answer:

"To merge two sorted arrays into one sorted array, you can use a two-pointer approach to compare elements from both arrays and insert the smaller element into the result array. This ensures an efficient O(n + m) time complexity."

Here is a simple implementation in Python:

def merge_sorted_arrays(arr1, arr2):    merged_array = []    i, j = 0, 0    while i < len(arr1) and j < len(arr2):        if arr1[i] < arr2[j]:            merged_array.append(arr1[i])            i += 1        else:            merged_array.append(arr2[j])            j += 1    merged_array.extend(arr1[i:])    merged_array.extend(arr2[j:])    return merged_array

8. Create a function to check if two strings are anagrams of each other.

Why you might get asked this: Checking if two strings are anagrams tests your understanding of string manipulation and algorithmic efficiency, which are essential skills for software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of anagrams and how they contain the same characters in different orders.
  • Describe how to use sorting or a frequency counter to compare the two strings.
  • Mention the time complexity of the solution, which is O(n log n) for sorting or O(n) for the frequency counter method.

Example answer:

"To check if two strings are anagrams, you can use a frequency counter to compare the character counts of both strings. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python:

def are_anagrams(str1, str2):    return sorted(str1) == sorted(str2)

9. Write a function to count the number of vowels in a given string.

Why you might get asked this: Counting the number of vowels in a given string tests your understanding of string manipulation and basic algorithmic efficiency, which are essential skills for many software engineering roles, such as frontend development, for example.

How to answer:

  • Explain the logic of iterating through the string and checking each character.
  • Describe how to use a set to store the vowels for quick lookup.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To count the number of vowels in a given string, you can iterate through the string and check each character against a set of vowels. This approach ensures an efficient O(n) time complexity."

Here is a simple implementation in Python:

def count_vowels(s):    vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}    return sum(1 for char in s if char in vowels)

10. Implement a function to find the intersection of two arrays.

Why you might get asked this: Implementing a function to find the intersection of two arrays tests your understanding of array manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of finding common elements between two arrays.
  • Describe how to use a set to store elements from one array for quick lookup.
  • Mention the time complexity of the solution, which is O(n + m).

Example answer:

"To find the intersection of two arrays, you can use a set to store elements from one array and then iterate through the second array to check for common elements. This method ensures an efficient O(n + m) time complexity."

Here is a simple implementation in Python:

def intersection(arr1, arr2):    set1 = set(arr1)    return [element for element in arr2 if element in set1]

11. Write a program to find the first non-repeating character in a string.

Why you might get asked this: Finding the first non-repeating character in a string tests your understanding of string manipulation and algorithmic efficiency, which are essential skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of using a hash map to store character counts.
  • Describe how to iterate through the string to find the first character with a count of one.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To find the first non-repeating character in a string, you can use a hash map to store the count of each character. Then, iterate through the string again to find the first character with a count of one."

Here is a simple implementation in Python:

def first_non_repeating_char(s):    char_count = {}    for char in s:        char_count[char] = char_count.get(char, 0) + 1    for char in s:        if char_count[char] == 1:            return char    return None

12. Create a function to remove duplicates from an array.

Why you might get asked this: Removing duplicates from an array tests your understanding of array manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of using a set to store unique elements.
  • Describe how to iterate through the array and add elements to the set.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To remove duplicates from an array, you can use a set to store unique elements as you iterate through the array. This approach ensures an efficient O(n) time complexity."

Here is a simple implementation in Python:

def remove_duplicates(arr):    return list(set(arr))

13. Write a function to implement binary search on a sorted array.

Why you might get asked this: Implementing binary search on a sorted array tests your understanding of search algorithms and their efficiency, which are fundamental skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of binary search and how it divides the array in half to find the target element.
  • Describe the process of updating the search range by adjusting the left and right pointers based on the comparison.
  • Mention the time complexity of binary search, which is O(log n).

Example answer:

"To implement binary search on a sorted array, you repeatedly divide the search interval in half. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half; otherwise, narrow it to the upper half."

Here is a simple implementation in Python:

def binary_search(arr, target):    left, right = 0, len(arr) - 1    while left <= right:        mid = (left + right) // 2        if arr[mid] == target:            return mid        elif arr[mid] < target:            left = mid + 1        else:            right = mid - 1    return -1

14. Implement a function to find the longest substring without repeating characters.

Why you might get asked this: Implementing a function to find the longest substring without repeating characters tests your understanding of string manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the sliding window technique to keep track of the current substring without repeating characters.
  • Describe how to use a hash map to store the last seen index of each character.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To find the longest substring without repeating characters, you can use a sliding window technique to keep track of the current substring and a hash map to store the last seen index of each character. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python:

def longest_substring_without_repeating(s):    char_index_map = {}    left = 0    max_length = 0    for right in range(len(s)):        if s[right] in char_index_map:            left = max(left, char_index_map[s[right]] + 1)        char_index_map[s[right]] = right        max_length = max(max_length, right - left + 1)    return max_length

15. Write a program to check if a given number is prime.

Why you might get asked this: Checking if a given number is prime tests your understanding of basic mathematical concepts and algorithmic efficiency, which are essential skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of a prime number and how it is only divisible by 1 and itself.
  • Describe the process of checking divisibility from 2 up to the square root of the number.
  • Mention the time complexity of the solution, which is O(√n).

Example answer:

"To check if a given number is prime, you can iterate from 2 up to the square root of the number and check for divisibility. If the number is not divisible by any of these, it is prime."

Here is a simple implementation in Python:

def is_prime(n):    if n <= 1:        return False    for i in range(2, int(n**0.5) + 1):        if n % i == 0:            return False    return True

16. Create a function to calculate the greatest common divisor (GCD) of two numbers.

Why you might get asked this: Calculating the greatest common divisor (GCD) of two numbers tests your understanding of mathematical algorithms and their efficiency, which are fundamental skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of the greatest common divisor and its importance in mathematics.
  • Describe the Euclidean algorithm, which uses repeated division to find the GCD.
  • Mention the time complexity of the Euclidean algorithm, which is O(log(min(a, b))).

Example answer:

"To calculate the greatest common divisor (GCD) of two numbers, you can use the Euclidean algorithm, which repeatedly applies the modulus operation until the remainder is zero. This method ensures an efficient O(log(min(a, b))) time complexity."

Here is a simple implementation in Python: def gcd(a, b): while b: a, b = b, a % b return a

17. Write a function to rotate an array to the right by a given number of steps.

Why you might get asked this: Rotating an array to the right by a given number of steps tests your understanding of array manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of array rotation and how elements are shifted to the right.
  • Describe how to use slicing to achieve the rotation efficiently.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To rotate an array to the right by a given number of steps, you can use slicing to split the array into two parts and then concatenate them in reverse order. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python: def rotate_array(arr, k): k = k % len(arr) return arr[-k:] + arr[:-k]

18. Implement a function to find the missing number in an array containing n distinct numbers.

Why you might get asked this: Implementing a function to find the missing number in an array containing n distinct numbers tests your understanding of array manipulation and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of the sum of the first n natural numbers and how it can be used to find the missing number.
  • Describe how to calculate the expected sum and the actual sum of the array elements.
  • Mention that the difference between the expected sum and the actual sum gives the missing number.

Example answer:

"To find the missing number in an array containing n distinct numbers, you can use the formula for the sum of the first n natural numbers and subtract the sum of the array elements from it. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python: def find_missing_number(arr): n = len(arr) + 1 expected_sum = n * (n + 1) // 2 actual_sum = sum(arr) return expected_sum - actual_sum

19. Write a program to generate all permutations of a given string.

Why you might get asked this: Generating all permutations of a given string tests your understanding of recursion and combinatorial algorithms, which are essential skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of permutations and how they represent all possible arrangements of a string's characters.
  • Describe a recursive approach to generate permutations by swapping characters.
  • Mention the time complexity of the solution, which is O(n!).

Example answer:

"To generate all permutations of a given string, you can use a recursive approach where you swap characters to create new permutations. This method ensures that all possible arrangements of the string's characters are explored."

Here is a simple implementation in Python: def permute(s, l=0, r=None): if r is None: r = len(s) - 1 if l == r: print(''.join(s)) else: for i in range(l, r + 1): s[l], s[i] = s[i], s[l] permute(s, l + 1, r) s[l], s[i] = s[i], s[l]

20. Create a function to find the maximum sum of a contiguous subarray (Kadane's algorithm).

Why you might get asked this: Creating a function to find the maximum sum of a contiguous subarray using Kadane's algorithm tests your understanding of dynamic programming and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of Kadane's algorithm and how it finds the maximum sum of a contiguous subarray.
  • Describe how to maintain a running sum and update the maximum sum found so far.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To find the maximum sum of a contiguous subarray, you can use Kadane's algorithm, which maintains a running sum and updates the maximum sum found so far. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python: def max_subarray_sum(arr): max_current = max_global = arr[0] for num in arr[1:]: max_current = max(num, max_current + num) if max_current > max_global: max_global = max_current return max_global

21. Write a function to implement depth-first search (DFS) on a binary tree.

Why you might get asked this: Implementing depth-first search (DFS) on a binary tree tests your understanding of tree traversal algorithms and their efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of depth-first search and its traversal methods (preorder, inorder, postorder).
  • Describe how to use a stack or recursion to traverse the tree.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To implement depth-first search (DFS) on a binary tree, you can use a recursive approach to traverse the tree in preorder, inorder, or postorder. This method ensures that all nodes are visited efficiently with an O(n) time complexity."

Here is a simple implementation in Python:

def dfs_preorder(node):    if node:        print(node.val)        dfs_preorder(node.left)        dfs_preorder(node.right)

22. Implement a function to check if a binary tree is balanced.

Why you might get asked this: Implementing a function to check if a binary tree is balanced tests your understanding of tree data structures and algorithmic efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of a balanced binary tree and how its left and right subtrees' heights differ by no more than one.
  • Describe a recursive approach to check the height of each subtree and ensure the difference is within the allowed range.
  • Mention the time complexity of the solution, which is O(n).

Example answer:

"To check if a binary tree is balanced, you can use a recursive approach to determine the height of each subtree and ensure the difference is no more than one. This method ensures an efficient O(n) time complexity."

Here is a simple implementation in Python: def is_balanced(root): def height(node): if not node: return 0 left_height = height(node.left) right_height = height(node.right) if left_height == -1 or right_height == -1 or abs(left_height - right_height) > 1: return -1 return max(left_height, right_height) + 1 return height(root) != -1

23. Write a program to serialize and deserialize a binary tree.

Why you might get asked this: Writing a program to serialize and deserialize a binary tree tests your understanding of tree data structures and their practical applications, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of serialization and deserialization and their importance in saving and restoring the tree structure.
  • Describe how to use preorder traversal to serialize the tree into a string representation.
  • Mention how to use the same traversal order to deserialize the string back into the original tree structure.

Example answer:

"To serialize a binary tree, you can use preorder traversal to convert the tree into a string representation. To deserialize, you can use the same traversal order to reconstruct the tree from the string."

Here is a simple implementation in Python:

def serialize(root):    def helper(node):        if not node:            return "None,"        return str(node.val) + "," + helper(node.left) + helper(node.right)    return helper(root)def deserialize(data):    def helper(nodes):        val = next(nodes)        if val == "None":            return None        node = TreeNode(int(val))        node.left = helper(nodes)        node.right = helper(nodes)        return node    return helper(iter(data.split(',')))

24. Create a function to find the shortest path in a grid using breadth-first search (BFS).

Why you might get asked this: Creating a function to find the shortest path in a grid using breadth-first search (BFS) tests your understanding of graph traversal algorithms and their efficiency, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of breadth-first search and how it explores nodes level by level.
  • Describe how to use a queue to keep track of the current path and nodes to be explored.
  • Mention the time complexity of the solution, which is O(n * m) for an n by m grid.

Example answer:

"To find the shortest path in a grid using breadth-first search (BFS), you can use a queue to explore nodes level by level, ensuring that the first time you reach the target node, it's via the shortest path. This method guarantees an efficient O(n * m) time complexity for an n by m grid."

Here is a simple implementation in Python:

def bfs_shortest_path(grid, start, end):    from collections import deque    rows, cols = len(grid), len(grid[0])    queue = deque([(start, 0)])    visited = set()    directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]        while queue:        (x, y), dist = queue.popleft()        if (x, y) == end:            return dist        for dx, dy in directions:            nx, ny = x + dx, y + dy            if 0 <= nx < rows and 0 <= ny < cols and grid[nx][ny] == 0 and (nx, ny) not in visited:                visited.add((nx, ny))                queue.append(((nx, ny), dist + 1))    return -1

25. Write a function to implement a basic LRU (Least Recently Used) cache.

Why you might get asked this: Implementing a basic LRU (Least Recently Used) cache tests your understanding of data structures and caching mechanisms, which are crucial skills for many software engineering roles, such as backend development, for example.

How to answer:

  • Explain the concept of an LRU cache and its importance in optimizing memory usage.
  • Describe how to use a combination of a dictionary and a doubly linked list to implement the cache.
  • Mention the time complexity of the operations, which is O(1) for both insertion and retrieval.

Example answer:

"To implement a basic LRU (Least Recently Used) cache, you can use a combination of a dictionary for O(1) access and a doubly linked list to maintain the order of usage. This ensures that both insertion and retrieval operations are efficient with O(1) time complexity."

Here is a simple implementation in Python:

class LRUCache:    def __init__(self, capacity: int):        self.cache = {}        self.capacity = capacity        self.order = []        def get(self, key: int) -> int:        if key in self.cache:            self.order.remove(key)            self.order.append(key)            return self.cache[key]        return -1        def put(self, key: int, value: int) -> None:        if key in self.cache:            self.order.remove(key)        elif len(self.cache) >= self.capacity:            oldest = self.order.pop(0)            del self.cache[oldest]        self.cache[key] = value        self.order.append(key)

25 Amazon Software Engineering interview questions

Coding and Problem-Solving Questions

  1. Reverse a linked list.
  2. Detect a cycle in a linked list and return the starting node.
  3. Find the longest substring without repeating characters.
  4. Merge k sorted linked lists.
  5. Implement LRU cache.
  6. Given an array, find two numbers that sum to a target.
  7. Find the first non-repeating character in a string.
  8. Return the kth largest element in an array.
  9. Implement a queue using two stacks.
  10. Check if a binary tree is a valid BST.
  11. Serialize and deserialize a binary tree.
  12. Find the lowest common ancestor in a binary tree.
  13. Search in a rotated sorted array.
  14. Implement binary search without recursion.
  15. Design a rate limiter.

System Design Questions (Amazon loves these)

  1. Design Amazon.com homepage.
  2. Design a URL shortener like bit.ly.
  3. Design a scalable notification service.
  4. Design a real-time chat system.
  5. Design a logging system that handles millions of logs per second.
  6. Design an online shopping cart system.
  7. Design a recommendation engine like “Customers also bought…”

Behavioral (Amazon Leadership Principles)

  1. Tell me about a time you disagreed with your manager.
  2. Tell me about a time you failed and what you learned.
  3. Describe a situation where you had to deliver with very little time or resources.

20 Google Software Engineering interview questions

  1. How would you design a URL shortening service like bit.ly?
  2. Given a stream of integers, how do you find the median at any point in time?
  3. Write a function to detect whether a binary tree is height balanced.
  4. How would you find the kth smallest element in a binary search tree?
  5. Given an array of integers, find the longest increasing subsequence.
  6. How would you design a global file storage system like Google Drive?
  7. Given a rotated sorted array, search for a target element.
  8. How do you detect and remove a cycle in a linked list?
  9. Merge k sorted linked lists into one sorted list.
  10. How would you find the smallest window substring containing all characters of another string?
  11. Implement autocomplete for a search box with millions of queries.
  12. Given a matrix of 0s and 1s, find the largest square containing only 1s.
  13. How would you design a system to handle billions of search queries per day?
  14. Implement a function to serialize and deserialize a binary tree.
  15. Given two strings, determine if one is a permutation of the other.
  16. How would you build a spell checker?
  17. Implement a rate limiter for an API service.
  18. Find the first missing positive integer in an unsorted array.
  19. Given logs of user login and logout times, find the maximum number of concurrent users.
  20. How would you design Google Maps backend for real-time traffic updates?

20 Microsoft software engineering interview questions

  1. Tell me about a challenging technical problem you solved recently.
  2. How would you design a file-sharing system like OneDrive?
  3. Given a linked list, reverse it in place.
  4. How would you detect and remove a cycle in a linked list?
  5. Design an elevator control system.
  6. Write code to find the kth smallest element in a BST.
  7. Describe a time you handled conflict within your team.
  8. Implement a function to check if two strings are anagrams.
  9. How would you design a messaging system like Microsoft Teams?
  10. Find the median of two sorted arrays.
  11. Tell me about a time when you had incomplete requirements. What did you do?
  12. Implement an iterative inorder traversal of a binary tree.
  13. How would you design an autocomplete system?
  14. Describe a time when you led a project without formal authority.
  15. Implement a function to serialize and deserialize a binary tree.
  16. How would you design a real-time document collaboration tool?
  17. Write a function to find the first non-repeating character in a string.
  18. Describe a situation where you had to make a trade-off in system design.
  19. Implement a basic memory allocator.
  20. How would you design a load balancer?

20 Meta (Facebook) software engineering interview questions

  1. Tell me about a time you had to move fast with incomplete information.
  2. Design a news feed system for billions of users.
  3. How would you detect whether a binary tree is height-balanced?
  4. Implement LRU cache.
  5. Design a URL shortening service like bit.ly.
  6. Given a list of meetings, merge overlapping intervals.
  7. Describe a time you disagreed strongly with a teammate. What did you do?
  8. Write code to find the longest substring without repeating characters.
  9. How would you design Facebook Messenger backend?
  10. Implement a function to find the diameter of a binary tree.
  11. Tell me about a time you had to prioritize between speed and quality.
  12. Find the number of islands in a grid.
  13. How would you scale a photo-sharing system like Instagram?
  14. Implement top-k frequent elements in an array.
  15. Describe a situation where you owned a project end-to-end.
  16. Write a function to detect palindrome linked list.
  17. How would you design a system to store and retrieve user posts?
  18. Implement BFS and DFS without recursion.
  19. Tell me about a failure you learned from.
  20. How would you detect spam or abusive behavior on a platform?

20 Apple software engineering interview questions

  1. Tell me about a time you had to deal with an ambiguous problem at work.
  2. Design an efficient system to sync photos across multiple Apple devices.
  3. Implement a function to check if two binary trees are the same.
  4. How would you design an app store ranking and recommendation system?
  5. Write code to reverse a linked list.
  6. Describe a situation where you strongly disagreed with a product or design decision.
  7. Implement a function to detect a cycle in a linked list.
  8. How would you design iMessage backend architecture?
  9. Given an array of integers, find two numbers that add up to a target.
  10. Tell me about a time you obsessed over product quality.
  11. Implement an in-order traversal of a binary tree without recursion.
  12. How would you design a file storage system for iCloud?
  13. Write code to find the kth smallest element in a BST.
  14. Describe a time when you had to work with very tight performance constraints.
  15. Implement a function to validate a binary search tree.
  16. How would you design a system to stream music to millions of users?
  17. Tell me about a time you made something simpler for users or teammates.
  18. Write code to check if a string is a permutation of another string.
  19. How would you optimize app startup time on iOS?
  20. Tell me about a technically challenging bug you fixed and how you approached it.

20 Netflix software engineering interview questions

  1. Tell me about a time you had full ownership of a project and how you handled it.
  2. Design Netflix’s movie recommendation system.
  3. How would you design a highly available video streaming platform.
  4. Implement a service to track what users are currently watching in real time.
  5. Design a system to handle millions of concurrent video streams.
  6. Describe a time you disagreed strongly with a teammate or manager. What did you do.
  7. Implement a function to detect cycles in a directed graph.
  8. How would you ensure fault tolerance in a large distributed system.
  9. Write code to find k closest elements to a target in a sorted array.
  10. Tell me about a time you failed and what you learned from it.
  11. How would you design a global content delivery network.
  12. Implement a rate limiter for API requests.
  13. Describe a time you worked in an environment with very little structure.
  14. Implement a function to find the longest palindromic substring.
  15. How would you monitor streaming quality and detect playback issues automatically.
  16. Design a microservices architecture for Netflix user profiles.
  17. Write code to implement autocomplete using a trie.
  18. Tell me about the hardest performance problem you solved in code.
  19. Implement producer–consumer using threads.
  20. How would you migrate a large monolith service to microservices without downtime.

20 Tesla software engineering interview questions

  1. Tell me about a time you had to deliver under extremely tight deadlines.
  2. How would you design a software system that collects real-time sensor data from vehicles.
  3. Describe a time when you had very little guidance and still had to ship something important.
  4. How would you design an over-the-air update service for cars on the road.
  5. Implement a function to detect cycles in a linked list.
  6. Tell me about a bug that caused real customer impact. What did you do next.
  7. How would you design a charging-station locator system for electric vehicles.
  8. Describe a disagreement you had with a strong teammate. How did you resolve it.
  9. Implement a function to find the longest increasing subsequence.
  10. How would you architect software that runs on limited hardware in vehicles.
  11. Tell me about a time you balanced speed versus correctness.
  12. Design a real-time monitoring dashboard for vehicle health data.
  13. Implement a scheduler for tasks based on priority.
  14. Tell me about a time you had to learn a completely new technology very fast.
  15. How would you design communication between thousands of IoT devices and a central server.
  16. Explain a system you built that had to be highly reliable with minimal downtime.
  17. Implement a function to merge k sorted linked lists.
  18. Tell me about the most challenging production issue you debugged.
  19. How would you store and process petabytes of telemetry data efficiently.
  20. Describe a time when you took complete ownership of a problem.

20 Uber software engineering interview questions

  1. Tell me about a time you solved a high-pressure production issue.
  2. How would you design a system to match riders with nearby drivers.
  3. Implement LRU Cache.
  4. Describe a situation where you optimized slow code or a slow service.
  5. How would you design surge pricing logic for a ride-sharing platform.
  6. Implement a function to detect if a binary tree is balanced.
  7. Tell me about a time you had conflicting priorities and how you handled them.
  8. Design a real-time location tracking system for millions of users.
  9. Implement a function to find kth largest element in an array.
  10. Describe a time you disagreed with product requirements. What did you do.
  11. How would you design a payment processing system for Uber.
  12. Implement a function to check if two strings are anagrams.
  13. Tell me about a failure you experienced in production and what you learned.
  14. How would you design a rating and review system for drivers and riders.
  15. Implement a solution for meeting rooms required given time intervals.
  16. Describe a time you worked with incomplete requirements.
  17. How would you detect fraud on a ride-sharing platform.
  18. Implement a function to return top k frequent elements.
  19. Tell me about a time you owned a project end to end.
  20. How would you design a system to estimate arrival time (ETA) for rides.

20 Airbnb software engineering interview questions

  1. Design a system to match guests with available listings based on filters like price, dates, and location.
  2. Tell me about a time you had to work with an ambiguous product requirement.
  3. Implement a function to merge overlapping intervals.
  4. How would you design a reviews and ratings system for hosts and guests.
  5. Describe a time you disagreed with your manager and what you did next.
  6. Implement a function to detect cycles in a linked list.
  7. How would you design a service to prevent double-booking on Airbnb.
  8. Tell me about a time you improved the performance of an application or service.
  9. Implement autocomplete for search suggestions using past user queries.
  10. How would you detect fraudulent bookings on the platform.
  11. Tell me about a time you worked across multiple teams to deliver a feature.
  12. Design a notification system for booking confirmations and reminders.
  13. Implement a solution for finding the median of two sorted arrays.
  14. Describe a time when you had to deal with production outage or incident.
  15. How would you design a service to recommend listings to users.
  16. Implement a function to group anagrams together from a list of words.
  17. Tell me about a project where you had to balance speed and quality.
  18. How would you design a system to handle seasonal traffic spikes.
  19. Implement a function for shortest path in a graph.
  20. Tell me about a time you owned a feature end to end.

20 Stripe software engineering interview questions

  1. How would you design a payment processing system that can handle millions of transactions per day.
  2. Implement a function to detect and prevent duplicate transactions in a payment stream.
  3. Design a system to handle idempotent API requests for payments.
  4. Given a list of transactions with timestamps, find suspicious patterns that may indicate fraud.
  5. How would you design a ledger system to record debits and credits accurately.
  6. Implement rate limiting for an API key calling payment endpoints.
  7. How would you design a subscription billing system with trials, discounts, and proration.
  8. Given a stream of events, design a system to ensure exactly-once processing.
  9. Implement a function to validate credit card numbers using the Luhn algorithm.
  10. How would you design a dashboard to show real-time revenue metrics for merchants.
  11. Design an internal service for currency conversion with live exchange rates.
  12. Implement a function to find the top k merchants by transaction volume over a sliding window.
  13. How would you design a webhook system that guarantees delivery and handles retries.
  14. Tell me about a time you had to debug a tricky production issue in a distributed system.
  15. Design a system that can roll back or compensate failed payment flows safely.
  16. Implement a function to reconcile two lists of transactions from different systems.
  17. How would you design role based access control for a payments dashboard used by multiple teams.
  18. Write a function to detect cycles in a dependency graph between services.
  19. How would you design an audit trail system for all payment-related operations.
  20. Tell me about a time you improved the performance or reliability of an existing service.

20 DoorDash software engineering interview questions

  1. Design a system to match delivery drivers with orders in real time.
  2. How would you design the ETA prediction system for food delivery.
  3. Implement an algorithm to assign orders to drivers to minimize total delivery time.
  4. How would you design surge pricing for high-demand areas.
  5. Given restaurant locations and customer addresses, how would you cluster orders for batch delivery.
  6. Design a notifications system that sends updates when orders are picked up and delivered.
  7. Implement a function to detect fraudulent orders or suspicious activity.
  8. How would you design a live order-tracking system on a map for customers.
  9. Implement a function to calculate delivery fee based on distance, time, and demand.
  10. Design the backend for a ratings and reviews system for restaurants and drivers.
  11. How would you ensure fairness when distributing orders among available drivers.
  12. Implement a function to find the optimal route for a driver with multiple deliveries.
  13. How would you design a scalable menu management system for thousands of restaurants.
  14. Implement rate limiting for restaurants or drivers accessing internal APIs.
  15. Design a system to personalize restaurant recommendations for each user.
  16. How would you design an outage handling system if a restaurant goes offline after orders are placed.
  17. Implement a function to detect duplicate orders in the system.
  18. How would you design a promotion or coupon system with eligibility rules.
  19. Tell me about a time you optimized the performance of a slow backend service.
  20. How would you design a system to handle refunds and partial refunds for incorrect orders.

Tips to prepare for Software Engineering questions

  • Understand the Fundamentals: Make sure you have a strong grasp of core concepts such as data structures, algorithms, and system design. These are the building blocks of most interview questions.
  • Practice Coding: Regularly solve coding problems on platforms like LeetCode, HackerRank, or CodeSignal. This will help you get comfortable with writing code under time constraints.
  • Review Past Projects: Be prepared to discuss your previous work experience and projects in detail. Highlight your role, the technologies used, and the challenges you faced.
  • Mock Interviews: Participate in mock interviews to simulate the real interview environment. This can help reduce anxiety and improve your communication skills.
  • Understand the Company: Research the company’s tech stack, products, and culture. Tailor your answers to show how your skills and experiences align with their needs.

Ace your interview with Final Round AI

If you need help with any of your other interviews, consider signing up for Final Round AI. Their comprehensive suite of AI-driven tools, including the Interview Copilot, AI Resume Builder, and AI Mock Interview, offers real-time guidance and actionable feedback to help you ace your interviews. With over 250K offers received and 1.2M interviews aced, Final Round AI has a proven track record of success. Don't miss out on the opportunity to boost your confidence and improve your interview performance. Sign up for Final Round AI today.

Upgrade your resume!

Create a hireable resume with just one click and stand out to recruiters.

Table of Contents

Ace Your Next Interview with Confidence

Unlock personalized guidance and perfect your responses with Final Round AI, ensuring you stand out and succeed in every interview.

Related articles