Tekion
40+ Amazon Interview Questions and Answers
Q1. Can you describe the coding challenge you participated in, including the JavaScript concepts that were tested, such as currying and object flattening?
I participated in a coding challenge that tested JavaScript concepts like currying and object flattening.
The coding challenge involved implementing a function that demonstrates currying in JavaScript.
Another part of the challenge required flattening nested objects using recursion.
I used higher-order functions and closures to achieve currying in the challenge.
The challenge also tested my understanding of object manipulation and traversal in JavaScript.
Q2. DSA round: Find pair of integers equalling a sum k
Use a hashmap to store seen elements and check if complement exists in the hashmap.
Create a hashmap to store seen elements.
Iterate through the array and for each element, check if the complement (k - current element) exists in the hashmap.
If complement exists, return the pair of integers.
Example: For array [2, 7, 11, 15] and sum 9, the pair of integers is (2, 7).
Q3. Connect nodes of a tree that are on the same level
Connect nodes of a tree on the same level
Use a queue to traverse the tree level by level
For each level, connect the nodes using their next pointer
If a node has no next node, set its next pointer to null
Q4. difference between useMemo vs useCallback
useMemo is used to memoize a value, while useCallback is used to memoize a function.
useMemo is used to optimize expensive calculations by caching the result.
useCallback is used to optimize the rendering of child components by memoizing event handlers.
useMemo returns the cached value, while useCallback returns the memoized function.
Both hooks take a dependency array to determine when to recalculate or re-render.
Q5. DSA round: Find anagrams of a string
Anagrams of a string are words or phrases formed by rearranging the letters of the original string.
Create a hashmap to store the frequency of characters in the input string
Iterate through the array of strings and check if the frequency of characters matches with the input string
Add the strings that are anagrams of the input string to the result array
Q6. Prepare Low level Design machine coding
Low level design machine coding involves writing detailed code for specific functions or algorithms.
Identify the specific functionality or algorithm to be implemented
Break down the functionality into smaller components
Write detailed code for each component, considering efficiency and optimization
Test and debug the code to ensure it works as expected
Q7. Progress bar designing in react
Progress bar in React can be designed using CSS and state management.
Use CSS to style the progress bar
Use state management to update the progress value dynamically
Consider using libraries like react-progress-bar to simplify implementation
Q8. Add two numbers represented as a linked list
Add two numbers represented as a linked list
Traverse both linked lists and add corresponding nodes
Handle carry over to next node
Create a new linked list to store the result
Q9. what is useState
useState is a hook in React that allows functional components to manage state.
useState is a built-in hook in React.
It allows functional components to have stateful logic.
useState returns an array with two elements: the current state value and a function to update it.
The initial state value is passed as an argument to useState.
The state value can be of any data type, including objects and arrays.
The update function returned by useState can be called to modify the state value.
C...read more
Q10. how we use useEffect
useEffect is a React Hook used to perform side effects in functional components.
useEffect is used to handle side effects like data fetching, subscriptions, or manually changing the DOM.
It takes two arguments: a function that contains the side effect logic, and an optional array of dependencies.
The function inside useEffect is executed after the component renders and after every update, unless dependencies are specified.
If dependencies are provided, the effect will only be re-...read more
Q11. Design Uber supplier dispatch
Design Uber supplier dispatch
Create a system to match drivers with riders based on location and availability
Use real-time data to optimize dispatching and reduce wait times
Implement a rating system to ensure quality service from drivers
Integrate with payment and mapping systems for seamless user experience
Q12. Easy tree traversal problem
Implement tree traversal algorithm to visit each node in a tree structure
Use depth-first search (DFS) or breadth-first search (BFS) to traverse the tree
DFS can be implemented using recursion or a stack data structure
BFS can be implemented using a queue data structure
Example: Inorder traversal of a binary tree - left, root, right
Q13. Design a in memory database
An in-memory database is a database that primarily relies on main memory for data storage and retrieval.
Utilize data structures like hash tables or trees for fast data access
Implement caching mechanisms to optimize performance
Consider data persistence strategies for durability
Support for transactions and concurrency control
Example: Redis, Memcached
Q14. Design notification Service
Design a notification service for sending alerts to users.
Use a scalable messaging system like Kafka or RabbitMQ to handle high volume of notifications.
Implement a user subscription system to allow users to choose which notifications they want to receive.
Include different channels for notifications such as email, SMS, and push notifications.
Consider implementing a scheduling system to send notifications at specific times.
Ensure notifications are personalized and relevant to e...read more
Q15. Implement LLD of Splitwise
Splitwise is a bill splitting application where users can track and split expenses with friends.
Design classes for User, Expense, Group, and Transaction
Implement functions for adding expenses, settling debts, and generating reports
Consider scalability and data storage options like databases
Handle currency conversions and real-time updates for balances
Q16. HLD design problem on current project implementation
I designed the HLD for our current project implementation.
Identified the main components and their interactions
Created a high-level architecture diagram
Considered scalability, maintainability, and performance
Collaborated with team members to ensure alignment with requirements
Q17. what is API testing ,why it is necessary.
API testing is the process of testing APIs to ensure they meet functionality, reliability, performance, and security requirements.
Ensures that APIs work as expected and meet specifications
Verifies functionality, reliability, performance, and security of APIs
Helps identify bugs, errors, and issues in the API
Ensures compatibility with different systems and environments
Automates testing processes for efficiency
Examples: testing API endpoints, data validation, error handling
Q18. Timer in react Js
In React JS, timers can be implemented using setInterval or setTimeout functions.
Use setInterval for recurring timers
Use setTimeout for one-time timers
Remember to clear the timer using clearInterval or clearTimeout when component unmounts
Q19. Path of longest sum
Find the path in a matrix with the longest sum of elements
Start from the top-left corner of the matrix
Move only right or down in the matrix
Keep track of the sum of elements in each path
Return the path with the longest sum
Q20. Left View of a binary tree
Left view of a binary tree is the set of nodes visible when the tree is viewed from the left side.
The leftmost node at each level is included in the left view.
Use depth-first search to traverse the tree and keep track of the maximum level seen so far.
If the current node is at a level greater than the maximum level seen so far, add it to the left view and update the maximum level seen.
Q21. Sliding window negative numbers in window
Sliding window negative numbers in window
Implement a sliding window algorithm to find the maximum sum of a subarray of size k
Use a double-ended queue (deque) to efficiently maintain the maximum element in the window
Handle negative numbers by checking if the maximum element is outside the current window
Q22. Right view of a binary tree
The right view of a binary tree shows the rightmost node at each level.
Traverse the tree in a depth-first manner, starting from the right child of each node.
Keep track of the current level and only add the rightmost node of each level to the result.
Example: For the tree [1,2,3,null,5,null,4], the right view is [1,3,4].
Q23. What about the hybrid mode. and working in early stage startups?
Hybrid mode refers to a combination of remote and in-office work, common in early stage startups.
Hybrid mode allows for flexibility in work location, combining the benefits of remote work with in-person collaboration.
Working in early stage startups can be exciting and fast-paced, with opportunities to take on diverse responsibilities and make a significant impact.
It is important to be adaptable and willing to wear multiple hats in a startup environment.
Communication skills ar...read more
Q24. How do you approach designing for a problem statement
I approach designing for a problem statement by conducting research, brainstorming ideas, creating prototypes, and testing solutions.
Start by thoroughly understanding the problem statement and the needs of the users
Conduct research to gather insights and data related to the problem
Brainstorm potential solutions and sketch out initial concepts
Create prototypes to visualize and test different design ideas
Iterate on the prototypes based on feedback and user testing
Finalize the d...read more
Q25. 1. Detect loop in linkedlist 2. Iterative preorder traversal of binary tree
Detect loop in linkedlist and iterative preorder traversal of binary tree
To detect a loop in a linked list, we can use Floyd's Cycle Detection Algorithm by using two pointers - slow and fast.
For iterative preorder traversal of a binary tree, we can use a stack to keep track of nodes and visit them in the correct order.
Example: For detecting a loop in a linked list, if the slow and fast pointers meet at some point, then there is a loop.
Example: For iterative preorder traversal...read more
Q26. Find number of 2s in a given number
Count the number of 2s in a given number
Iterate through each digit of the number and count the occurrences of 2
Convert the number to a string for easier manipulation
Handle edge cases like negative numbers or zero
Q27. How you can work under overloaded tasks
I prioritize tasks based on urgency and importance, communicate with stakeholders for realistic deadlines, and delegate when necessary.
Prioritize tasks based on urgency and importance
Communicate with stakeholders for realistic deadlines
Delegate tasks when necessary
Q28. Guesstimates - No of vehicles running at a particular time in Mumbai
Approximately 3 million vehicles are estimated to be running in Mumbai at any given time.
Consider the total number of registered vehicles in Mumbai
Factor in the percentage of vehicles that are typically on the road during peak hours
Take into account the different types of vehicles such as cars, bikes, buses, and trucks
Consider the traffic congestion levels in different areas of Mumbai
Q29. LLD design Hotel management system
The Hotel management system is a software solution that helps in managing various operations of a hotel.
The system should have modules for managing reservations, check-ins, check-outs, and room availability.
It should allow the hotel staff to assign rooms to guests and manage room rates.
The system should handle billing and payment processing.
It should provide reporting and analytics features to track hotel performance.
Integration with other systems like online booking platform...read more
Q30. Vertical Order Traversal of a tree
Vertical Order Traversal of a tree
Vertical order traversal is a way to traverse a binary tree from top to bottom, left to right
Nodes are printed in order of their horizontal distance from the root node
If two nodes have the same horizontal distance, they are printed in the order they appear in the tree
Q31. Design a digital app for online food ordering
A user-friendly digital app for convenient online food ordering with various restaurant options and customizable orders.
User-friendly interface for easy navigation
Integration with multiple restaurants for a wide variety of options
Customizable orders with options for special requests
Secure payment gateway for seamless transactions
Order tracking feature for real-time updates
Q32. Parking lot design
Parking lot design involves layout, size, capacity, and efficiency considerations.
Consider the layout to maximize space and ease of access for vehicles.
Include designated spots for different types of vehicles (e.g. compact, electric, disabled).
Implement efficient traffic flow patterns to reduce congestion and improve safety.
Incorporate technology like sensors and automated payment systems for convenience.
Ensure proper lighting and security measures for safety of vehicles and ...read more
Q33. Explanation About BDD Framework
BDD (Behavior Driven Development) framework is a software development approach that focuses on collaboration between developers, QA, and non-technical stakeholders.
BDD involves writing scenarios in plain language using Gherkin syntax (Given, When, Then)
Scenarios are written from the perspective of an end user's behavior
BDD helps in improving communication and understanding between team members
Popular BDD frameworks include Cucumber, SpecFlow, and Behave
Q34. Low level Design of Twitter
Low level design of Twitter involves various components like servers, databases, APIs, and algorithms.
Twitter uses a distributed system architecture with multiple servers for handling user requests and data storage.
The system uses a combination of relational and NoSQL databases for storing user data and tweets.
APIs are used for communication between different components of the system and for providing access to third-party developers.
Twitter uses various algorithms for tasks ...read more
Q35. what are es6 updates
ES6 updates refer to the new features and syntax improvements introduced in ECMAScript 6, also known as ES2015.
Arrow functions for more concise syntax
Let and const for block-scoped variables
Classes for object-oriented programming
Template literals for easier string interpolation
Destructuring assignment for extracting values from arrays and objects
Spread and rest operators for easier manipulation of arrays and objects
Q36. Design Airplane Booking System
Design a system for booking airplane tickets efficiently and securely.
Create a user-friendly interface for customers to search and book flights.
Implement a secure payment system for processing transactions.
Include features for managing flight schedules, seat availability, and pricing.
Integrate with airlines' reservation systems for real-time updates.
Provide options for seat selection, meal preferences, and special requests.
Generate e-tickets and send confirmation emails to cu...read more
Q37. Design your current system
Current system is a web-based application for managing customer data and orders.
Frontend built with React for user interface
Backend built with Node.js and Express for server-side logic
Database using MySQL for storing customer data and orders
Authentication using JWT tokens for secure access
Q38. arraow fun vs normal fun
Arrow functions are concise and have implicit return, while normal functions have more flexibility and can be named.
Arrow functions are written with a concise syntax using '=>'
Arrow functions do not have their own 'this' keyword
Normal functions can be named and have more flexibility in terms of syntax and behavior
Q39. File upload progress
File upload progress can be tracked using various methods.
Use AJAX to send progress updates to the server
Use HTML5 File API to track progress on the client side
Use server-side libraries like multer to track progress on the server side
Q40. Manual Testing Process
Manual testing process involves executing test cases manually without the use of automation tools.
Creating test cases based on requirements
Executing test cases manually
Recording test results
Reporting defects
Re-testing fixed defects
Q41. What is AP and AR cycle
AP and AR cycle refers to the process of accounts payable and accounts receivable in a company.
AP cycle involves receiving and processing invoices from vendors, making payments, and maintaining accurate records.
AR cycle involves sending invoices to customers, receiving payments, and reconciling accounts.
Efficient AP and AR cycles are crucial for maintaining healthy cash flow and relationships with vendors and customers.
Q42. find top k elements?
Use sorting or heap data structure to find top k elements in an array.
Sort the array in descending order and return the first k elements.
Use a max heap data structure to efficiently find the top k elements.
Time complexity can be O(n log n) for sorting or O(n log k) for heap method.
Q43. define event loop ?
Event loop is a mechanism in JavaScript that allows for asynchronous operations to be executed in a non-blocking way.
Event loop continuously checks the call stack for any functions that need to be executed.
If the call stack is empty, the event loop checks the callback queue for any pending tasks.
Event loop moves tasks from the callback queue to the call stack for execution.
Example: setTimeout function in JavaScript uses event loop to execute a function after a specified delay...read more
Q44. Extract numbers from String
Extract numbers from a string and return as an array of strings.
Use regular expressions to match digits in the string.
Iterate through the string and extract digits using isdigit() function.
Split the string using non-digit characters as delimiters and return the resulting array.
Q45. Sum of sub array
The problem involves finding the sum of all possible subarrays in an array of integers.
Use nested loops to iterate through all possible subarrays
Keep track of the sum of each subarray as you iterate
Consider edge cases like empty array or negative numbers
Q46. experience on REST API's
Experience working with REST API's in previous roles.
Developed and maintained RESTful APIs for various applications
Used tools like Postman for testing and debugging API endpoints
Worked with JSON and XML data formats for API communication
Q47. Tools used for troubleshoting
Common tools for troubleshooting include log analysis tools, network monitoring tools, and remote desktop tools.
Log analysis tools such as Splunk or ELK stack can help identify errors and issues in application logs.
Network monitoring tools like Wireshark or Nagios can help pinpoint network-related problems.
Remote desktop tools like TeamViewer or AnyDesk can be used to troubleshoot issues on end-user machines remotely.
Q48. and experience using splunk
I have experience using Splunk for log management and analysis.
Utilized Splunk to monitor and analyze log data for troubleshooting issues
Created custom dashboards and alerts to track system performance
Used Splunk queries to identify patterns and trends in log data
Integrated Splunk with other tools for seamless data analysis
Q49. Fetch data using API
Fetching data using API in React JS
Use the fetch() function to make an HTTP request to the API endpoint
Handle the response using .then() and .catch() methods
Parse the response data using JSON.parse()
Update the state or display the data on the frontend
Top HR Questions asked in Amazon
Interview Process at Amazon
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month