Filter interviews by
#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;
}
Top trending discussions
I appeared for an interview in May 2025, where I was asked the following questions.
AI tools include frameworks, libraries, and platforms that facilitate machine learning, data analysis, and natural language processing.
TensorFlow: An open-source library for machine learning and deep learning applications.
PyTorch: A flexible deep learning framework popular for research and production.
Scikit-learn: A library for classical machine learning algorithms in Python.
Keras: A high-level neural networks API that...
The one-on-one interview with HR was professional and informative.
The HR representative was friendly and welcoming
The questions asked were relevant to the position and my experience
I was given a clear overview of the company culture and expectations
I have 5 years of experience as a financial analyst at a Fortune 500 company.
Analyzed financial data to provide insights and recommendations
Created financial models to forecast future performance
Prepared reports for senior management
Collaborated with cross-functional teams on budgeting and forecasting
Identified cost-saving opportunities and efficiency improvements
I applied via LinkedIn and was interviewed before Nov 2022. There were 3 interview rounds.
General communication skills
posted on 17 Oct 2024
Aptitude test which goes nice and we done will and basic knowledge in excel and ms offcie tool
posted on 6 Apr 2025
I appeared for an interview before Apr 2024, where I was asked the following questions.
posted on 12 Sep 2023
I applied via Referral and was interviewed in Aug 2023. There were 4 interview rounds.
Normal level English grammer and General Maths
My strengths include attention to detail and adaptability, while my weakness is sometimes overcommitting to tasks.
Strength: Attention to detail - I ensure accuracy in data entry, reducing errors.
Strength: Adaptability - I quickly adjust to new processes and technologies.
Weakness: Overcommitting - I tend to take on too many tasks, which can lead to stress.
Example of strength: In my previous role, I improved the reportin...
posted on 13 May 2024
1 hour duration, related financial crisis
Easy for developer work on quant reasoning and verbal for aptitude round
Easy to medium level questions for coding round
based on 1 interview experience
Junior Engineer
181
salaries
| ₹1.8 L/yr - ₹5.5 L/yr |
Civil Engineer
160
salaries
| ₹2.4 L/yr - ₹7.5 L/yr |
Senior Engineer
159
salaries
| ₹4.7 L/yr - ₹10.7 L/yr |
Civil Site Engineer
147
salaries
| ₹2 L/yr - ₹6.6 L/yr |
Engineer
115
salaries
| ₹3.2 L/yr - ₹7.7 L/yr |
Larsen & Toubro Limited
L&T Construction
Tata Projects
Kalpataru Projects International