π Your Ultimate Blueprint to Top Tech Jobs in 2026
Welcome to the most comprehensive Software Developer Interview Handbook ever crafted for the 2026 hiring season. Whether you are aiming for premium roles like TCS Prime, targeting elite profiles at Infosys, Wipro, and Cognizant, or preparing for rigorous Product-Based Company interviews, this book is your unfair advantage.
We have carefully curated over 350+ real-world interview questions spanning Programming Fundamentals, Data Structures, System Design, cutting-edge AI trends, and high-stakes HR rounds. Every answer is meticulously framed to show recruiters that you don't just know the syntaxβyou understand the architecture, the optimization, and the business impact.
Why you need this handbook:
- Company-Specific Strategies: Dedicated breakdowns for TCS, Infosys, Accenture, Amazon, and more.
- Ready-to-Use Answers: Model answers designed for maximum impact using frameworks like the STAR method.
- Future-Proof: Covers 2026 trends like Serverless, Docker vs Kubernetes, and Generative AI.
Stop guessing what the interviewer wants. Start reading, start mastering, and go claim your dream package! π―
Programming Fundamentals (C/C++/Java/Python)
1. Variables
β Completeβ Interview Question
What are variables and how are they declared in different languages?
β Model Answer
Variables are named memory locations used to store data. In statically typed languages like C/C++/Java, you declare them with a type (e.g., int a = 10;). In dynamically typed languages like Python, the type is inferred (e.g., a = 10).
2. Data Types
β Completeβ Interview Question
Explain the primitive and non-primitive data types.
β Model Answer
Primitive data types are predefined by the language (e.g., int, float, char, boolean). Non-primitive (or reference) types are created by the programmer and refer to objects (e.g., Arrays, Strings, Classes).
3. Operators
β Completeβ Interview Question
What are the different types of operators (arithmetic, logical, bitwise, etc.)?
β Model Answer
Operators perform operations on variables and values. Main types include:
- Arithmetic: +, -, *, /, %
- Logical: && (AND), || (OR), ! (NOT)
- Bitwise: &, |, ^, ~, <<, >>
4. Loops
β Completeβ Interview Question
Explain the difference between for, while, and do-while loops.
β Model Answer
- For loop: Best when the number of iterations is known.
- While loop: Best when the number of iterations is unknown and depends on a condition.
- Do-while loop: Similar to the while loop, but guarantees the block of code is executed at least once.
5. Functions
β Completeβ Interview Question
What is a function and what are the benefits of using functions?
β Model Answer
A function is a reusable block of code that performs a specific task. Benefits include code reusability, modularity, easier debugging, and improved readability.
6. Constructors
β Completeβ Interview Question
What is a constructor and how does it differ from a regular method?
β Model Answer
A constructor is a special method invoked automatically when an object is created. It is used to initialize the object. Unlike regular methods, it has the same name as the class and no return type.
7. References
β Completeβ Interview Question
What is a reference variable?
β Model Answer
A reference variable acts as an alias or an alternative name for an already existing variable. In C++, changing the reference changes the original variable.
8. Pointers
β Completeβ Interview Question
What are pointers and how are they used in C/C++?
β Model Answer
A pointer is a variable that stores the memory address of another variable. They are used in C/C++ for dynamic memory allocation, efficient array/structure passing, and direct hardware access.
9. Header Files
β Completeβ Interview Question
What is the purpose of header files in C/C++?
β Model Answer
Header files (e.g., <iostream>) contain declarations of functions, macros, and variables that can be shared across multiple source files. They tell the compiler how a function should be called.
10. Static Function
β Completeβ Interview Question
What is a static function and when should it be used?
β Model Answer
A function that belongs to the class itself, not the object. It can be called without creating an instance and can only access static data.
11. Friend Function
β Completeβ Interview Question
What is a friend function in C++?
β Model Answer
In C++, a function declared with friend inside a class. It can access the private and protected data of that class, even though it is not a member function.
12. Struct
β Completeβ Interview Question
What is a struct in C/C++?
β Model Answer
A struct is a user-defined data type that groups related variables of different data types under a single name. By default, members of a struct are public in C++.
13. Union
β Completeβ Interview Question
What is a union in C/C++?
β Model Answer
A union is similar to a struct, but all its members share the same memory location. Its size is determined by its largest member, making it memory efficient when only one member is used at a time.
14. Struct vs Union
β Completeβ Interview Question
What is the difference between a struct and a union?
β Model Answer
- Struct: Allocates separate memory for each member. Size is the sum of all members.
- Union: Shares the same memory for all members. Size is the size of the largest member.
15. C vs C++
β Completeβ Interview Question
What are the main differences between C and C++?
β Model Answer
- C: Procedural, does not support classes/objects, no function overloading, uses malloc/free.
- C++: Object-oriented, supports classes/objects, supports function/operator overloading, uses new/delete.
16. C++ vs Java
β Completeβ Interview Question
What are the main differences between C++ and Java?
β Model Answer
- C++: Platform-dependent, supports pointers, supports multiple inheritance, uses manual memory management.
- Java: Platform-independent (bytecode), no explicit pointers, no multiple inheritance (uses interfaces), automatic garbage collection.
17. Preferred Programming Language
β Completeβ Interview Question
Which programming language do you prefer and why?
β Model Answer
(Subjective, frame as model answer): I prefer Python for its concise syntax and extensive libraries in AI/ML and data processing. I also use Java/C++ when strong typing, performance, and OOP structures are highly critical.
18. ++i vs i++
β Completeβ Interview Question
What is the difference between pre-increment (++i) and post-increment (i++)?
β Model Answer
- Pre-increment (++i): Increments the value first, then uses the new value in the expression.
- Post-increment (i++): Uses the current value in the expression, then increments it afterwards. In loops (like for), ++i can be slightly more efficient in C++ for complex iterators.
19. Variable Shadowing
β Completeβ Interview Question
What is variable shadowing or variable overriding?
β Model Answer
Variable shadowing occurs when a variable declared within a certain scope (like a local variable inside a method) has the same name as a variable declared in an outer scope (like a class instance variable). The inner variable 'shadows' or hides the outer variable.
20. Lambda Expression
β Completeβ Interview Question
What is a lambda expression? Provide examples.
β Model Answer
An anonymous function (a function without a name) that can be passed around as a value.
- Python: add = lambda x, y: x + y
- Java: (x, y) -> x + y
- C++: [](int x, int y) { return x + y; }
Python
1. List
β Completeβ Interview Question
What is a list in Python?
β Model Answer
A list in Python is an ordered, mutable (changeable) collection of elements, enclosed in square brackets []. It can hold mixed data types.
2. Tuple
β Completeβ Interview Question
What is a tuple in Python?
β Model Answer
A tuple is an ordered, immutable (unchangeable) collection of elements, enclosed in parentheses (). It is faster than a list and used for fixed data.
3. Dictionary
β Completeβ Interview Question
What is a dictionary in Python?
β Model Answer
A dictionary is an unordered, mutable collection of key-value pairs, enclosed in curly braces {}. Keys must be unique and immutable.
4. Set
β Completeβ Interview Question
What is a set in Python?
β Model Answer
In C++, std::set stores unique elements in sorted order (using a Red-Black tree). unordered_set uses hashing.
5. Difference between List and Tuple
β Completeβ Interview Question
What is the difference between a list and a tuple?
β Model Answer
- List: Mutable, slower, uses []. Suitable for data that changes over time.
- Tuple: Immutable, faster, uses (). Suitable for fixed data (e.g., coordinates).
6. Difference between List Tuple Dictionary and Set
β Completeβ Interview Question
Difference between list, tuple, dictionary, and set?
β Model Answer
- List: Ordered, mutable, allows duplicates.
- Tuple: Ordered, immutable, allows duplicates.
- Set: Unordered, mutable, NO duplicates.
- Dictionary: Unordered, mutable, key-value pairs (keys are unique).
7. Pandas DataFrame
β Completeβ Interview Question
How to create a data frame using pandas?
β Model Answer
A DataFrame is a 2D labeled data structure. You can create it from a dictionary:
import pandas as pd
data = {'Name': ['Alice', 'Bob'], 'Age': [25, 30]}
df = pd.DataFrame(data)8. NumPy
β Completeβ Interview Question
What is NumPy and why is it used?
β Model Answer
Used extensively in ML for fast array operations, linear algebra calculations, and manipulating datasets before feeding them to models.
9. Open CSV File
β Completeβ Interview Question
How to open a csv file in Python?
β Model Answer
You can use the built-in csv module or pandas:
import pandas as pd
df = pd.read_csv('file.csv')10. Read JSON
β Completeβ Interview Question
How to read a JSON file in Python?
β Model Answer
Use the built-in json module:
import json
with open('data.json') as f:
data = json.load(f)11. Write JSON Request
β Completeβ Interview Question
How to write a JSON request in Python?
β Model Answer
import json
data = {'key': 'value'}
json_string = json.dumps(data)12. Fetch JSON Data
β Completeβ Interview Question
How to fetch data from a JSON file?
β Model Answer
Use the requests library:
import requests
response = requests.get('https://api.example.com/data')
data = response.json()13. Convert Two Lists into Dictionary
β Completeβ Interview Question
How to convert two lists into one dictionary in Python?
β Model Answer
Use the zip() function:
keys = ['a', 'b', 'c']
values = [1, 2, 3]
my_dict = dict(zip(keys, values))14. StringBuffer equivalent concepts
β Completeβ Interview Question
What is the equivalent concept of StringBuffer in Python?
β Model Answer
In Python, strings are immutable. For efficient string concatenation (like Java's StringBuffer), it is recommended to append elements to a list and then use ''.join(list_name).
15. Collections Counter
β Completeβ Interview Question
Explain the use of Collections.Counter in Python.
β Model Answer
Counter from the collections module is a subclass of dictionary used to count hashable objects.
from collections import Counter
counts = Counter(['a', 'a', 'b']) # Counter({\'a\': 2, \'b\': 1})Strings
1. Reverse String
β Completeβ Interview Question
How do you reverse a string?
β Model Answer
In Python, you can use slicing:
s = 'hello'
reversed_s = s[::-1]2. Reverse Name
β Completeβ Interview Question
Write a program to reverse your name.
β Model Answer
Similar to reversing a string:
name = 'John Doe'
print(name[::-1])3. Reverse Number
β Completeβ Interview Question
Write a program to reverse a given number.
β Model Answer
n = 12345
rev = int(str(n)[::-1])Or using a loop with modulo 10.4. Palindrome
β Completeβ Interview Question
Code to check if a string is a palindrome.
β Model Answer
def is_palindrome(s):
return s == s[::-1]5. Count Characters
β Completeβ Interview Question
How do you count the occurrences of a specific character in a string?
β Model Answer
from collections import Counter
counts = Counter('hello')
# OR
count = s.count('l')6. Count Vowels
β Completeβ Interview Question
Code for counting vowels in a string.
β Model Answer
vowels = set('aeiouAEIOU')
count = sum(1 for char in s if char in vowels)7. Count Consonants
β Completeβ Interview Question
Code for counting consonants in a string.
β Model Answer
vowels = set('aeiouAEIOU')
count = sum(1 for char in s if char.isalpha() and char not in vowels)8. Remove Duplicates
β Completeβ Interview Question
How do you remove duplicate characters from a string?
β Model Answer
Using CTE and Window function:
WITH CTE AS (
SELECT *, ROW_NUMBER() OVER(PARTITION BY name ORDER BY id) as rn
FROM table
)
DELETE FROM CTE WHERE rn > 1;9. Repeated Words
β Completeβ Interview Question
How to find string repeated words?
β Model Answer
from collections import Counter
words = text.split()
repeats = [w for w, c in Counter(words).items() if c > 1]10. String Questions
β Completeβ Interview Question
General string manipulation questions.
β Model Answer
Focus on string immutability, traversing, ASCII conversions (ord()/chr()), and efficient concatenation (join()).
11. String Buffer
β Completeβ Interview Question
What is StringBuffer and how does it differ from String?
β Model Answer
Java's StringBuffer is a thread-safe, mutable sequence of characters. Unlike String which creates a new object on every modification, StringBuffer modifies the original object, saving memory during heavy concatenations.
12. Anagram
β Completeβ Interview Question
Write a program to check if two strings are anagrams of each other.
β Model Answer
Two strings are anagrams if they contain the same characters with the same frequencies.
def is_anagram(s1, s2):
return sorted(s1) == sorted(s2)13. N-Gram
β Completeβ Interview Question
Paper pen code check n gram. Write logic to extract n-grams from a string.
β Model Answer
N-Grams are continuous sequences of n items from a text.
def n_grams(s, n):
words = s.split()
return [' '.join(words[i:i+n]) for i in range(len(words)-n+1)]Mathematical Programs
1. Prime Number
β Completeβ Interview Question
Write a program to check if a number is a prime number.
β Model Answer
def is_prime(n):
if n <= 1: return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0: return False
return True2. Factorial
β Completeβ Interview Question
Write a program to find the factorial of a number.
β Model Answer
def fact(n):
return 1 if n == 0 else n * fact(n-1)3. Fibonacci
β Completeβ Interview Question
Code the Fibonacci series using recursion and dynamic programming.
β Model Answer
Recursion:
def fib(n): return n if n<=1 else fib(n-1)+fib(n-2)DP:dp=[0,1]+[-1]*(n-1)
for i in range(2,n+1): dp[i]=dp[i-1]+dp[i-2]4. Armstrong Number
β Completeβ Interview Question
Write a program to check if a number is an Armstrong number.
β Model Answer
A number equal to the sum of its digits raised to the power of the number of digits (e.g., 153).
num_str = str(n)
power = len(num_str)
return n == sum(int(d)**power for d in num_str)5. Square Root
β Completeβ Interview Question
How to find the square root of a number without using built-in functions?
β Model Answer
Using Binary Search for integer square root:
l, r, ans = 1, x, 0
while l <= r:
mid = (l + r) // 2
if mid * mid <= x:
ans = mid; l = mid + 1
else:
r = mid - 1
return ans6. Swap Two Numbers
β Completeβ Interview Question
Write a program to swap two variables.
β Model Answer
temp = a
a = b
b = tempIn Python: a, b = b, a7. Swap without Third Variable
β Completeβ Interview Question
Write a program to swap two numbers without using a third variable.
β Model Answer
a = a + b
b = a - b
a = a - b8. Pyramid Pattern
β Completeβ Interview Question
Make a pyramid of stars using loops.
β Model Answer
for i in range(1, n+1):
print(' ' * (n-i) + '*' * (2*i-1))9. Star Pattern
β Completeβ Interview Question
Write a program to print different star patterns.
β Model Answer
Standard right-angled triangle:
for i in range(1, n+1):
print('*' * i)Arrays
1. Array vs Linked List
β Completeβ Interview Question
What is the difference between an Array and a Linked List?
β Model Answer
- Array: Contiguous memory, O(1) access, fixed size (static arrays), O(N) insertion/deletion.
- Linked List: Non-contiguous (nodes with pointers), O(N) access, dynamic size, O(1) insertion/deletion (if pointer is known).
2. Rotate Array
β Completeβ Interview Question
Write a program to rotate an array by K steps.
β Model Answer
def rotate(arr, k):
k %= len(arr)
arr[:] = arr[-k:] + arr[:-k]3. Remove Duplicate Values
β Completeβ Interview Question
How do you remove duplicate values from an array?
β Model Answer
Using set: list(set(arr)). Without preserving order, or using a loop if order matters.
4. Move Zeroes to End
β Completeβ Interview Question
Write a program to move all zeroes to the end of the array.
β Model Answer
zero_count = arr.count(0)
arr = [x for x in arr if x != 0] + [0]*zero_count5. Sorting Array
β Completeβ Interview Question
Write a program to sort an array.
β Model Answer
Built in: arr.sort(). Manual (e.g., Bubble sort):
for i in range(n):
for j in range(n-i-1):
if arr[j] > arr[j+1]:
arr[j], arr[j+1] = arr[j+1], arr[j]Searching & Sorting
1. Linear Search
β Completeβ Interview Question
Explain Linear Search algorithm and its time complexity.
β Model Answer
Checks each element one by one until the target is found. Time Complexity: O(N). Works on unsorted arrays.
2. Binary Search
β Completeβ Interview Question
Explain Binary Search algorithm and its time complexity.
β Model Answer
Works on sorted arrays. Repeatedly divides the search interval in half. Time Complexity: O(log N).
3. Bubble Sort
β Completeβ Interview Question
Write a program for Bubble Sort and explain its flow.
β Model Answer
Repeatedly swaps adjacent elements if they are in the wrong order. Time Complexity: O(N^2).
4. Merge Sort
β Completeβ Interview Question
Explain and write a program for Merge Sort.
β Model Answer
Divide and Conquer. Divides array in half, sorts them, and merges. Time Complexity: O(N log N). Space Complexity: O(N).
5. Quick Sort
β Completeβ Interview Question
Explain and write a program for Quick Sort.
β Model Answer
Divide and Conquer. Picks a pivot, partitions array around the pivot. Time Complexity: Avg O(N log N), Worst O(N^2) (when already sorted and bad pivot). Space: O(log N).
6. STL sort()
β Completeβ Interview Question
How does the STL sort() function work internally in C++?
β Model Answer
The C++ std::sort() uses IntroSort. It is a hybrid sorting algorithm that uses QuickSort, and switches to HeapSort when recursion depth gets too large, and InsertionSort for small arrays. Time Complexity: O(N log N).
Data Structures & Algorithms
1. Arrays
β Completeβ Interview Question
Explain the characteristics and use cases of Arrays.
β Model Answer
Arrays store elements of the same type in contiguous memory locations. They offer O(1) time complexity for accessing elements using index. Fixed in size (in languages like C/Java) but dynamic variants exist (like ArrayList/Vector).
2. Linked List
β Completeβ Interview Question
Explain Linked Lists and their variations (Singly, Doubly, Circular).
β Model Answer
A linear data structure where elements (nodes) are not stored in contiguous memory. Each node points to the next.
- Singly: Points to next.
- Doubly: Points to next and previous.
- Circular: Last node points to the first.
3. Linked List Pointers
β Completeβ Interview Question
Explain how pointers work in a Linked List.
β Model Answer
In a Linked List, a pointer (or reference in Java/Python) is a variable that stores the memory address of the next node. For a doubly linked list, each node has two pointers: one pointing to the previous node and one pointing to the next node.
4. Trees
β Completeβ Interview Question
What is a tree data structure? Explain binary tree depth.
β Model Answer
A hierarchical data structure with a root node and children nodes. Binary Tree Depth is the number of edges from the root to the farthest leaf node.
def max_depth(root):
if not root: return 0
return 1 + max(max_depth(root.left), max_depth(root.right))5. BST Insert
β Completeβ Interview Question
How to insert in BST (Binary Search Tree)?
β Model Answer
Binary Search Tree (BST) property: Left child < Node < Right child.
def insert(root, key):
if not root: return Node(key)
if key < root.val: root.left = insert(root.left, key)
else: root.right = insert(root.right, key)
return root6. Heap
β Completeβ Interview Question
What is a Heap and what are its applications?
β Model Answer
A special Tree-based structure that satisfies the Heap property.
- Max Heap: Parent is greater than children.
- Min Heap: Parent is smaller than children.
Used in Priority Queues and Heap Sort.
7. Stack
β Completeβ Interview Question
Explain Stack data structure and its operations (LIFO).
β Model Answer
A container adaptor providing LIFO functionality. Elements are pushed and popped from the top.
8. Queue
β Completeβ Interview Question
Explain Queue data structure and its operations (FIFO).
β Model Answer
A container adaptor providing FIFO functionality. Elements are pushed at the back and popped from the front.
9. HashMap
β Completeβ Interview Question
Explain how a HashMap works internally.
β Model Answer
Stores data in key-value pairs. Internally uses an array of linked lists (or trees in Java 8+ for collisions). Hashing function calculates the index for the key to provide O(1) average time complexity for put/get.
10. Hash Function
β Completeβ Interview Question
What is a hash function and what makes a good hash function?
β Model Answer
A function that converts a given key into an index (integer) within the hash table array. A good hash function is fast to compute and minimizes collisions (uniform distribution).
11. Dynamic Programming
β Completeβ Interview Question
Explain the concept of Dynamic Programming.
β Model Answer
An algorithmic technique that solves complex problems by breaking them into overlapping subproblems and storing the results (Memoization or Tabulation) to avoid redundant calculations.
12. LRU Cache
β Completeβ Interview Question
Explain LRU cache and how to implement it.
β Model Answer
Least Recently Used (LRU) Cache discards the least recently used items first. Implemented using a Doubly Linked List (for fast removal/addition) and a HashMap (for O(1) access to nodes).
13. Sort Linked List
β Completeβ Interview Question
How do you sort a linked list?
β Model Answer
Merge Sort is the preferred algorithm for sorting a Linked List because it operates efficiently (O(N log N) time) and doesn't require random access to elements (unlike Quick Sort). It also requires only O(1) auxiliary space if done bottom-up.
14. Time Complexity
β Completeβ Interview Question
How do you calculate Time Complexity of an algorithm?
β Model Answer
Describes how the runtime of an algorithm grows with respect to the input size (N), typically expressed in Big O notation (e.g., O(1), O(N), O(N^2)).
15. Space Complexity
β Completeβ Interview Question
How do you calculate Space Complexity of an algorithm?
β Model Answer
Describes the amount of extra memory an algorithm requires as a function of the input size (N). Excludes the space required by the input itself.
STL (C++)
1. STL Library
β Completeβ Interview Question
What is the STL (Standard Template Library) in C++?
β Model Answer
The Standard Template Library (STL) in C++ provides a set of programming tools: Containers (vector, list, map), Algorithms (sort, search), and Iterators. It allows for writing generic, reusable code.
2. Vector
β Completeβ Interview Question
Explain the Vector container in STL.
β Model Answer
A dynamic array in C++. It automatically resizes itself when an element is inserted or deleted. Elements are stored contiguously.
3. Map
β Completeβ Interview Question
Explain the Map container in STL.
β Model Answer
In C++, std::map stores key-value pairs in sorted order of keys. It is implemented using a Self-Balancing Binary Search Tree (Red-Black Tree), offering O(log N) operations. unordered_map uses hashing (O(1)).
4. Set
β Completeβ Interview Question
Explain the Set container in STL.
β Model Answer
In C++, std::set stores unique elements in sorted order (using a Red-Black tree). unordered_set uses hashing.
5. Queue
β Completeβ Interview Question
Explain the Queue container in STL.
β Model Answer
A container adaptor providing FIFO functionality. Elements are pushed at the back and popped from the front.
6. Stack
β Completeβ Interview Question
Explain the Stack container in STL.
β Model Answer
A container adaptor providing LIFO functionality. Elements are pushed and popped from the top.
7. sort()
β Completeβ Interview Question
Explain how the sort() function works in STL.
β Model Answer
std::sort(begin, end) in C++ STL uses IntroSort (a hybrid of QuickSort, HeapSort, and InsertionSort). It guarantees O(N log N) worst-case time complexity.
Object-Oriented Programming
1. Classes
β Completeβ Interview Question
How do you define a Class and Object? Provide a code example.
β Model Answer
A Class is a user-defined blueprint or prototype from which objects are created. It represents the set of properties or methods that are common to all objects of one type.
Example in C++:class Car {
public:
string brand;
void honk() { cout << "Beep!" << endl; }
};
2. Encapsulation
β Completeβ Interview Question
Explain Encapsulation in OOPs concept.
β Model Answer
The bundling of data (variables) and methods (functions) that operate on the data into a single unit (class). It restricts direct access to some of the object's components, achieved using access modifiers (private, protected).
3. Inheritance
β Completeβ Interview Question
Explain Inheritance and Multilevel inheritance.
β Model Answer
The mechanism where a new class (child) inherits properties and behavior from an existing class (parent).
Multilevel Inheritance: Class C inherits from Class B, which inherits from Class A.
4. Multiple Inheritance
β Completeβ Interview Question
Opps - explain multiple inheritance and how it is handled (e.g., Diamond Problem).
β Model Answer
A class inherits from more than one base class. Not directly supported in Java/C# (using classes) to avoid the Diamond Problem (ambiguity when two parents have the same method). Solved using interfaces (Java) or virtual inheritance (C++).
5. Abstraction
β Completeβ Interview Question
Explain Abstraction in OOP.
β Model Answer
Hiding complex implementation details and showing only the essential features of the object. Achieved using abstract classes and interfaces.
6. Polymorphism
β Completeβ Interview Question
What is Polymorphism and its types?
β Model Answer
The ability of a message/method to be displayed in more than one form.
- Compile-time: Method Overloading, Operator Overloading.
- Run-time: Method Overriding.
7. Runtime Polymorphism
β Completeβ Interview Question
Explain Runtime Polymorphism with an example.
β Model Answer
Also known as Dynamic Method Dispatch. Achieved using Method Overriding. The compiler determines which method to call at runtime based on the actual object type, not the reference type.
8. Compile-Time Polymorphism
β Completeβ Interview Question
Explain Compile-Time Polymorphism with an example.
β Model Answer
Achieved using Method Overloading. The compiler decides which method to execute during compilation based on the number and types of arguments.
9. Method Overloading
β Completeβ Interview Question
Explain method overloading.
β Model Answer
Multiple methods in the same class with the same name but different parameters (type or number of arguments). Return type doesn't matter.
10. Method Overriding
β Completeβ Interview Question
Explain method overriding.
β Model Answer
A child class provides a specific implementation of a method that is already provided by its parent class. Name, return type, and parameters must be exactly the same.
11. Operator Overloading
β Completeβ Interview Question
Explain operator overloading.
β Model Answer
Giving a special meaning to an existing operator (like +, -) for user-defined data types. (Supported in C++, Python, but NOT Java).
12. Constructor
β Completeβ Interview Question
What is a constructor and what are its types?
β Model Answer
A special method invoked when an object is created. Types:
- Default: No arguments.
- Parameterized: Takes arguments.
- Copy: Initializes an object using another object of the same class.
13. Static Function
β Completeβ Interview Question
Explain the concept of static functions in OOP.
β Model Answer
A function that belongs to the class itself, not the object. It can be called without creating an instance and can only access static data.
14. Friend Function
β Completeβ Interview Question
What is a friend function?
β Model Answer
In C++, a function declared with friend inside a class. It can access the private and protected data of that class, even though it is not a member function.
15. Shallow Copy
β Completeβ Interview Question
Explain Shallo copy.
β Model Answer
Copies the memory address of objects inside the main object. If the original modifies the inner object, the copied object also reflects the change.
16. Deep Copy
β Completeβ Interview Question
Explain Deep copy.
β Model Answer
Creates a completely independent copy of the object and all the objects it references. Modifying the copy does not affect the original.
SQL & DBMS
1. SELECT
β Completeβ Interview Question
Explain the SELECT command in SQL.
β Model Answer
Retrieves data from a database. SELECT * FROM table_name;
2. INSERT
β Completeβ Interview Question
Explain the INSERT command in SQL.
β Model Answer
Adds new rows of data into a table. INSERT INTO table (col1) VALUES (val1);
3. UPDATE
β Completeβ Interview Question
Explain Sql update command.
β Model Answer
Modifies existing data in a table. UPDATE table SET col1 = val1 WHERE condition;
4. DELETE
β Completeβ Interview Question
Explain the DELETE command in SQL.
β Model Answer
Used to delete a resource from the server.
5. DROP
β Completeβ Interview Question
Explain the DROP command in SQL.
β Model Answer
Removes the entire table structure and its data from the database. DDL command. Cannot be rolled back. DROP TABLE table;
6. TRUNCATE
β Completeβ Interview Question
Explain the TRUNCATE command in SQL.
β Model Answer
Deletes all rows from a table but keeps the structure. DDL command. Faster than DELETE and cannot be rolled back in most databases. TRUNCATE TABLE table;
7. CREATE
β Completeβ Interview Question
Explain the CREATE command in SQL.
β Model Answer
Used to create databases, tables, views, etc. DDL command.
8. ALTER
β Completeβ Interview Question
Explain the ALTER command in SQL.
β Model Answer
Used to add, delete, or modify columns in an existing table. DDL command. ALTER TABLE table ADD col_name datatype;
9. Primary Key
β Completeβ Interview Question
What is a Primary Key?
β Model Answer
A column or combination of columns that uniquely identifies each row in a table. Cannot be NULL and must contain unique values. Only one per table.
10. Foreign Key
β Completeβ Interview Question
What is a Foreign Key?
β Model Answer
A column in one table that refers to the Primary Key in another table, establishing a relationship and enforcing referential integrity.
11. Candidate Key
β Completeβ Interview Question
What is a Candidate Key?
β Model Answer
Any set of columns that can uniquely identify a row. A table can have multiple Candidate Keys, and one of them is chosen as the Primary Key.
12. Super Key
β Completeβ Interview Question
What is a Super Key?
β Model Answer
A set of one or more columns that can uniquely identify a row. A Candidate Key is a minimal Super Key.
13. ER Diagram
β Completeβ Interview Question
What is an ER diagram?
β Model Answer
An Entity-Relationship (ER) Diagram is a visual representation of the relationships among entities in a database. Entities (like tables) are represented by rectangles, attributes (columns) by ovals, and relationships (like foreign keys) by diamonds.
14. Nth Highest Salary
β Completeβ Interview Question
Bonus: Write a SQL query to find the Nth highest salary without using LIMIT.
β Model Answer
(Bonus Answer): To find the Nth highest salary in SQL without LIMIT: SELECT salary FROM Employee e1 WHERE N-1 = (SELECT COUNT(DISTINCT salary) FROM Employee e2 WHERE e2.salary > e1.salary);
15. CAP Theorem
β Completeβ Interview Question
Bonus: Explain the CAP Theorem.
β Model Answer
(Bonus Answer): The CAP theorem states that a distributed data store can only simultaneously provide two out of three guarantees: Consistency (every read receives the most recent write), Availability (every request receives a non-error response), and Partition Tolerance (the system continues to operate despite network failures dropping messages).
16. Unique Key
β Completeβ Interview Question
What is a Unique Key?
β Model Answer
Ensures all values in a column are unique. Unlike Primary Key, a Unique Key allows one NULL value, and a table can have multiple Unique Keys.
17. Primary Key vs Unique Key
β Completeβ Interview Question
What is the difference between Primary Key and Unique Key?
β Model Answer
- Primary Key: Uniquely identifies a record. Cannot accept NULL values. Only one Primary Key is allowed per table.
- Unique Key: Ensures all values in a column are distinct. Can accept one NULL value. A table can have multiple Unique Keys.
18. SQL UNION
β Completeβ Interview Question
What is the UNION operator in SQL and how is it different from UNION ALL?
β Model Answer
- UNION: Combines the result sets of two or more SELECT statements and removes duplicate rows.
- UNION ALL: Combines result sets but keeps duplicate rows. It is faster than UNION because it doesn't incur the overhead of deduplication.
19. SQL Functions
β Completeβ Interview Question
Explain the different types of functions in SQL (Scalar, Aggregate, etc.).
β Model Answer
SQL functions are divided into two main categories:
1. Scalar Functions: Return a single value based on the input value (e.g., UCASE(), LCASE(), ROUND(), GETDATE()).
2. Aggregate Functions: Return a single value calculated from values in a column (e.g., SUM(), COUNT(), AVG(), MAX(), MIN()).
20. Aggregate Functions
β Completeβ Interview Question
What are Aggregate Functions in SQL?
β Model Answer
Perform calculations on a set of values and return a single value: COUNT(), SUM(), AVG(), MIN(), MAX().
21. Window Functions
β Completeβ Interview Question
What are Window Functions in SQL?
β Model Answer
Perform calculations across a set of table rows related to the current row, but unlike aggregate functions, they do not collapse the rows into a single output row (e.g., ROW_NUMBER(), RANK()).
22. Rank()
β Completeβ Interview Question
Explain SQL- rank function.
β Model Answer
Assigns a rank to each row within the partition of a result set. If there is a tie, the same rank is assigned, and the next rank is skipped (e.g., 1, 1, 3).
23. Dense Rank()
β Completeβ Interview Question
Explain the Dense Rank() function in SQL.
β Model Answer
Similar to RANK(), but if there is a tie, the next rank is NOT skipped (e.g., 1, 1, 2).
24. Second Highest Salary
β Completeβ Interview Question
Write a query to find the second highest salary.
β Model Answer
SELECT MAX(salary) FROM Employee
WHERE salary < (SELECT MAX(salary) FROM Employee);25. Largest Salary
β Completeβ Interview Question
Write a query to find the largest salary in a department.
β Model Answer
SELECT department, MAX(salary) FROM Employee
GROUP BY department;26. Count Unique
β Completeβ Interview Question
SQL- if name and age is given, cont number of unique ages and print.
β Model Answer
SELECT COUNT(DISTINCT age) FROM Users;27. Remove Duplicates
β Completeβ Interview Question
How to remove duplicate rows in SQL?
β Model Answer
Using CTE and Window function:
WITH CTE AS (
SELECT *, ROW_NUMBER() OVER(PARTITION BY name ORDER BY id) as rn
FROM table
)
DELETE FROM CTE WHERE rn > 1;28. SQL Procedures
β Completeβ Interview Question
What are Stored Procedures in SQL?
β Model Answer
Prepared SQL code that you can save and reuse. It can accept parameters, perform complex logic, and improve performance by reducing network traffic.
29. Triggers
β Completeβ Interview Question
What are Triggers in SQL?
β Model Answer
A special type of stored procedure that automatically executes (fires) when an event (INSERT, UPDATE, DELETE) occurs in the database table.
30. Joins
β Completeβ Interview Question
Explain the different types of Joins in SQL.
β Model Answer
- INNER JOIN: Returns records matching in both tables.
- LEFT JOIN: All records from left table, matched records from right.
- RIGHT JOIN: All records from right table, matched from left.
- FULL OUTER JOIN: All records when there's a match in either.
31. Normalization
β Completeβ Interview Question
What is Normalization and explain its normal forms?
β Model Answer
Process of organizing data to reduce redundancy and improve integrity.
- 1NF: Atomic values, unique columns.
- 2NF: 1NF + no partial dependency.
- 3NF: 2NF + no transitive dependency.
32. DDL
β Completeβ Interview Question
What is DDL (Data Definition Language)?
β Model Answer
Data Definition Language: Commands that define the database structure/schema. E.g., CREATE, ALTER, DROP, TRUNCATE.
33. DML
β Completeβ Interview Question
What is DML (Data Manipulation Language)?
β Model Answer
Data Manipulation Language: Commands that manipulate the data itself. E.g., SELECT, INSERT, UPDATE, DELETE.
34. SQL vs NoSQL
β Completeβ Interview Question
Databases- difference between sql and no sql, when you use which?
β Model Answer
- SQL (Relational): Table-based, predefined schema, vertical scaling, ACID properties. Best for complex queries and transactional systems.
- NoSQL (Non-Relational): Document/Key-Value/Graph based, dynamic schema, horizontal scaling, BASE properties. Best for rapid development, unstructured data, and big data.
35. Drop vs Delete
β Completeβ Interview Question
What is the difference between Drop and Delete?
β Model Answer
- DROP: DDL, removes table structure and data, cannot be rolled back.
- DELETE: DML, removes rows (can use WHERE), can be rolled back.
36. Delete vs Truncate
β Completeβ Interview Question
What is the difference between Delete and Truncate?
β Model Answer
- DELETE: DML, removes row by row, logs each deletion, slower, can rollback.
- TRUNCATE: DDL, deallocates data pages, doesn't log each row, very fast, cannot rollback.
37. Drop vs Truncate
β Completeβ Interview Question
Sql -diff between drop and truncate?
β Model Answer
- DROP: Removes the table entirely from the database.
- TRUNCATE: Empties the table but keeps the table structure intact for future inserts.
NoSQL
1. MongoDB Connection
β Completeβ Interview Question
Technical - how mongodb connect?
β Model Answer
In Node.js using Mongoose:
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/mydb');2. MongoDB Queries
β Completeβ Interview Question
Explain basic MongoDB queries.
β Model Answer
db.users.insertOne({name: 'Alice', age: 25});
db.users.find({age: {$gt: 20}});
db.users.updateOne({name: 'Alice'}, {$set: {age: 26}});3. MongoDB Filtering
β Completeβ Interview Question
Technical - how to filter data in MongoDB?
β Model Answer
Use query operators in the find() method:
db.collection.find({
age: { $gte: 18, $lte: 30 },
status: 'active'
});4. MongoDB vs SQL
β Completeβ Interview Question
What is the difference between MongoDB and SQL databases?
β Model Answer
MongoDB stores data in JSON-like documents (BSON) with dynamic schemas. SQL stores data in rigid tables with rows and columns. MongoDB is better for unstructured data and rapid iteration.
5. Trend: Vector Databases
β Completeβ Interview Question
Recent Trend: What is a Vector Database and why is it used in AI?
β Model Answer
(Recent Trend): A Vector Database (like Pinecone or Milvus) is designed to store data as high-dimensional vectors (embeddings). They are crucial for modern AI applications because they allow for extremely fast "semantic similarity" searches, enabling features like recommendation engines and RAG for LLMs.
6. Why MongoDB is not SQL
β Completeβ Interview Question
Why is MongoDB not considered a part of SQL databases?
β Model Answer
MongoDB is a NoSQL (Not Only SQL) database because it does not store data in relational tables with strict schemas. Instead, it stores data in flexible, JSON-like documents (BSON). It does not use SQL for querying, nor does it strictly adhere to ACID properties by default, prioritizing horizontal scalability and flexibility.
7. Redis
β Completeβ Interview Question
Explain Redis db and its use cases.
β Model Answer
An open-source, in-memory key-value data store. Extremely fast. Commonly used for caching, session management, real-time analytics, and message brokering (pub/sub).
8. When to use NoSQL
β Completeβ Interview Question
In what scenarios should you choose NoSQL over SQL?
β Model Answer
Use NoSQL when dealing with large volumes of unstructured/semi-structured data, requiring high scalability (horizontal), agile development with changing schemas, or real-time big data applications.
PostgreSQL
1. PostgreSQL
β Completeβ Interview Question
What is PostgreSQL and what are its key features?
β Model Answer
An advanced, open-source object-relational database system (ORDBMS). Known for high reliability, feature robustness (JSONB support, advanced indexing), and strict SQL standard compliance.
2. PostgreSQL vs MSSQL
β Completeβ Interview Question
What are the main differences between PostgreSQL and MSSQL?
β Model Answer
- PostgreSQL: Open-source, free, cross-platform, strong JSON support.
- MSSQL: Microsoft proprietary (commercial), tightly integrated with Windows/.NET, excellent tooling (SSMS).
3. PostgreSQL vs H2
β Completeβ Interview Question
What are the differences between PostgreSQL and H2 databases?
β Model Answer
- PostgreSQL: Heavyweight, persistent, enterprise-grade database.
- H2: Lightweight, written in Java, often used as an in-memory database for testing and fast prototyping.
Operating Systems
1. Types of OS
β Completeβ Interview Question
What are the different types of Operating Systems?
β Model Answer
Main types include: Batch OS (jobs grouped), Time-Sharing OS (CPU time shared among users), Distributed OS (multiple independent CPUs), Network OS (runs on a server), and Real-Time OS (strict time constraints, e.g., pacemakers).
2. Process
β Completeβ Interview Question
What is a process in OS?
β Model Answer
A program in execution. It contains the program code, current activity (PC), stack, data section (global variables), and heap (dynamic memory).
3. Thread
β Completeβ Interview Question
What is a thread and how does it differ from a process?
β Model Answer
A thread is the smallest sequence of programmed instructions managed independently by a scheduler. It is a lightweight process. Multiple threads share the same memory and resources of a single process.
4. Deadlock
β Completeβ Interview Question
What is a deadlock and what are the necessary conditions for it?
β Model Answer
A situation where two or more processes are unable to proceed because each is waiting for a resource held by another. Necessary conditions (Coffman): Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.
5. Mutual Exclusion
β Completeβ Interview Question
Explain the concept of mutual exclusion.
β Model Answer
A property of concurrency control preventing multiple processes/threads from executing critical sections of code (accessing shared resources) at the same time.
6. Spooling
β Completeβ Interview Question
What is spooling in OS?
β Model Answer
Simultaneous Peripheral Operations On-Line. It refers to putting jobs in a buffer, a special area in memory or on a disk where a device can access them when it is ready (e.g., Print Spooling).
7. Heap Memory
β Completeβ Interview Question
What is heap memory in the context of an OS?
β Model Answer
A region of memory used for dynamic memory allocation during runtime. It is managed via malloc()/free() in C or garbage collection in Java/Python. It is shared across all threads in a process.
8. Memory Management
β Completeβ Interview Question
Explain memory management techniques in an OS.
β Model Answer
The process of controlling and coordinating computer memory. Techniques include: Paging (dividing memory into fixed-size pages) and Segmentation (dividing memory into variable-sized segments).
9. Components of OS
β Completeβ Interview Question
What are the main components of an Operating System?
β Model Answer
The main components are the Kernel (core, hardware interaction), Process Management, Memory Management, File System, I/O Management, and the User Interface (Shell/GUI).
10. Kernel
β Completeβ Interview Question
What is the most important component of an OS?
β Model Answer
The Kernel is the core and most important component of an Operating System. It has complete control over everything in the system and acts as a bridge between applications and data processing performed at the hardware level. It manages memory, processes, and hardware communication.
11. Resolve Deadlock
β Completeβ Interview Question
How do you resolve a deadlock?
β Model Answer
Deadlocks can be resolved or handled using three main strategies:
1. Deadlock Prevention: Ensure at least one of the four necessary conditions (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait) cannot hold.
2. Deadlock Avoidance: Use algorithms like Banker's Algorithm to dynamically analyze resource requests and ensure the system stays in a safe state.
3. Deadlock Detection & Recovery: Allow deadlocks to occur, detect them, and recover by killing processes or preempting resources.
Computer Networks
1. OSI Model
β Completeβ Interview Question
Explain the 7 layers of the OSI model.
β Model Answer
Open Systems Interconnection model has 7 layers:
7. Application
6. Presentation
5. Session
4. Transport (TCP/UDP)
3. Network (IP, Routers)
2. Data Link (MAC, Switches)
1. Physical (Cables)
2. Network Classes
β Completeβ Interview Question
Explain the different IP Network Classes (A, B, C, etc.).
β Model Answer
- Class A: 1.0.0.0 to 126.255.255.255 (Huge networks)
- Class B: 128.0.0.0 to 191.255.255.255 (Medium networks)
- Class C: 192.0.0.0 to 223.255.255.255 (Small networks)
- Class D: Multicast.
- Class E: Experimental.
3. WebSockets
β Completeβ Interview Question
What are WebSockets and how do they differ from HTTP?
β Model Answer
A communication protocol providing full-duplex communication channels over a single, long-lived TCP connection. Unlike HTTP (request-response), WebSockets allow servers to push data to clients in real-time (e.g., chat apps).
Software Engineering
1. SDLC
β Completeβ Interview Question
Explain the Software Development Life Cycle (SDLC).
β Model Answer
Software Development Life Cycle is a process used by software industry to design, develop and test high-quality software. Phases: Requirement Analysis, Planning, Design, Coding, Testing, Deployment, Maintenance.
2. Agile
β Completeβ Interview Question
Explain the Agile model.
β Model Answer
An iterative approach to software development. It emphasizes flexibility, continuous improvement, and rapid delivery of functional software in small increments (sprints). Welcomes changing requirements.
3. Waterfall
β Completeβ Interview Question
Explain Waterfall and agile model and their differences.
β Model Answer
A linear, sequential approach where each phase must be completed before the next begins. Difficult to go back and change things. Best for projects with very clear, unchanging requirements.
4. Software Development Cycle
β Completeβ Interview Question
What are the key phases of the Software Development Cycle?
β Model Answer
The standard steps to build software: 1. Requirement Gathering, 2. Design/Architecture, 3. Implementation (Coding), 4. Testing, 5. Deployment, 6. Maintenance.
5. Unit Testing
β Completeβ Interview Question
What is Unit Testing?
β Model Answer
Testing individual components or functions of the software in isolation to ensure they work correctly. Usually written by developers (e.g., using JUnit, Jest).
6. Integration Testing
β Completeβ Interview Question
What is Integration Testing?
β Model Answer
Testing the combination of individual units to expose faults in the interaction between integrated units. Ensures different modules work together.
7. White Box Testing
β Completeβ Interview Question
What is White Box Testing?
β Model Answer
Testing based on an analysis of the internal structure, code, and logic of the software. The tester knows the internal workings.
8. Smoke Testing
β Completeβ Interview Question
What is Smoke Testing?
β Model Answer
A preliminary testing to reveal simple failures severe enough to reject a prospective software release. Checks if the critical functionalities are working.
9. Regression Testing
β Completeβ Interview Question
What is Regression Testing?
β Model Answer
Re-running functional and non-functional tests to ensure that previously developed and tested software still performs after a change (like a bug fix or new feature).
10. System Testing
β Completeβ Interview Question
What is System Testing?
β Model Answer
Testing the fully integrated software system to evaluate its compliance with the specified requirements. It is a high-level, black-box testing.
DevOps
1. Docker
β Completeβ Interview Question
Docker and it's use
β Model Answer
A platform that uses OS-level virtualization to deliver software in packages called containers. Containers bundle their own software, libraries, and configuration files, ensuring the app runs consistently anywhere.
2. Docker vs Virtual Machine
β Completeβ Interview Question
Docker vs virtual machine. Explain the differences.
β Model Answer
- VM: Includes a full Guest OS, heavy, slow boot time, isolated at hardware level.
- Docker: Shares the Host OS kernel, lightweight, fast boot time, isolated at process level.
3. Git
β Completeβ Interview Question
What is Git and why is it used?
β Model Answer
A distributed version control system used to track changes in source code during software development. It allows multiple developers to work together non-linearly.
4. GitHub
β Completeβ Interview Question
What is the difference between Git and GitHub?
β Model Answer
While Git is the version control tool (software), GitHub is a cloud-based hosting service that lets you manage Git repositories and collaborate with others online.
5. Git Commands
β Completeβ Interview Question
Git command - how to use push, pull, commit, and other common commands?
β Model Answer
- init: Start new repo.
- clone: Copy remote repo.
- add: Stage changes.
- commit: Save changes to local repo.
- push: Send changes to remote.
- pull: Fetch and merge remote changes.
6. Continuous Development
β Completeβ Interview Question
What is continuous development?
β Model Answer
An umbrella term that encompasses Continuous Integration (CI), Continuous Testing, and Continuous Delivery/Deployment. It means code is constantly being written, tested, and prepped for release.
7. Continuous Deployment
β Completeβ Interview Question
Devops- difference between continuos development and deployment?
β Model Answer
In Continuous Delivery, code changes are automatically built and tested, but require a manual trigger to deploy. In Continuous Deployment, every change that passes tests is automatically deployed to production without human intervention.
Web Development
1. HTML
β Completeβ Interview Question
What are the new features of HTML5?
β Model Answer
HyperText Markup Language. HTML5 introduced semantic tags (<header>, <article>), multimedia support (<audio>, <video>), Canvas for drawing, and local storage APIs.
2. CSS
β Completeβ Interview Question
Explain CSS Box Model and Flexbox/Grid.
β Model Answer
- Box Model: Content, Padding, Border, Margin.
- Flexbox: 1D layout system for aligning items in rows/columns.
- Grid: 2D layout system for complex web structures.
3. JavaScript
β Completeβ Interview Question
Explain closures, promises, and async/await in JavaScript.
β Model Answer
- Closures: A function remembering its lexical scope even when executed outside it.
- Promises: Represents the eventual completion of an async operation.
- Async/Await: Syntactic sugar over promises for cleaner async code.
4. React
β Completeβ Interview Question
Explain the Virtual DOM and hooks in React.
β Model Answer
A JS library for building UIs. Uses a Virtual DOM to optimize rendering by only updating changed elements. Hooks (like useState, useEffect) allow function components to have state and lifecycle features.
5. React vs Other Frameworks
β Completeβ Interview Question
How does React compare to Angular or Vue?
β Model Answer
- React: A library (needs external routing/state libs), uses Virtual DOM, one-way data binding.
- Angular: A full framework, uses Real DOM, two-way data binding.
- Vue: Progressive framework, highly approachable.
6. Node.js
β Completeβ Interview Question
Explain the event loop in Node.js.
β Model Answer
A runtime environment executing JS outside the browser. It uses an Event Loop and non-blocking I/O, making it lightweight and efficient for data-intensive real-time applications.
7. NPM
β Completeβ Interview Question
What is NPM and how do you manage dependencies?
β Model Answer
Node Package Manager. It is the default package manager for Node.js, used to install, share, and manage project dependencies via the package.json file.
8. UI
β Completeβ Interview Question
What are the best practices for designing a UI?
β Model Answer
User Interface design focuses on the visual elements (buttons, colors, typography). Best practices include consistency, simple navigation, responsive design, and clear hierarchy.
9. UX
β Completeβ Interview Question
What are the principles of good UX design?
β Model Answer
User Experience focuses on the overall feel and journey of the user. Principles include understanding user needs, minimizing cognitive load, providing clear feedback, and ensuring accessibility.
10. REST API
β Completeβ Interview Question
What are the architectural constraints of REST?
β Model Answer
Representational State Transfer. A standard for building web APIs. Constraints: Client-Server architecture, Statelessness, Cacheability, Layered system, Uniform interface.
11. Authentication
β Completeβ Interview Question
How do you implement authentication in a web application?
β Model Answer
(General Guide): Explain the authentication mechanism (e.g., using Passport.js, Firebase Auth, or a custom JWT implementation upon login).
12. Authorization
β Completeβ Interview Question
What is the difference between authentication and authorization?
β Model Answer
(General Guide): Explain how you managed user roles (e.g., Admin vs User) using middleware to protect specific API routes.
13. JWT Token
β Completeβ Interview Question
What is a JWT token and how does it work?
β Model Answer
JSON Web Token is an open standard for securely transmitting information as a JSON object. Consists of Header, Payload, and Signature. Used for stateless authentication.
14. Headers
β Completeβ Interview Question
What is the purpose of HTTP headers?
β Model Answer
HTTP headers pass additional information with an HTTP request or response (e.g., Content-Type, Authorization tokens, CORS policies).
15. Local Storage
β Completeβ Interview Question
Explain local storage vs session storage vs cookies.
β Model Answer
- Local Storage: Stores data with no expiration date (5-10MB).
- Session Storage: Data is cleared when the page session ends (tab closed).
- Cookies: Small data (4KB) sent to server with every request, used for auth/tracking.
APIs
1. REST API
β Completeβ Interview Question
Restapi?? Explain what a REST API is.
β Model Answer
Representational State Transfer. A standard for building web APIs. Constraints: Client-Server architecture, Statelessness, Cacheability, Layered system, Uniform interface.
2. GET
β Completeβ Interview Question
When to use a GET method?
β Model Answer
Used to retrieve data from a server. Should not modify data (idempotent and safe). Parameters are sent in the URL.
3. POST
β Completeβ Interview Question
When to use a POST method?
β Model Answer
Used to create new resources or submit data to the server. Data is sent in the request body.
4. PUT
β Completeβ Interview Question
What is the difference between PUT and PATCH?
β Model Answer
Used to update/replace an entire resource on the server. It is idempotent (repeating it has the same effect).
5. PATCH
β Completeβ Interview Question
When to use a PATCH method?
β Model Answer
Used to apply partial modifications to a resource.
6. DELETE
β Completeβ Interview Question
When to use a DELETE method?
β Model Answer
Used to delete a resource from the server.
7. JSON Request
β Completeβ Interview Question
How to write a JSON request?
β Model Answer
A request where the payload (body) is formatted as JSON. Must include the header Content-Type: application/json.
8. JSON Response
β Completeβ Interview Question
How do you parse a JSON response?
β Model Answer
The server replies with JSON data. In frontend (fetch API), parsed using response.json().
9. Frontend Backend Connection
β Completeβ Interview Question
How you connect background from front end?
β Model Answer
The frontend makes asynchronous HTTP requests (using Fetch API or Axios) to the Backend API endpoints. The backend processes the request, interacts with the DB, and returns a JSON response which the frontend renders.
10. API Performance
β Completeβ Interview Question
How do you measure and improve API performance?
β Model Answer
Improved via: Caching (Redis), Database Indexing, Pagination, Asynchronous processing, Load balancing, and payload compression (GZIP).
11. Slow API Handling
β Completeβ Interview Question
How to solve if api is giving slow response?
β Model Answer
Troubleshooting steps: 1. Check network/latency. 2. Analyze DB queries (add indexes, avoid N+1 queries). 3. Implement caching. 4. Use pagination. 5. Scale horizontally.
Cloud
1. AWS
β Completeβ Interview Question
What are the core services provided by AWS (e.g., EC2, S3)?
β Model Answer
Amazon Web Services. Core services: EC2 (Virtual Machines), S3 (Object Storage), RDS (Relational Databases), Lambda (Serverless computing).
2. Cloud Basics
β Completeβ Interview Question
Explain IaaS, PaaS, and SaaS.
β Model Answer
- IaaS: Infrastructure as a Service (EC2 - raw servers).
- PaaS: Platform as a Service (Heroku - environment managed for you).
- SaaS: Software as a Service (Google Workspace - fully hosted app).
AI / Machine Learning
1. Generative AI
β Completeβ Interview Question
Fundamentals of Generative AI
β Model Answer
A branch of AI focused on creating new content (text, images, audio) based on learned patterns from existing data. Examples include ChatGPT and DALL-E.
2. GPT
β Completeβ Interview Question
What is GPT and how does it work?
β Model Answer
Generative Pre-trained Transformer. It is a type of LLM created by OpenAI that uses a transformer architecture to generate human-like text based on the input prompt.
3. Prompt Engineering
β Completeβ Interview Question
What is prompt engineering and why is it important?
β Model Answer
The practice of designing and refining input text (prompts) to effectively guide an AI model to produce the most accurate and desired output.
4. RAG
β Completeβ Interview Question
Explain Retrieval-Augmented Generation (RAG).
β Model Answer
Retrieval-Augmented Generation. A technique that enhances LLMs by connecting them to an external database. It retrieves relevant documents and feeds them to the LLM as context before generating an answer, reducing hallucinations.
5. Agentic AI
β Completeβ Interview Question
Fundamentals of Agentic Ai
β Model Answer
AI systems (agents) designed to act autonomously to achieve specific goals. They can plan, use tools, and make decisions in multi-step processes without constant human intervention.
6. CNN
β Completeβ Interview Question
What is a Convolutional Neural Network (CNN)?
β Model Answer
Convolutional Neural Network. Highly effective for Image Processing. Uses convolutional layers to automatically extract spatial hierarchies of features from images.
7. RNN
β Completeβ Interview Question
What is a Recurrent Neural Network (RNN)?
β Model Answer
Recurrent Neural Network. Designed for sequential data (like time series or text). It has a 'memory' that captures information from previous steps to influence the current output.
8. Random Forest
β Completeβ Interview Question
Explain the Random forest algorithm
β Model Answer
An ensemble learning method for classification and regression. It operates by constructing a multitude of decision trees during training and outputting the mode/mean of the individual trees to prevent overfitting.
9. XGBoost
β Completeβ Interview Question
What is XGBoost and why is it popular?
β Model Answer
Extreme Gradient Boosting. A highly optimized gradient boosting library. It builds trees sequentially, minimizing errors of previous models. Highly successful in Kaggle competitions for tabular data.
10. Clustering
β Completeβ Interview Question
Explain K-Means Clustering.
β Model Answer
Unsupervised learning where data points are grouped based on similarity. K-Means partitions data into K distinct clusters based on distance to the centroid.
11. Optimization
β Completeβ Interview Question
What are optimization algorithms in ML (e.g., Gradient Descent)?
β Model Answer
Algorithms (like Gradient Descent) used to minimize the Loss/Error function of a model by updating the model's weights iteratively.
12. NumPy
β Completeβ Interview Question
How is NumPy used in ML?
β Model Answer
Used extensively in ML for fast array operations, linear algebra calculations, and manipulating datasets before feeding them to models.
Projects
1. Explain Project
β Completeβ Interview Question
Technical: Regarding project. Explain your project in detail.
β Model Answer
(Frame a personalized response focusing on the STAR method): Briefly explain the Situation/Task (what problem you solved), Action (your specific implementation and technologies used), and Result (the outcome or impact).
2. Technologies Used
β Completeβ Interview Question
Questions from technology used in projects.
β Model Answer
(General Guide): List the specific tech stack (e.g., React, Node.js, MongoDB). Justify why you chose them (e.g., React for component reusability, MongoDB for flexible schema).
3. Architecture
β Completeβ Interview Question
Explain the architecture of your project.
β Model Answer
(General Guide): Describe the flow: Frontend -> API Gateway -> Backend Microservices/Monolith -> Database. Mention any caching or cloud services involved.
4. APIs Used
β Completeβ Interview Question
What APIs did you use or build in your project?
β Model Answer
(General Guide): Mention third-party APIs (like Stripe for payments, Google Maps for location) or the internal REST/GraphQL APIs you designed.
5. Connect Database
β Completeβ Interview Question
How do you connect a database to your project backend?
β Model Answer
(Model Answer): In my Node.js project, I used Mongoose to connect to MongoDB. I stored the connection string in a .env file for security. During app initialization, I called mongoose.connect(process.env.DB_URI). For SQL projects, I used an ORM like Sequelize or Hibernate to establish connection pools.
6. Software Cycle in Project
β Completeβ Interview Question
Which software development life cycle (SDLC) model did you use for your project?
β Model Answer
(Model Answer): We followed the Agile methodology. We broke down the project into 2-week sprints, started with requirement gathering, created Jira tickets, and held daily stand-ups to discuss progress and blockers. This allowed us to continuously test and iterate on the product.
7. Database Used
β Completeβ Interview Question
Which database did you use in your project and why?
β Model Answer
(General Guide): Explain if it was SQL or NoSQL and the rationale (e.g., SQL for strict ACID transactional data, NoSQL for high volume unstructured data).
8. Authentication
β Completeβ Interview Question
How was authentication handled in your project?
β Model Answer
(General Guide): Explain the authentication mechanism (e.g., using Passport.js, Firebase Auth, or a custom JWT implementation upon login).
9. Authorization
β Completeβ Interview Question
How was authorization handled in your project?
β Model Answer
(General Guide): Explain how you managed user roles (e.g., Admin vs User) using middleware to protect specific API routes.
10. JWT
β Completeβ Interview Question
Did you use JWT in your project? Explain how.
β Model Answer
(General Guide): JWT (JSON Web Token) was used for stateless authentication. After login, a token is sent to the client, stored in local storage/HTTP-only cookie, and attached to the Authorization header of subsequent requests.
11. MongoDB
β Completeβ Interview Question
Explain how MongoDB was utilized in your project.
β Model Answer
(General Guide): Used Mongoose for schema validation. Mention specific aggregations or indexing strategies you implemented.
12. SQL
β Completeβ Interview Question
Explain how SQL databases were utilized in your project.
β Model Answer
(General Guide): Mention complex Joins, normalized tables, and how you ensured data integrity.
13. AI Used in Project
β Completeβ Interview Question
Did you integrate any AI features in your project? Explain.
β Model Answer
(General Guide): If applicable, explain how you integrated OpenAI APIs or custom ML models to add smart features (like recommendations or automated text generation).
14. Challenges
β Completeβ Interview Question
What were the major challenges faced during the project?
β Model Answer
(General Guide): Always have a challenge ready. (e.g., Handling race conditions, optimizing a slow DB query, learning a new framework quickly). Explain how you solved it.
15. Team Contribution
β Completeβ Interview Question
What was your specific role and contribution to the project team?
β Model Answer
(General Guide): Use 'I' instead of 'We'. Highlight the specific modules you built, your code review process, and how you collaborated via Git.
16. Learnings
β Completeβ Interview Question
What were your key learnings from the project?
β Model Answer
(General Guide): Mention technical learnings (like better state management) and soft skills (like effective communication in agile).
17. Certifications Mentioned in CV
β Completeβ Interview Question
Technical: Cirtificatatation. Tell me about the certifications in your CV.
β Model Answer
(General Guide): Briefly explain what the certification covered and how it practically improved your coding or architectural skills.
18. Freelance Project Experience
β Completeβ Interview Question
Do you have any freelance project experience?
β Model Answer
(General Guide): Treat this like a standard project but emphasize client communication, gathering requirements, and delivering on deadlines.
Company Knowledge (Especially TCS)
1. Why TCS?
β Completeβ Interview Question
Hr- why do you want join tcs?
β Model Answer
(Model Answer): TCS is a global IT leader with a vast presence across domains. I am drawn to the learning opportunities, the massive scale of projects, and the job stability. TCS's commitment to employee growth and societal impact aligns with my long-term career goals.
2. Vision of TCS
β Completeβ Interview Question
What is the vision and mission of TCS?
β Model Answer
TCS Vision: To separate the business from the IT infrastructure, allowing clients to focus on their core business while TCS handles the technology.
3. Founder
β Completeβ Interview Question
Who is the founder of TCS?
β Model Answer
TCS was founded by J. R. D. Tata and F. C. Kohli in 1968.
4. CEO
β Completeβ Interview Question
Who is the current CEO of TCS?
β Model Answer
The current CEO and MD of TCS is K. Krithivasan (as of mid-2023).
5. Headquarters
β Completeβ Interview Question
Where are the headquarters of TCS located?
β Model Answer
Mumbai, Maharashtra, India.
6. Year Established
β Completeβ Interview Question
In which year was TCS established?
β Model Answer
1968.
7. Major Projects
β Completeβ Interview Question
Name some major projects or clients of TCS.
β Model Answer
TCS handles massive projects like the Passport Seva Kendra in India, IRCTC ticketing system, and core banking transformations using their BaNCS product.
8. Digital vs Ninja vs Prime
β Completeβ Interview Question
If you are downgrade to digital or ninja will you agreed to that?
β Model Answer
(Model Answer): While I am aiming for the Prime/Digital role due to my specialized skills in new technologies, I am open to the Ninja role as I value the opportunity to start my career with TCS and prove my worth to grow internally.
9. Recent News
β Completeβ Interview Question
What are some recent news or updates regarding TCS and its competitors?
β Model Answer
(Model Answer): Recently, TCS has been heavily investing in Generative AI, launching its AI-driven platform TCS Enterprise Cognitive Hub. They've also been securing mega-deals in the UK and cloud transformation projects globally. Their focus on sustainability and achieving net-zero emissions by 2030 is also prominent.
10. Company Background
β Completeβ Interview Question
What do you know about the overall background of this company?
β Model Answer
TCS (Tata Consultancy Services) is an Indian multinational IT services and consulting company, part of the Tata Group. It operates in 150 locations across 46 countries.
HR Questions
1. Tell Me About Yourself
β Completeβ Interview Question
Tell me about yourself.
β Model Answer
(Model Answer): I am a recent graduate with a degree in CSE. I have a strong foundation in [Your Languages] and web development. Recently, I built [Project Name] where I utilized [Tech Stack]. I am passionate about solving problems through code and eager to bring my skills to a professional team.
2. Family Background
β Completeβ Interview Question
Tell me about your family background.
β Model Answer
(General Guide): Keep it brief and positive. E.g., 'I come from a nuclear family of four. My father is in [profession], my mother is [profession]. They have always supported my educational pursuits.'
3. Hometown
β Completeβ Interview Question
Where is your hometown?
β Model Answer
(General Guide): Mention your city and state clearly.
4. Speciality of Hometown
β Completeβ Interview Question
What is the speciality of your hometown?
β Model Answer
(General Guide): Be prepared to mention 1-2 interesting facts (historical significance, famous food, or industries).
5. Hobbies
β Completeβ Interview Question
What are your hobbies?
β Model Answer
(General Guide): Mention hobbies that show positive traits (e.g., playing a team sport shows teamwork, reading shows continuous learning).
6. Interests
β Completeβ Interview Question
What are your Interests?
β Model Answer
(General Guide): Mention professional interests like AI trends, open-source contribution, or tech blogs, alongside personal interests.
7. Strengths
β Completeβ Interview Question
What are your key strengths?
β Model Answer
(Model Answer): My key strengths are my adaptability, problem-solving mindset, and ability to learn new technologies quickly.
8. Weaknesses
β Completeβ Interview Question
What are your weaknesses?
β Model Answer
(Model Answer): Sometimes I focus too much on details (perfectionism), which can slow me down. However, I am actively using time-boxing techniques to ensure I meet deadlines efficiently.
9. Study Gap
β Completeβ Interview Question
Hr: Regarding academics and study gap.
β Model Answer
(General Guide): Be honest. If it was for medical reasons, state it briefly. If for preparation (like UPSC/GATE), frame it positively as a period of intense learning and discipline.
10. Academics
β Completeβ Interview Question
Explain your academic performance and background.
β Model Answer
(General Guide): Highlight your consistent performance. If grades dropped, explain what you learned from the setback and how you improved.
11. Preferred Location
β Completeβ Interview Question
Hr-prefered location?
β Model Answer
(Model Answer): I am flexible, but if given a choice, I would prefer [City]. However, I am completely open to relocating wherever the company needs me.
12. Relocation
β Completeβ Interview Question
Hr: Relocation - Are you willing to relocate?
β Model Answer
(Model Answer): Yes, I am absolutely willing to relocate. I see it as a great opportunity to explore a new city and grow independently.
13. Willing to Switch
β Completeβ Interview Question
Are you willing to switch for a better opportunity in another company?
β Model Answer
(Model Answer): My goal right now is to find a stable company where I can learn, contribute, and build a long-term career. While career growth is important, I value loyalty and am looking for an organization like yours where I can grow internally rather than jumping from company to company.
14. Night Shift
β Completeβ Interview Question
Hr: Night shift?? Are you open to working night shifts?
β Model Answer
(Model Answer): Yes, I am flexible and ready to work in night shifts if the project requires interaction with global clients.
15. Location Flexibility
β Completeβ Interview Question
How flexible are you regarding the work location?
β Model Answer
(Model Answer): I am 100% flexible regarding location. My priority is starting my career with a great company.
16. Two Job Offers
β Completeβ Interview Question
Hr: Offer of two companies so which one to select?
β Model Answer
(Model Answer): I would evaluate the job profile, learning curve, company culture, and long-term growth prospects. Money is secondary at this stage of my career. (Imply that this company wins on those metrics).
17. Why Should We Hire You?
β Completeβ Interview Question
Why should we hire you over other candidates?
β Model Answer
(Model Answer): You should hire me because I have a solid technical foundation that matches your requirements. I am a quick learner, highly adaptable, and eager to contribute to the company's success from day one.
18. Why This Company?
β Completeβ Interview Question
Why do you want to work for this specific company?
β Model Answer
(Model Answer): I admire this company's culture of innovation and its impact on the industry. The opportunity to work alongside industry experts here aligns perfectly with my career aspirations.
19. Why This Package?
β Completeβ Interview Question
Why are you expecting this specific package?
β Model Answer
(Model Answer): I am expecting standard industry compensation for a fresher of my skill level, but my primary focus right now is learning and securing a good role.
20. Deadline Handling
β Completeβ Interview Question
How you handle when you are junior when deadline is near?
β Model Answer
(Model Answer): I would first break the remaining tasks into smaller chunks and prioritize them. If I foresee missing the deadline, I would proactively communicate the status to my senior/manager and ask for guidance or help.
21. Team Conflict
β Completeβ Interview Question
Situation based: if someone is not working in a team them what he will do?
β Model Answer
(Model Answer): I would try to understand their perspective through open communication. If there's a misunderstanding or a blocker, I'd help resolve it. If it persists, I would escalate it professionally to the team lead.
22. Criticism Handling
β Completeβ Interview Question
How to handle criticism and feedback?
β Model Answer
(Model Answer): I view constructive criticism as an opportunity for growth. I listen objectively, ask clarifying questions, and actively work to implement the feedback.
23. Priority Handling
β Completeβ Interview Question
How do you handle multiple priorities or tasks?
β Model Answer
(Model Answer): I use the Eisenhower Matrix (Urgent vs Important) to prioritize tasks and ensure clear communication with stakeholders regarding realistic timelines.
24. Working Under Pressure
β Completeβ Interview Question
Can you work well under pressure?
β Model Answer
(Model Answer): Yes, I work well under pressure. I stay calm, prioritize tasks, and focus on one thing at a time to ensure quality isn't compromised.
25. HR Interviewer Question
β Completeβ Interview Question
What if you are the HR of a company, what 2 questions will you ask to check the capability of a person?
β Model Answer
(HR Question Answer): If I were an HR, I would ask: 1. "Can you describe a time you failed and how you handled it?" (To check resilience and accountability). 2. "How do you prioritize your tasks when you have multiple tight deadlines?" (To check time management and work ethic).
26. Experience of Technical Interview
β Completeβ Interview Question
What was your experience of the technical interview?
β Model Answer
(HR Question Answer): My experience in the technical interview was challenging but very engaging. I enjoyed discussing my project architecture and algorithms. It gave me a good glimpse of the high technical standards expected at this company.
27. Conflict Resolution
β Completeβ Interview Question
Bonus: Tell me about a time you had a conflict with a team member and how you resolved it.
β Model Answer
(Bonus Answer): (HR) In a team conflict, I focus on the problem, not the person. I schedule a 1-on-1 meeting to listen to their perspective without interrupting. We discuss our differing views calmly, identify the common goal, and brainstorm a compromise that benefits the project.
28. Future Goals
β Completeβ Interview Question
Bonus: Where do you see yourself in 5 years?
β Model Answer
(Bonus Answer): (HR) In 5 years, I see myself as a Senior Software Engineer or Technical Lead. I want to have deep expertise in building scalable systems and be in a position where I can mentor junior developers and drive architectural decisions for the team.
29. Experience Not Mentioned in CV
β Completeβ Interview Question
Is there any relevant experience you have that is not mentioned in your CV?
β Model Answer
(General Guide): Mention any relevant personal projects, coding competitions, or soft-skill experiences (like event organizing) that didn't fit on the page.
Logical / Puzzle Questions
1. Water Jug Problem
β Completeβ Interview Question
Explain the Water Jug Problem (Measure 4L using 3L & 5L jugs).
β Model Answer
You have 3L and 5L jugs, need 4L.
1. Fill 5L jug.
2. Pour from 5L to 3L jug (leaving 2L in 5L jug).
3. Empty 3L jug.
4. Pour the 2L into the 3L jug.
5. Fill 5L jug again.
6. Pour from 5L into the 3L jug until it's full (takes 1L).
7. The 5L jug now has exactly 4L.
2. Missing Number
β Completeβ Interview Question
Find missing numbers in an array.
β Model Answer
To find one missing number in an array of 1 to N:
def find_missing(arr, n):
expected_sum = n * (n + 1) // 2
actual_sum = sum(arr)
return expected_sum - actual_sum3. Find Unique Age Count
β Completeβ Interview Question
How to find unique age count from a given dataset?
β Model Answer
In code: use a Set to store ages, then return the size of the Set. In SQL: SELECT COUNT(DISTINCT age).
4. Coding on Paper
β Completeβ Interview Question
Technical - paper pen code check. Can you write logic on paper?
β Model Answer
(Interview Tip): When writing code on paper, focus on correct logic and indentation. Speak your thoughts aloud so the interviewer understands your approach. Don't worry about minor syntax errors.
Interview-Specific Questions
1. Explain CV
β Completeβ Interview Question
Walk me through your CV.
β Model Answer
(Interview Tip): Give a 2-minute chronological walkthrough. Start with education, highlight key skills, spend the most time on your best project, and conclude with what you are looking for.
2. Skills
β Completeβ Interview Question
Technical: Regarding Skills mentioned in your resume.
β Model Answer
(Interview Tip): Be prepared to answer fundamental questions on EVERY skill listed. If you rate yourself 8/10 in Java, expect advanced multithreading/JVM questions.
3. Certifications
β Completeβ Interview Question
What certifications do you hold and how are they relevant?
β Model Answer
(Interview Tip): Be able to explain the core concepts learned in the certification, not just that you passed the exam.
4. Preferred Language
β Completeβ Interview Question
What is your preferred programming language?
β Model Answer
(Interview Tip): Stick to the language you are most comfortable solving algorithmic problems in (usually C++, Java, or Python).
5. Technology Used
β Completeβ Interview Question
Questions from technology used in your projects.
β Model Answer
(Interview Tip): Be ready to explain the pros and cons of the technology stack you chose for your projects.
6. Hands-on Experience
β Completeβ Interview Question
Describe your hands-on experience with the technologies listed in your CV.
β Model Answer
(Interview Tip): Highlight practical application over theoretical knowledge. Mention bug fixes, optimizations, or real-world constraints you faced.
7. AI Usage in Projects
β Completeβ Interview Question
Have you used AI tools to assist in building your projects? Be honest.
β Model Answer
(Model Answer): Yes, I use AI tools like Copilot/ChatGPT to boost productivity (like writing boilerplate code or explaining complex errors), but I ensure I thoroughly understand the logic before integrating it into my project.
8. Explain Team Contribution
β Completeβ Interview Question
Explain your exact contribution in group projects.
β Model Answer
(Interview Tip): Clearly delineate your responsibilities. 'My teammate handled the frontend, while I designed the database schema and built the REST APIs.'
TCS Prime Interview Questions
1. Prime: UI/UX
β Completeβ Interview Question
What is UI/UX and why is it important?
β Model Answer
(Prime Interview Answer): UI focuses on the visual interface (buttons, layouts), while UX focuses on the overall user journey and experience. For a Prime role, you should emphasize how you design scalable and accessible interfaces.
2. Prime: Hobbies
β Completeβ Interview Question
What are your hobbies?
β Model Answer
(Prime Interview Answer): I enjoy coding side-projects and participating in hackathons. These hobbies help me stay updated with the latest technologies, which is crucial for a Prime role where deep technical expertise is expected.
3. Prime: Family Background
β Completeβ Interview Question
Tell me about your family background.
β Model Answer
(Prime Interview Answer): Briefly explain your family background. Interviewers ask this to understand your support system and personal motivations.
4. Prime: University Choice
β Completeβ Interview Question
Why did you choose your current university?
β Model Answer
(Prime Interview Answer): I chose my university because of its diverse environment and strong practical curriculum. It gave me the platform to work on advanced projects, which prepared me for a specialized role like TCS Prime.
5. Prime: React, NPM, HTML
β Completeβ Interview Question
Explain your knowledge in React, NPM, and HTML.
β Model Answer
(Prime Interview Answer): React is used for building dynamic UIs using a virtual DOM. NPM manages packages and dependencies. HTML provides the structural foundation. In a Prime role, you are expected to know how they interact seamlessly in a full-stack environment.
6. Prime: Reverse String
β Completeβ Interview Question
Coding: reverse a string
β Model Answer
(Prime Interview Answer): Reversing a string is a common screening question. In Python, you can simply use slicing: s[::-1]. In C++ or Java, use a two-pointer approach, swapping the first and last characters, then moving inwards until the pointers meet, achieving O(N) time and O(1) space.
7. Prime: Move 0 to the end
β Completeβ Interview Question
Coding: move 0 to the end of an array
β Model Answer
(Prime Interview Answer): To move all zeroes to the end of an array while maintaining the order of non-zero elements, use a two-pointer approach. Keep a pointer insertPos = 0. Iterate through the array; if an element is non-zero, place it at arr[insertPos] and increment insertPos. Finally, fill the rest of the array from insertPos to the end with zeroes. Time: O(N), Space: O(1).
8. Prime: Armstrong Number
β Completeβ Interview Question
Coding: check if a number is an Armstrong number
β Model Answer
(Prime Interview Answer): An Armstrong number (like 153) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. Logic: extract digits using modulo 10 (num % 10), cube them (or raise to the required power), add to a sum, and divide the number by 10 (num / 10) until it reaches 0.
9. Prime: Auth vs Auth
β Completeβ Interview Question
Project: authorisation vs authentication
β Model Answer
(Prime Interview Answer): Authentication verifies who the user is (e.g., login via email/password or OAuth). Authorization determines what the user is allowed to do (e.g., checking if the logged-in user has 'admin' privileges to access a specific route or file).
10. Prime: Struct
β Completeβ Interview Question
What is a Struct?
β Model Answer
(Prime Interview Answer): A Struct in C/C++ is a composite data type that groups together variables of different data types under a single name. Unlike Classes in C++ where members are private by default, members of a Struct are public by default. It's often used for simple data structures like points or nodes.
11. Prime: Reversal of Name
β Completeβ Interview Question
Coding: Reversal of name
β Model Answer
(Prime Interview Answer): Reversing a name is identical to reversing a string. In C++, we can use the std::reverse function from the algorithm library, or manually swap characters from both ends using two pointers until they meet in the middle.
12. Scale Application
β Completeβ Interview Question
Bonus: How would you scale an application to handle 1 million concurrent users?
β Model Answer
(Bonus Answer): To scale for 1 million users: Use load balancers to distribute traffic across multiple app servers (Horizontal Scaling). Implement caching (Redis/Memcached) to reduce database load. Use a CDN for static assets. Implement database sharding or read-replicas. Transition to a Microservices architecture if the monolith becomes a bottleneck.
13. Microservices vs Monolith
β Completeβ Interview Question
Bonus: Explain the difference between Microservices and Monolithic architecture.
β Model Answer
(Bonus Answer): A Monolith is a unified single unit where UI, business logic, and database access are tightly coupled. Microservices break the application into small, loosely coupled, independently deployable services that communicate via APIs. Microservices offer better scalability and fault isolation but introduce complexity in deployment and monitoring.
14. Prime: Optimize Code
β Completeβ Interview Question
To optimise the code further, what steps do you take?
β Model Answer
(Prime Interview Answer): To optimize code further, I look at algorithmic complexity firstβcan an O(N^2) loop be reduced to O(N) using a Hash Map? Then I look at space complexity, removing unnecessary data structures. Finally, in web apps, I optimize network calls (debouncing, caching) and database queries (indexing).
15. Prime: Validate BST
β Completeβ Interview Question
Assessment question from trees: How to validate if a tree is a BST?
β Model Answer
(Prime Interview Answer): To validate if a binary tree is a Binary Search Tree (BST), we can use a recursive approach. We pass a minimum and maximum valid range to each node. For the root, it's (-infinity, +infinity). For the left child, the max becomes the root's value. For the right child, the min becomes the root's value. Time complexity is O(N).
TCS Ninja Interview Questions
1. Ninja: GPT & Types
β Completeβ Interview Question
What is GPT, full form of GPT & types?
β Model Answer
(Ninja Interview Answer): GPT stands for Generative Pre-trained Transformer. It is an AI model that generates human-like text. Types include GPT-3, GPT-4, etc.
2. Ninja: Tell me about yourself (Not in CV)
β Completeβ Interview Question
Tell me about yourself that is not mentioned in CV.
β Model Answer
(Ninja Interview Answer): I am a highly adaptable person. Outside of my technical skills, I frequently organize tech meetups in my college, which has built my leadership and communication skills.
3. Ninja: Family Background
β Completeβ Interview Question
Tell me about your family background.
β Model Answer
(Ninja Interview Answer): Keep it simple. "I come from a supportive family of four..." They want to see your communication skills.
4. Ninja: Staying away from family
β Completeβ Interview Question
From how long you are staying far away from your family?
β Model Answer
(Ninja Interview Answer): I have lived away from my family for my studies for several years. This has taught me independence and adaptability, so relocating for the Ninja role is completely fine with me.
5. Ninja: Variable/Method Overriding
β Completeβ Interview Question
Explain variable and method overriding.
β Model Answer
(Ninja Interview Answer): Method overriding is when a child class provides a specific implementation of a method that is already provided by its parent class. Variable overriding (shadowing) is when a local variable has the same name as an instance variable, hiding it.
6. Ninja: TCS Company Details
β Completeβ Interview Question
Who is the TCS CEO, where is the headquarters, and what is the established year?
β Model Answer
(Ninja Interview Answer): TCS (Tata Consultancy Services) was established in 1968. Its headquarters are in Mumbai, Maharashtra. The current CEO is K. Krithivasan. It is one of the largest IT services and consulting companies globally.
7. Ninja: Prioritize Tasks
β Completeβ Interview Question
Situation based: How do you prioritise easy and hard tasks?
β Model Answer
(Ninja Interview Answer): When faced with multiple tasks, I use the Eisenhower Matrix. I prioritize urgent and important tasks first (hard tasks with tight deadlines). Then, I schedule important but non-urgent tasks. If easy tasks can be finished quickly (under 2 minutes), I knock them out to clear my plate.
8. Ninja: Encryption Decryption
β Completeβ Interview Question
Projects from CV: Explain encryption and decryption used in your project.
β Model Answer
(Ninja Interview Answer): In my project, I used encryption to secure sensitive user data before storing it in the database. I used standard libraries (like bcrypt for passwords) which apply one-way hashing with a salt, and AES for two-way encryption/decryption of other sensitive fields.
9. Ninja: Software Testing
β Completeβ Interview Question
Explain white box, unit, and integration testing.
β Model Answer
(Ninja Interview Answer): Unit Testing verifies individual components or functions. Integration Testing checks if different modules work correctly together. White Box Testing is a method where the internal structure/code is known to the tester, allowing them to test specific execution paths.
10. Java final keywords
β Completeβ Interview Question
Bonus: What is the difference between final, finally, and finalize in Java?
β Model Answer
(Bonus Answer): final is a keyword used to restrict modification (constant variables, non-overridable methods, non-inheritable classes). finally is a block in exception handling that executes regardless of whether an exception occurs. finalize is a method called by the garbage collector before an object is destroyed.
11. Ninja: Local Storage Drawbacks
β Completeβ Interview Question
Projects: Why have you used local storage and what are its drawbacks?
β Model Answer
(Ninja Interview Answer): I used Local Storage to persist the user's theme preference and cart items across sessions. The main drawback is security; Local Storage is vulnerable to Cross-Site Scripting (XSS) attacks, so sensitive data like JWT tokens shouldn't be stored there.
IT Service Companies Interview Questions
- Infosys: Questions covering the difference between Systems Engineer (SE) and Specialist Programmer (SP) roles, and how to tackle their famous puzzle/aptitude rounds.
- Wipro: Differences between Elite and Turbo profiles.
- Accenture: Deep-dive into Agile methodologies and why Accenture relies on them.
- Capgemini: What to expect and how to ace their tricky pseudo-code rounds.
- Cognizant: Differences between GenC and GenC Next roles.
- Deloitte: Consulting-style questions (e.g., how to handle client disagreements).
- IBM & HCL: Questions on modernizing legacy Mainframe systems to the Cloud.
1. Infosys Roles
β Completeβ Interview Question
What is the difference between SE and SP roles at Infosys?
β Model Answer
(Infosys Specific): Infosys typically hires for two main roles: Systems Engineer (SE) and Specialist Programmer (SP). SE focuses on standard application development and support, while SP requires deep programming skills, advanced DSA knowledge, and focuses on complex architectural problems and cutting-edge technologies.
2. Infosys Puzzles
β Completeβ Interview Question
Explain a typical puzzle/aptitude question asked in Infosys rounds.
β Model Answer
(Infosys Specific): Infosys is famous for its puzzle rounds (often sourced from Shakuntala Devi books). A common one: "Measure 4 liters of water using a 3L and 5L jug." Answer: Fill 5L, pour into 3L. You have 2L left. Empty 3L, pour the 2L into 3L. Fill 5L, pour 1L into 3L until full. You now have exactly 4L in the 5L jug.
3. Wipro Elite vs Turbo
β Completeβ Interview Question
What is the difference between Wipro Elite and Turbo?
β Model Answer
(Wipro Specific): Elite is the standard hiring profile targeting freshers for core engineering roles. Turbo is the premium profile offered to candidates who clear advanced coding assessments, offering a significantly higher package and requiring strong problem-solving and algorithmic skills.
4. Accenture Agile
β Completeβ Interview Question
How does Accenture use Agile methodologies in its projects?
β Model Answer
(Accenture Specific): Accenture heavily relies on Agile methodologies. You should know that Agile promotes iterative development, daily stand-ups, sprints, and continuous feedback, allowing teams to adapt to changing client requirements quickly compared to traditional Waterfall methods.
5. Capgemini Pseudo-code
β Completeβ Interview Question
What can you expect in a Capgemini pseudo-code round?
β Model Answer
(Capgemini Specific): Capgemini often features a dedicated Pseudo-code round. You will be given language-agnostic code snippets involving loops, bitwise operators, and recursion, and you must predict the output. Practice tracing variables line-by-line to ace this.
6. Cognizant GenC
β Completeβ Interview Question
What is the difference between GenC and GenC Next roles at Cognizant?
β Model Answer
(Cognizant Specific): GenC is the base profile for fresh graduates. GenC Next (and Elevate) are premium profiles requiring you to pass a skill-based assessment focusing on advanced Java/Python, database querying, and scenario-based coding challenges.
7. Deloitte Consulting
β Completeβ Interview Question
How would you handle a disagreement with a client during a consulting project?
β Model Answer
(Deloitte Specific): Deloitte is a consulting firm, so client interaction is key. If a client disagrees with your technical approach, you should: 1. Listen actively to their concerns without getting defensive. 2. Explain the pros and cons of your approach using data. 3. Be willing to compromise to find a solution that meets their business needs.
8. IBM HCL Legacy
β Completeβ Interview Question
Why do large enterprises like IBM and HCL still use Mainframes, and how is it transitioning to Cloud?
β Model Answer
(IBM/HCL Specific): Companies like IBM and HCL manage massive IT infrastructures for global banks and airlines, many of which still rely on Mainframes for extreme reliability and transaction volume. A common interview topic is discussing the challenges of modernizing these legacy systems to Cloud-native architectures (Hybrid Cloud).
Product-Based Companies Interview Questions
Covering companies like Amazon, Google, Microsoft, and Startups.
- DSA Expectations: How they differ drastically from service companies (focusing on Big O and optimizations).
- Amazon STAR Method: Detailed breakdown of how to answer behavioral questions using the STAR framework.
- System Design: Explaining High-Level Design (HLD) vs Low-Level Design (LLD).
1. Product DSA
β Completeβ Interview Question
How do product companies evaluate Data Structures and Algorithms differently than service companies?
β Model Answer
(Product Company Specific): Unlike service companies that test basic syntax and logic, Product companies (FAANG, top startups) focus on optimization. You must know how to use HashMaps for O(1) lookups, understand Dynamic Programming, and confidently calculate Big O Time and Space complexities.
2. Amazon STAR
β Completeβ Interview Question
What is the STAR method, and why do companies like Amazon strictly use it for behavioral rounds?
β Model Answer
(Product Company Specific): The STAR method (Situation, Task, Action, Result) is crucial for behavioral rounds, especially at Amazon. Always structure your answers to highlight what *you* specifically did (Action) and back up the outcome with measurable data (Result).
3. HLD vs LLD
β Completeβ Interview Question
Explain High-Level Design (HLD) vs Low-Level Design (LLD).
β Model Answer
(Product Company Specific): High-Level Design (HLD) focuses on the overall system architecture (Load Balancers, Databases, Microservices). Low-Level Design (LLD) focuses on the actual code structure, class diagrams, Object-Oriented principles, and Design Patterns.