Software Engineer Software Developer Interview Questions

3,273 software engineer software developer interview questions shared by candidates

Given an array, print the Next Greater Element (NGE) for every element. // // The Next greater Element for an element x is the first greater element on the right side of x in the array. // Elements for which no greater element exist, consider the next greater element as -1. // // Example: // // Input: arr[] = [ 4 , 5 , 2 , 25 ] // Output: 4 –> 5 // 5 –> 25 // 2 –> 25 // 25 –> -1 // Explanation: except 25 every element has an element greater than them present on the right side // // Input: arr[] = [ 13 , 7, 6 , 12 ] // Output: 13 –> -1 // 7 –> 12 // 6 –> 12 // 12 –> -1 // Explanation: 13 and 12 don’t have any element greater than them present on the right side
avatar

Software Engineer - Java Developer

Interviewed at Synergy Business Solutions

3.6
Jan 26, 2024

Given an array, print the Next Greater Element (NGE) for every element. // // The Next greater Element for an element x is the first greater element on the right side of x in the array. // Elements for which no greater element exist, consider the next greater element as -1. // // Example: // // Input: arr[] = [ 4 , 5 , 2 , 25 ] // Output: 4 –> 5 // 5 –> 25 // 2 –> 25 // 25 –> -1 // Explanation: except 25 every element has an element greater than them present on the right side // // Input: arr[] = [ 13 , 7, 6 , 12 ] // Output: 13 –> -1 // 7 –> 12 // 6 –> 12 // 12 –> -1 // Explanation: 13 and 12 don’t have any element greater than them present on the right side

Question about the java protected variable and it's accession. suppose a class A is there and there is a class B which extends A, we can access the protected variable of class A in class B as it is a part of inheritance tree , but suppose class C is there and it extends B than what will happen? all the questions were like this question only, tricky and based on basics.
avatar

Software Engineer Developer

Interviewed at Replicon

3.9
Nov 9, 2013

Question about the java protected variable and it's accession. suppose a class A is there and there is a class B which extends A, we can access the protected variable of class A in class B as it is a part of inheritance tree , but suppose class C is there and it extends B than what will happen? all the questions were like this question only, tricky and based on basics.

Viewing 51 - 60 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 3,273 interview questions and reports from Software engineer software developer interviews. Prepare for your interview. Get hired. Love your job.