Add office photos
Engaged Employer

uCertify

2.7
based on 83 Reviews
Filter interviews by

Green Plus Pharma Interview Questions and Answers

Updated 5 Feb 2024

Q1. The Skyline Problem

Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette when viewed from a distance. Each building is descri...read more

Ans.

Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette.

  • Iterate through the buildings and create a list of critical points (x, y) where the height changes.

  • Sort the critical points based on x-coordinate and process them to form the skyline.

  • Merge consecutive horizontal segments of equal height to ensure no duplicates in the output.

Add your answer

Q2. Sort String with Alternate Lower and Upper Case

Given a string STR containing both lowercase and uppercase letters, the task is to sort the string so that the resulting string contains uppercase and lowercase l...read more

Ans.

Sort a string with alternate lowercase and uppercase letters in sorted order.

  • Split the string into lowercase and uppercase letters.

  • Sort the lowercase and uppercase letters separately.

  • Merge the sorted lowercase and uppercase letters alternately.

Add your answer

Q3. Water Flow Problem Statement

You are given a matrix 'A' of size 'N' x 'M', where each cell contains the height of water placed in that cell. Water can flow in four directions: up, down, left, and right, but onl...read more

Ans.

Find coordinates from which water can flow to both the Pacific and Atlantic Oceans in a given matrix of water heights.

  • Create a function that takes in the matrix 'A' and its dimensions 'N' and 'M'.

  • Implement a depth-first search (DFS) algorithm to find all coordinates from which water can flow to both oceans.

  • Keep track of visited cells and use two separate DFS calls to find coordinates for each ocean.

  • Sort and return the coordinates in lexicographical order.

Add your answer

Q4. Graph Coloring Problem

You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. Your task is to color this graph using two colors, such as blue and red, in a way that no two adjacent vert...read more

Ans.

Check if a given graph can be colored using two colors without adjacent vertices sharing the same color.

  • Use graph coloring algorithm like BFS or DFS to check if adjacent vertices can be colored with different colors.

  • If there are odd cycles in the graph, it is not possible to color the graph with two colors.

  • If the graph is bipartite, it is always possible to color the graph with two colors.

  • Example: For the input 5 4, 1 2, 1 3, 2 4, 3 5, the output should be YES.

Add your answer
Discover Green Plus Pharma interview dos and don'ts from real experiences

Q5. Valid Parentheses Problem Statement

Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.

Input:

The first line contains an integer...read more
Ans.

Check if given strings containing parentheses are balanced or not.

  • Use a stack to keep track of opening parentheses

  • Iterate through the string and push opening parentheses onto the stack

  • When a closing parenthesis is encountered, pop from the stack and check if it matches the corresponding opening parenthesis

  • If stack is empty at the end and all parentheses are matched, the string is balanced

  • If stack is not empty or mismatched parentheses are encountered, the string is not balanc...read more

Add your answer
Q6. What are semaphores?
Ans.

Semaphores are synchronization primitives used to control access to shared resources in a multi-threaded environment.

  • Semaphores can be used to limit the number of threads accessing a resource simultaneously.

  • They can be binary (mutex) or counting semaphores.

  • Operations on semaphores include wait (P) and signal (V).

  • Example: In a producer-consumer problem, semaphores can be used to control access to a shared buffer.

View 1 answer

Q7. What is ITIL PROCESS

Ans.

ITIL (Information Technology Infrastructure Library) is a set of best practices for IT service management.

  • ITIL is a framework that outlines processes, tasks, and checklists for managing IT services.

  • It focuses on aligning IT services with the needs of the business and improving efficiency.

  • ITIL processes include incident management, problem management, change management, and more.

  • ITIL helps organizations deliver value to their customers through quality IT services.

  • ITIL certific...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Green Plus Pharma

based on 2 interviews
Interview experience
3.0
Average
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.9
 • 537 Interview Questions
4.0
 • 362 Interview Questions
4.0
 • 199 Interview Questions
4.2
 • 191 Interview Questions
3.2
 • 165 Interview Questions
4.1
 • 162 Interview Questions
View all
Top uCertify Interview Questions And Answers
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