Preparing for a tech interview? Here's a consolidated list of important questions I was asked in a recent interview, covering Object-Oriented Programming, System Design, DevOps, and DSA. Use this as a quick revision checklist!
🔹 OOP & Core Programming
- What are the pillars of OOP?
- Explain them with keywords in short.
- Explain OOP concepts in detail.
- Inheritance code example in short.
- Why is composition preferred over inheritance?
- Code example of singleton class in short.
- How to create object of singleton class?
- What is a singleton class?
- Function overloading vs overriding. Key difference?
- Use the above Animal and Dog class to implement function overriding.
- Suppose I want to invoke
speak
in that child class. How to do? - What is an access modifier?
- Example where function should be marked as protected instead of public.
- Give me a real-life use of protected.
- Types of inheritance.
🔹 System Design & DevOps
- What is DevOps?
- What is the role of load balancing in performance?
- CAP theorem.
🔹 Heap Data Structure
- Explain the concept of heap.
- Time complexity of heap data structure.
🔹 Rain Water Trapping Problem
- Rain water trap — solve using 2 vectors, first for max from right and second for max from left. Give approach.
- Explain question in very simple and short.
- Write without comments and less space.
- What is the least max size of height array so that output is always minimum?
- What happens for negative input?
- How can we rearrange so that water trapped is maximum?
- Write in
for
loop to rearrange it. - Tell me steps of how to do.
- We will find first highest and second highest element and put them at both ends. Write simple for loops for this.
Bookmark this and revise before any interview!
Need explanations or code snippets for any of these? Just ask 🚀