Add office photos
Engaged Employer

Amazon

4.1
based on 24.8k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

Firepro Systems Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Given a binary tree, count the number of occurrences where there are two nodes with the same horizontal distance. To make it clearer, if we assume each node in a cell of a matrix, then count the number of occur...

read more
Ans.

Count occurrences of two nodes with same horizontal distance in a binary tree

  • Traverse the tree using BFS or DFS and keep track of horizontal distance of each node

  • Store nodes with same horizontal distance in a hash table and increment count if collision occurs

  • Recursively traverse left and right subtrees with updated horizontal distance

  • Time complexity: O(n), Space complexity: O(n)

Add your answer

Q2. Given an array and a number, check whether there are any 3 elements in the array which add up to the given number

Ans.

Check if any 3 elements in an array add up to a given number

  • Sort the array in ascending order

  • Use nested loops to iterate through all possible combinations of 3 elements

  • Check if the sum of the 3 elements equals the given number

  • Return true if a match is found, else false

Add your answer

Q3. What are the things you will consider (both from Developer’s perspective and User perspective) while trying to develop an application for computer aided competitive examinations like CAT, GMAT etc

Ans.

Considerations for developing an application for computer aided competitive exams

  • User-friendly interface for easy navigation

  • Accurate and reliable question bank

  • Timed tests to simulate real exam conditions

  • Option to save and resume tests

  • Detailed performance analysis and feedback

  • Compatibility with different devices and operating systems

  • Regular updates and bug fixes

  • Developer should consider the security of the application to prevent cheating

  • User perspective: The application should...read more

Add your answer

Q4. Given a singly linked list, write a recursive method to reverse every 3 nodes in the list. I did not write a clean code for this. He moved on because of lack of time

Ans.

Reverse every 3 nodes in a singly linked list using recursion

  • Create a recursive function that takes in a node and a count

  • If count is less than 3, return the node

  • Reverse the first 3 nodes and call the function recursively with the 4th node and count 1

  • Connect the reversed nodes to the rest of the list

  • Return the new head of the reversed list

Add your answer
Discover Firepro Systems interview dos and don'ts from real experiences

Q5. Write some test methods for stress testing of Furniture class

Ans.

Test methods for stress testing of Furniture class

  • Create a large number of Furniture objects and check for memory leaks

  • Simulate heavy usage by continuously calling methods and check for performance issues

  • Test the Furniture class with maximum allowed input values and check for any errors or crashes

Add your answer

Q6. Given a linked list, write a program to check if it is a palindrome

Ans.

Program to check if a linked list is a palindrome

  • Traverse the linked list and push each element onto a stack

  • Traverse the linked list again and compare each element with the top of the stack

  • If all elements match, the linked list is a palindrome

Add your answer

Q7. Given a number, find the nearest perfect square(modified binary search)

Ans.

Given a number, find the nearest perfect square using modified binary search.

  • Start with low=0 and high=num.

  • While low<=high, find mid=(low+high)/2.

  • If mid*mid==num, return mid.

  • If mid*mid

  • If mid*mid>num, update high=mid-1.

  • Return the closest perfect square to num.

Add your answer

More about working at Amazon

Top Rated Mega Company - 2024
Top Rated Company for Women - 2024
Top Rated Internet/Product Company - 2024
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter