Add office photos
Engaged Employer

Hewlett Packard Enterprise

4.2
based on 3.8k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

20+ HMEL's Guru Gobind Singh Petroleum Refinery Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Find the Duplicate Number Problem Statement

Given an integer array 'ARR' of size 'N' containing numbers from 0 to (N - 2). Each number appears at least once, and there is one number that appears twice. Your tas...read more

Ans.

Find the duplicate number in an array of integers from 0 to N-2.

  • Iterate through the array and keep track of the frequency of each number using a hashmap.

  • Return the number with a frequency greater than 1 as the duplicate number.

  • Alternatively, use Floyd's Tortoise and Hare algorithm to find the duplicate number in O(N) time and O(1) space.

View 1 answer

Q2. Count Inversions Problem Statement

Given an integer array ARR of size N, your task is to find the total number of inversions that exist in the array.

An inversion is defined for a pair of integers in the array ...read more

Ans.

Count the total number of inversions in an integer array.

  • Iterate through the array and for each pair of elements, check if the conditions for inversion are met.

  • Use a nested loop to compare each pair of elements efficiently.

  • Keep a count of the inversions found and return the total count at the end.

Add your answer

Q3. Remove Occurrences of Character from String

Given a string str and a character X, write a function to remove all occurrences of X from the string.

If the character X does not exist in the input string, the stri...read more

Ans.

Create a function to remove all occurrences of a given character from a string.

  • Iterate through the string and build a new string excluding the specified character.

  • Use string manipulation functions to achieve the desired result.

  • Handle the case where the character does not exist in the string.

  • Return the modified string as the output.

Add your answer

Q4. Remove Character from String Problem Statement

Given a string str and a character 'X', develop a function to eliminate all instances of 'X' from str and return the resulting string.

Input:

The first line contai...read more
Ans.

Develop a function to remove all instances of a given character from a string.

  • Iterate through the string and only add characters that are not equal to the given character to a new string.

  • Return the new string as the result.

  • Handle edge cases like empty string or character not found in the string.

  • Example: Input 'hello world' and 'o', output 'hell wrld'.

Add your answer
Discover HMEL's Guru Gobind Singh Petroleum Refinery interview dos and don'ts from real experiences

Q5. Character Frequency Problem Statement

You are given a string 'S' of length 'N'. Your task is to find the frequency of each character from 'a' to 'z' in the string.

Example:

Input:
S : abcdg
Output:
1 1 1 1 0 0 ...read more
Ans.

The task is to find the frequency of each character from 'a' to 'z' in a given string.

  • Create an array of size 26 to store the frequency of each character from 'a' to 'z'.

  • Iterate through the given string and increment the count of each character in the array.

  • Print the array of frequencies as the output for each test case.

Add your answer

Q6. Middle of a Linked List

You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.

If there is an odd number of elements, return the middle ...read more

Ans.

Return the middle element of a singly linked list, or the one farther from the head node in case of even number of elements.

  • Traverse the linked list with two pointers, one moving twice as fast as the other

  • When the fast pointer reaches the end, the slow pointer will be at the middle

  • Return the element pointed to by the slow pointer

Add your answer
Are these interview questions helpful?

Q7. Subarray With Given Sum Problem Statement

Given an array ARR of N integers and an integer S, determine if there exists a contiguous subarray within the array with a sum equal to S. If such a subarray exists, re...read more

Ans.

Given an array of integers, find a contiguous subarray with a given sum.

  • Iterate through the array while keeping track of the current sum and start index.

  • Use a hashmap to store the sum and its corresponding index.

  • If the current sum - target sum exists in the hashmap, return the indices.

  • Handle edge cases like when the target sum is 0 or when no subarray is found.

Add your answer

Q8. Maximum Subarray Sum Problem Statement

Given an array arr of length N consisting of integers, find the sum of the subarray (including empty subarray) with the maximum sum among all subarrays.

Explanation:

A sub...read more

Ans.

Find the sum of the subarray with the maximum sum among all subarrays in a given array.

  • Iterate through the array and keep track of the maximum sum subarray seen so far.

  • Use Kadane's algorithm to efficiently find the maximum subarray sum.

  • Handle cases where all elements are negative or array is empty.

  • Example: For input arr = [-2, 1, -3, 4, -1], the maximum subarray sum is 4.

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Intersection of Linked List Problem

You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.

Your task is to determine the data...read more

Ans.

Find the node where two linked lists merge, return -1 if no merging occurs.

  • Traverse both lists to find their lengths and the difference in lengths

  • Move the pointer of the longer list by the difference in lengths

  • Traverse both lists simultaneously until they meet at the merging point

Add your answer
Q10. Can you explain the concepts of method overloading and method overriding in object-oriented programming?
Ans.

Method overloading is having multiple methods in the same class with the same name but different parameters. Method overriding is redefining a method in a subclass with the same signature as in the superclass.

  • Method overloading allows multiple methods with the same name but different parameters in the same class.

  • Method overriding involves redefining a method in a subclass with the same signature as in the superclass.

  • Method overloading is resolved at compile time based on the ...read more

Add your answer

Q11. How well can you adapt when there is a change in technology used for a project? Explain your learning initiatives and processes that can be undertaken to ensure the knowledge transfer is done smoothly as expect...

read more
Ans.

I am highly adaptable to changes in technology and have a structured learning process to ensure smooth knowledge transfer.

  • I stay up-to-date with the latest technology trends and advancements

  • I am open to learning new technologies and tools

  • I have a structured learning process that involves researching, reading documentation, and practicing

  • I collaborate with team members to share knowledge and learn from each other

  • I attend conferences and workshops to learn about new technologie...read more

Add your answer
Q12. Can you explain the difference between static and dynamic linking in operating systems?
Ans.

Static linking includes all library modules in the executable file, while dynamic linking loads libraries at runtime.

  • Static linking includes all library modules in the executable file, increasing its size.

  • Dynamic linking loads libraries at runtime, reducing the size of the executable file.

  • Static linking results in faster startup time, while dynamic linking allows for easier updates to libraries.

  • Examples of static linking include linking libraries during compilation, while dyn...read more

Add your answer
Q13. What is the difference between inline functions and macros in C++?
Ans.

Inline functions are actual functions while macros are preprocessor directives in C++.

  • Inline functions are actual functions defined with the 'inline' keyword, while macros are preprocessor directives that are replaced before compilation.

  • Inline functions provide type checking and scope resolution, while macros do not.

  • Inline functions can have multiple lines of code and can access variables in the scope they are called from, while macros are limited to a single line and do not ...read more

Add your answer
Q14. What is the main difference between UNION and UNION ALL?
Ans.

UNION combines and removes duplicate rows, UNION ALL combines without removing duplicates.

  • UNION combines the result sets of two or more SELECT statements into a single result set

  • UNION removes duplicate rows from the result set

  • UNION ALL combines the result sets without removing duplicates

  • UNION is slower than UNION ALL as it requires additional processing to remove duplicates

  • Use UNION when you want to combine and remove duplicates, use UNION ALL when you want to combine without...read more

Add your answer
Q15. Can you explain the concepts of multitasking and multiprogramming?
Ans.

Multitasking involves executing multiple tasks simultaneously, while multiprogramming involves running multiple programs on a single processor.

  • Multitasking allows multiple tasks to run concurrently on a single processor, switching between them quickly.

  • Multiprogramming involves loading multiple programs into memory and executing them concurrently, utilizing idle CPU time efficiently.

  • Examples of multitasking include running multiple applications on a computer at the same time, ...read more

Add your answer
Q16. What is the difference between a process and a program?
Ans.

A process is an executing instance of a program, while a program is a set of instructions stored in the computer's memory.

  • A program is a static set of instructions stored on disk, while a process is a dynamic instance of those instructions being executed in memory.

  • Multiple processes can be running the same program simultaneously, each with its own memory space and resources.

  • Processes have their own unique process ID (PID) and can communicate with each other through inter-proc...read more

Add your answer
Q17. What do you mean by virtual functions in C++?
Ans.

Virtual functions in C++ allow a function to be overridden in a derived class, enabling polymorphic behavior.

  • Virtual functions are declared in a base class with the 'virtual' keyword.

  • They are overridden in derived classes to provide specific implementations.

  • They enable polymorphism, allowing objects of different derived classes to be treated as objects of the base class.

  • Example: class Animal { virtual void makeSound() { cout << 'Animal sound'; } }; class Dog : public Animal {...read more

Add your answer

Q18. Please brief me about the ITIL framework and how it helps in the application management practices.

Ans.

ITIL is a framework for IT service management that helps in application management practices.

  • ITIL stands for Information Technology Infrastructure Library.

  • It provides a set of best practices for IT service management.

  • ITIL helps in improving the quality of IT services and reducing costs.

  • It includes processes for incident management, problem management, change management, and more.

  • ITIL helps in aligning IT services with business needs.

  • In application management, ITIL helps in en...read more

Add your answer
Q19. What is the difference between a process and a thread?
Ans.

A process is an instance of a program, while a thread is a unit of execution within a process.

  • A process has its own memory space, while threads share the same memory space.

  • Processes are independent and isolated, while threads can communicate and share resources.

  • Creating a new process is more resource-intensive than creating a new thread.

  • Processes have their own program counter, while threads share the same program counter.

  • Examples: Running multiple instances of a web browser ...read more

Add your answer
Q20. What is a linker error in C++?
Ans.

A linker error in C++ occurs when the linker is unable to resolve references to functions or variables during the linking phase of compilation.

  • Linker errors occur when there are missing definitions for functions or variables that are referenced in the code.

  • Common causes of linker errors include forgetting to define a function that is declared, or not including the necessary library or object files.

  • Example: If a function 'foo()' is declared in a header file but not defined in ...read more

Add your answer
Q21. What are the advantages of using views in a database management system?
Ans.

Views provide a virtual representation of data, offering advantages such as simplifying complex queries, enhancing security, and improving performance.

  • Views simplify complex queries by predefining commonly used joins, filters, and aggregations.

  • Views enhance security by allowing users to access only specific columns or rows of a table.

  • Views improve performance by storing the results of complex queries, reducing the need for repetitive calculations.

  • Views can be used to hide sen...read more

Add your answer
Q22. What is the ARP protocol?
Ans.

ARP stands for Address Resolution Protocol, used to map IP addresses to MAC addresses in a local network.

  • ARP is used to find the MAC address of a device based on its IP address

  • It operates at the data link layer of the OSI model

  • ARP requests are broadcasted to all devices on the local network

  • Example: When a device wants to communicate with another device on the same network, it uses ARP to find the MAC address of the destination device

Add your answer

Q23. Design a classroom management system

Ans.

A classroom management system to track student attendance, grades, assignments, and communication with parents.

  • Track student attendance using RFID cards or biometric scanners

  • Record grades for each assignment and calculate overall grade

  • Manage assignments and deadlines with notifications for students

  • Enable communication between teachers, students, and parents through messaging system

Add your answer

More about working at Hewlett Packard Enterprise

Top Rated Large Company - 2024
Top Rated Company for Women - 2024
Top Rated IT/ITES Company - 2024
HQ - Houston,Texas, United States
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at HMEL's Guru Gobind Singh Petroleum Refinery

based on 5 interviews
1 Interview rounds
HR Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.9
 • 81 Interview Questions
3.9
 • 67 Interview Questions
3.7
 • 21 Interview Questions
4.7
 • 15 Interview Questions
4.3
 • 14 Interview Questions
3.7
 • 11 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter