Java Software Developer Interview Questions

4,193 java software developer interview questions shared by candidates

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type. Example 1: Input: s = "()" Output: true Example 2: Input: s = "()[]{}" Output: true Example 3: Input: s = "(]" Output: false Example 4: Input: s = "([])" Output: true Given an array of size N filled with numbers from 1 to N-1 in random order. The array has only one repetitive element. The task is to find the repetitive element. Examples: Input: a[] = {1, 3, 2, 3, 4} Output: 3 Explanation: The number 3 is the only repeating element. Input: a[] = {1, 5, 1, 2, 3, 4} Output: 1 Brute Force To Optimization
avatar

Software Engineer - Java Developer

Interviewed at Paytm

3.2
Oct 10, 2024

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type. Example 1: Input: s = "()" Output: true Example 2: Input: s = "()[]{}" Output: true Example 3: Input: s = "(]" Output: false Example 4: Input: s = "([])" Output: true Given an array of size N filled with numbers from 1 to N-1 in random order. The array has only one repetitive element. The task is to find the repetitive element. Examples: Input: a[] = {1, 3, 2, 3, 4} Output: 3 Explanation: The number 3 is the only repeating element. Input: a[] = {1, 5, 1, 2, 3, 4} Output: 1 Brute Force To Optimization

Viewing 891 - 900 interview questions

Glassdoor has 4,193 interview questions and reports from Java software developer interviews. Prepare for your interview. Get hired. Love your job.