Filter interviews by
Top trending discussions
#include
#include
#include
#include
class SeatReservation {
private:
int n; // Number of rows
int m; // Number of seats per row
std::vector
public:
SeatReservation(int rows, int seatsPerRow) : n(rows), m(seatsPerRow) {
reservedSeats.resize(n);
}
std::string reserve(int r, int k) {
if (r < 1 || r > n || k < 1 || k > m) {
return "Invalid row or seat number";
}
// Check if requested seats are available
for (int i = k; i < k + 3; ++i) {
if (reservedSeats[r - 1].count(i) > 0) {
return "Seats not available";
}
}
// Reserve the seats
for (int i = k; i < k + 3; ++i) {
reservedSeats[r - 1].insert(i);
}
return "Booked with seat number " + std::to_string(k);
}
};
int main() {
// Example usage
SeatReservation theater(2, 3);
std::cout << theater.reserve(1, 3) << std::endl; // Booked with seat number 1
std::cout << theater.reserve(2, 4) << std::endl; // Seats not available
return 0;
}
posted on 17 Oct 2024
Aptitude test which goes nice and we done will and basic knowledge in excel and ms offcie tool
I applied via Walk-in and was interviewed in Jun 2023.
I applied via LinkedIn and was interviewed before Feb 2023.
Basics of coding and mathematics
Hackerrank and Java program
I applied via campus placement at Sri Savitribai Phule Womans Polytechnic, Pune and was interviewed in Mar 2021.
Assistant Manager
109
salaries
| ₹3 L/yr - ₹10.9 L/yr |
Field Engineer
105
salaries
| ₹1.5 L/yr - ₹4.5 L/yr |
Site Engineer
72
salaries
| ₹1.8 L/yr - ₹5.4 L/yr |
Senior Engineer
69
salaries
| ₹3.6 L/yr - ₹10.2 L/yr |
Project Manager
45
salaries
| ₹5 L/yr - ₹16.8 L/yr |
Shapoorji Pallonji Group
Kalpataru Projects International
KEC International
Nagarjuna Construction Company