Expedia Group
Tata Lockheed Martin Aerostructures Interview Questions and Answers
Q1. Given array of integer create subarray with sum = 0
Create subarrays with sum = 0 from given array of integers.
Iterate through the array and keep track of the running sum.
Store the running sum in a hashmap and check if the current sum - any previous sum equals 0.
If yes, then the subarray between those two indices has a sum of 0.
Q2. System Design - Design a parking lot
Design a parking lot system with features like parking, retrieving, and tracking available spots.
Create a ParkingLot class with attributes like total number of spots, available spots, and a list of parked vehicles.
Implement methods for parking a vehicle, retrieving a vehicle, and tracking available spots.
Use data structures like arrays or lists to manage parked vehicles and available spots.
Consider implementing features like ticketing system, vehicle size restrictions, and pa...read more
Q3. Longest subsequence with sum zero
Find the longest subsequence in an array with sum zero.
Iterate through the array and keep track of the running sum.
Store the running sum in a hashmap along with the index.
If the same sum is encountered again, the subsequence between the two indices has a sum of zero.
Q4. System design: Hotel booking system
Design a hotel booking system for managing reservations and availability.
Use a database to store hotel information, room availability, and reservations.
Implement user authentication and authorization for booking.
Include a search feature for users to find available rooms based on their criteria.
Allow users to make reservations, modify or cancel them.
Send confirmation emails to users after successful bookings.
Q5. Find diameter of tree
The diameter of a tree is the longest path between two leaf nodes in the tree.
Calculate the longest path between two leaf nodes in the tree
This can be done by finding the height of the left and right subtrees and adding them together
The diameter of the tree is the maximum of either the diameter of the left subtree, the diameter of the right subtree, or the sum of the heights of the left and right subtrees
Q6. Left view of binary tree
The left view of a binary tree is the set of nodes visible when the tree is viewed from the left side.
Traverse the tree in a level order manner and keep track of the first node at each level.
Use a queue to store nodes at each level and update the left view nodes accordingly.
Example: For a binary tree with root node 1, left child 2, and right child 3, the left view would be [1, 2].
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month