Skip to main content

Software Engineer Interview Questions

Review this list of 593 Software Engineer interview questions and answers verified by hiring managers and candidates.
  • Apple logoAsked at Apple 

    "This is a geometric variation of the "Sliding Window" technique. The core challenge is converting a 2D coordinate problem into a 1D linear problem using angles. The standard approach is the Angular Sweep. By converting the Cartesian coordinates (x,y) of every tree into Polar coordinates (specifically the angle θ), we can process the trees based on the direction they lie in relative to the observer. The Strategy Coordinate Translation: Calculate the relative coordinates (Δx,Δy) for"

    Ashish D. - "This is a geometric variation of the "Sliding Window" technique. The core challenge is converting a 2D coordinate problem into a 1D linear problem using angles. The standard approach is the Angular Sweep. By converting the Cartesian coordinates (x,y) of every tree into Polar coordinates (specifically the angle θ), we can process the trees based on the direction they lie in relative to the observer. The Strategy Coordinate Translation: Calculate the relative coordinates (Δx,Δy) for"See full answer

    Software Engineer
    Data Structures & Algorithms
    +1 more
  • +2

    "def sortedSquares(nums): n = len(nums) result = [0] * n left, right = 0, n - 1 pos = n - 1 while left abs(nums[right]): result[pos] = nums[left] ** 2 left += 1 else: result[pos] = nums[right] ** 2 right -= 1 pos -= 1 return result `"

    Ramachandra N. - "def sortedSquares(nums): n = len(nums) result = [0] * n left, right = 0, n - 1 pos = n - 1 while left abs(nums[right]): result[pos] = nums[left] ** 2 left += 1 else: result[pos] = nums[right] ** 2 right -= 1 pos -= 1 return result `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +1 more
  • Adobe logoAsked at Adobe 
    +23

    "We can use dictionary to store cache items so that our read / write operations will be O(1). Each time we read or update an existing record, we have to ensure the item is moved to the back of the cache. This will allow us to evict the first item in the cache whenever the cache is full and we need to add new records also making our eviction O(1) Instead of normal dictionary, we will use ordered dictionary to store cache items. This will allow us to efficiently move items to back of the cache a"

    Alfred O. - "We can use dictionary to store cache items so that our read / write operations will be O(1). Each time we read or update an existing record, we have to ensure the item is moved to the back of the cache. This will allow us to evict the first item in the cache whenever the cache is full and we need to add new records also making our eviction O(1) Instead of normal dictionary, we will use ordered dictionary to store cache items. This will allow us to efficiently move items to back of the cache a"See full answer

    Software Engineer
    Data Structures & Algorithms
    +6 more
  • "Request inputs/feedback on my response below with regards to this question and ways to improve and if it looks apt for this question. As a TPM at xxx, I was responsible for delivering a feature that would provide prescription (medications) alternatives to users in the Prescription Shopping Consumer Experience App. The project had a tight deadline as it was something that our account management team promised to a client who wanted it for their employees. My goal was to ensure smooth development"

    Pavani B. - "Request inputs/feedback on my response below with regards to this question and ways to improve and if it looks apt for this question. As a TPM at xxx, I was responsible for delivering a feature that would provide prescription (medications) alternatives to users in the Prescription Shopping Consumer Experience App. The project had a tight deadline as it was something that our account management team promised to a client who wanted it for their employees. My goal was to ensure smooth development"See full answer

    Software Engineer
    Behavioral
    +1 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Microsoft logoAsked at Microsoft 
    Software Engineer
    Data Structures & Algorithms
    +1 more
  • Amazon logoAsked at Amazon 
    +2

    " To clarify on what we are trying to solve for and get the definition of a distributed scheduler straight . So A Distributed Scheduler refers to a system that can handle job scheduling and execution in a scalable and fault-tolerant manner by distributing the workload across multiple servers or nodes. we will make some assumptions with the design , as follows: we will assume 10,000 QPS for job submissions and should be able query for jobs status . Job execution should have minimal latency"

    Scott S. - " To clarify on what we are trying to solve for and get the definition of a distributed scheduler straight . So A Distributed Scheduler refers to a system that can handle job scheduling and execution in a scalable and fault-tolerant manner by distributing the workload across multiple servers or nodes. we will make some assumptions with the design , as follows: we will assume 10,000 QPS for job submissions and should be able query for jobs status . Job execution should have minimal latency"See full answer

    Software Engineer
    System Design
    +1 more
  • "This was a 60 minute assessment. The clock is ticking and you're being observed by a senior+ level engineer. Be ready to perform for an audience. The implementation for the system gets broken up into three parts: Implement creating accounts and depositing money into an account by ID Implement transferring money with validation to ensure the accounts for the transfer both exist and that the account money is being removed from has enough money in it to perform the transfer Implement find"

    devopsjesus - "This was a 60 minute assessment. The clock is ticking and you're being observed by a senior+ level engineer. Be ready to perform for an audience. The implementation for the system gets broken up into three parts: Implement creating accounts and depositing money into an account by ID Implement transferring money with validation to ensure the accounts for the transfer both exist and that the account money is being removed from has enough money in it to perform the transfer Implement find"See full answer

    Software Engineer
    Coding
    +1 more
  • Amazon logoAsked at Amazon 

    "function longestCommonPrefix(arr1, arr2) { const prefixSet = new Set(); for (let num of arr1) { let str = num.toString(); for (let i = 1; i <= str.length; i++) { prefixSet.add(str.substring(0, i)); } } let longestPrefix = ""; for (let num of arr2) { let str = num.toString(); for (let i = 1; i <= str.length; i++) { let prefix = str.substring(0, i); if (prefixSet.has(prefix)) { "

    Maykon henrique D. - "function longestCommonPrefix(arr1, arr2) { const prefixSet = new Set(); for (let num of arr1) { let str = num.toString(); for (let i = 1; i <= str.length; i++) { prefixSet.add(str.substring(0, i)); } } let longestPrefix = ""; for (let num of arr2) { let str = num.toString(); for (let i = 1; i <= str.length; i++) { let prefix = str.substring(0, i); if (prefixSet.has(prefix)) { "See full answer

    Software Engineer
    Data Structures & Algorithms
    +1 more
  • "Assumptions - Multiple reader/writer threads issue set() [with transaction] and get() operations concurrently All data can fit into memory. Requirements - Good performance (ex. less lock contention) Optimize memory footprint (ex. don't store stale entries in memory) Naive Approach - Wrap a standard hashmap/dictionary with reader-writer lock. We can also shard the map to reduce lock contention (ex. 32 segments for 32 core cpu) Allocate local buffer to a writer when a transacti"

    Pushkar G. - "Assumptions - Multiple reader/writer threads issue set() [with transaction] and get() operations concurrently All data can fit into memory. Requirements - Good performance (ex. less lock contention) Optimize memory footprint (ex. don't store stale entries in memory) Naive Approach - Wrap a standard hashmap/dictionary with reader-writer lock. We can also shard the map to reduce lock contention (ex. 32 segments for 32 core cpu) Allocate local buffer to a writer when a transacti"See full answer

    Software Engineer
    Coding
  • +2

    "Sounds like both the features requests address different problems, although it should be clarified in my opinion. I'd try to dig deep into why the customers are raising the requests to uncover the pain points. Questions like the following would help: "How are you currently solving it?" "What does it mean for you in terms of Cost or productivity?" (based on the context of the product) "Have you searched for an alternative?" Descriptive answers for the above questions should tell us if the"

    Kapil P. - "Sounds like both the features requests address different problems, although it should be clarified in my opinion. I'd try to dig deep into why the customers are raising the requests to uncover the pain points. Questions like the following would help: "How are you currently solving it?" "What does it mean for you in terms of Cost or productivity?" (based on the context of the product) "Have you searched for an alternative?" Descriptive answers for the above questions should tell us if the"See full answer

    Software Engineer
    Behavioral
  • Bloomberg logoAsked at Bloomberg 

    " max Min 4, 3, 1 , 6, 7, 8 1 3 4 6 7 8 9 0 1 2 3 0 1 1 2 3 6 7 8 9 class MedianFinder{ std::priority_queue minHeap; std::priority_queue, greater> maxHeap; int numEleMaxheap = 0, numEleMinHeap = 0; public: void addNum( int n) { if(numEleMaxheap == numEleMinHeap ) { maxHeap.push(n); int maxofmaxheap = maxHeap.top(); maxHeap.pop(); "

    Ankush G. - " max Min 4, 3, 1 , 6, 7, 8 1 3 4 6 7 8 9 0 1 2 3 0 1 1 2 3 6 7 8 9 class MedianFinder{ std::priority_queue minHeap; std::priority_queue, greater> maxHeap; int numEleMaxheap = 0, numEleMinHeap = 0; public: void addNum( int n) { if(numEleMaxheap == numEleMinHeap ) { maxHeap.push(n); int maxofmaxheap = maxHeap.top(); maxHeap.pop(); "See full answer

    Software Engineer
    Data Structures & Algorithms
    +1 more
  • Anthropic logoAsked at Anthropic 
    Software Engineer
    Artificial Intelligence
    +2 more
  • Software Engineer
    Behavioral
    +1 more
  • Uber logoAsked at Uber 

    "''' Problem Statement: Design a simplified Robinhood-like stock trading platform. Requirements: User Management: createuser(userid, name, initial_balance): Create user with cash balance getbalance(userid): Get user's cash balance deposit(user_id, amount): Add funds to account withdraw(user_id, amount): Withdraw funds (if sufficient balance) Stock Operations: updatestockprice(symbol, price): Update current price of a stock getstockprice(symb"

    Rahul .. - "''' Problem Statement: Design a simplified Robinhood-like stock trading platform. Requirements: User Management: createuser(userid, name, initial_balance): Create user with cash balance getbalance(userid): Get user's cash balance deposit(user_id, amount): Add funds to account withdraw(user_id, amount): Withdraw funds (if sufficient balance) Stock Operations: updatestockprice(symbol, price): Update current price of a stock getstockprice(symb"See full answer

    Software Engineer
    System Design
  • Microsoft logoAsked at Microsoft 
    +8

    "Assumptions: Platform: iOS/Android and Web Application Service Type: Renting Bicycles (hourly, daily, weekly), possibility of buying or selling Geography: Focusing on Asian markets, e.g., India, where bicycles are a popular mode of transportation Role: Product Manager at Microsoft Objective: Design an app focusing on customer engagement and new customer acquisition Setting the Stage: Why a Renting Business? Market Potential: In Asian markets, a si"

    Nagendra S. - "Assumptions: Platform: iOS/Android and Web Application Service Type: Renting Bicycles (hourly, daily, weekly), possibility of buying or selling Geography: Focusing on Asian markets, e.g., India, where bicycles are a popular mode of transportation Role: Product Manager at Microsoft Objective: Design an app focusing on customer engagement and new customer acquisition Setting the Stage: Why a Renting Business? Market Potential: In Asian markets, a si"See full answer

    Software Engineer
    Product Design
    +1 more
  • Anthropic logoAsked at Anthropic 
    Software Engineer
    Behavioral
    +5 more
  • Software Engineer
    Behavioral
  • Amazon logoAsked at Amazon 
    Video answer for 'Design a reservation and payment system for a parking garage.'
    +12

    "Since there is a need for the data to be accurate and consistent without any latency to allocate a spot, can't the data be synchronously synced to replicas after every write as the number of writes are not many per min, instead of read lock phenomena Let me know if i am on a wrong thought here."

    Chitapuram N. - "Since there is a need for the data to be accurate and consistent without any latency to allocate a spot, can't the data be synchronously synced to replicas after every write as the number of writes are not many per min, instead of read lock phenomena Let me know if i am on a wrong thought here."See full answer

    Software Engineer
    System Design
    +2 more
Showing 41-60 of 593