Jio Platforms
10+ Hinduja Tech Interview Questions and Answers
Distinct Subarrays with At Most K Odd Elements
Given an array A
of N
integers, determine the total number of distinct subarrays that contain at most K
odd elements.
Example:
Input:
A = [3, 2, 3], K = 1
Output:
Count the total number of distinct subarrays with at most K odd elements in an array.
Iterate through all subarrays and count the number of odd elements in each subarray.
Use a hashmap to keep track of the count of distinct subarrays with at most K odd elements.
Return the total count of distinct subarrays for each test case.
Q2. Is is possible to implement stack using queues ?
Yes, it is possible to implement stack using queues.
Implement push operation by enqueueing elements to the queue.
Implement pop operation by dequeuing all elements except the last one and enqueueing them again.
The last element in the queue will be the top element of the stack.
Example: Queue: 1 2 3 4 5, Stack: 5 4 3 2 1
Q3. Tell me something about recursion also do you have idea about time and space complexity.
Recursion is a process in which a function calls itself. Time and space complexity are important factors to consider while using recursion.
Recursion is used to solve problems that can be broken down into smaller sub-problems.
It involves a base case and a recursive case.
Time complexity refers to the amount of time taken by an algorithm to run, while space complexity refers to the amount of memory used by an algorithm.
Recursion can have high time and space complexity, so it's i...read more
Q4. What is Frontend, Do you know Node js ?
Frontend is the part of a website or application that users interact with. Node.js is a JavaScript runtime environment.
Frontend refers to the user interface and user experience of a website or application.
It includes the design, layout, and functionality of the website or application.
Node.js is a JavaScript runtime environment that allows developers to run JavaScript on the server-side.
It is commonly used for building scalable and high-performance web applications.
Node.js can...read more
Q5. what is the difference between list and tuple?
List and tuple are both data structures in Python, but list is mutable while tuple is immutable.
List is defined using square brackets [], while tuple is defined using parentheses ().
Elements in a list can be added, removed, or modified, while elements in a tuple cannot be modified.
Lists are used for collections of data that may change over time, while tuples are used for fixed collections of data.
Lists are generally faster for iteration and appending, while tuples are faster ...read more
Q6. What is the use of marquee tag?
The marquee tag is used in HTML to create a scrolling text or image effect on a webpage.
Used to create a scrolling effect for text or images on a webpage
Can specify direction, speed, and behavior of the scrolling
Example: <marquee behavior='scroll' direction='left'>Scrolling text</marquee>
Q7. What are constructors and destructors?
Constructors and destructors are special member functions in object-oriented programming languages.
Constructors are used to initialize the object's data members when an object is created.
Destructors are used to free up the memory allocated to the object when it is destroyed.
Constructors have the same name as the class and no return type.
Destructors have the same name as the class preceded by a tilde (~) and no return type.
Example: class Car { public: Car(); ~Car(); };
Construc...read more
Q8. Find nth smallest and largest element (optimal solution)
Finding nth smallest and largest element in an array
Sort the array and return the nth smallest/largest element
Use quickselect algorithm for optimal solution
For nth smallest element, partition the array around pivot until pivot index is n-1
For nth largest element, partition the array around pivot until pivot index is len(array)-n
Handle edge cases like n being greater than array length
Q9. What are data types in python?
Data types in Python are the classification of data items that determine the operations that can be performed on them.
Python has several built-in data types such as integers, floats, strings, booleans, and complex numbers.
Lists, tuples, and dictionaries are also data types in Python.
Each data type has its own set of operations that can be performed on it.
For example, arithmetic operations can be performed on integers and floats, but not on strings.
Boolean data types can only ...read more
Q10. Why is dbms used?
DBMS is used to manage and organize large amounts of data efficiently.
DBMS provides a centralized and secure way to store and retrieve data.
It allows multiple users to access and modify data simultaneously.
It ensures data integrity and consistency through various constraints and rules.
It provides backup and recovery mechanisms to prevent data loss.
Examples of DBMS include Oracle, MySQL, SQL Server, and PostgreSQL.
Q11. what is a foreign key?
A foreign key is a column or set of columns in a database table that refers to the primary key of another table.
It establishes a link between two tables
It ensures referential integrity
It helps in maintaining data consistency
Example: CustomerID in Orders table refers to Customer table's primary key
Q12. Difference between python and java.
Python is a dynamically typed, interpreted language while Java is a statically typed, compiled language.
Python is easier to learn and write code quickly.
Java is more efficient and faster due to its compilation process.
Python is better for data analysis and machine learning while Java is better for enterprise applications.
Python has a simpler syntax and is more readable while Java has a more complex syntax.
Python has a larger library of pre-built modules while Java has a large...read more
Top HR Questions asked in Hinduja Tech
Interview Process at Hinduja Tech
Top Graduate Engineer Trainee (Get) Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month