Technology Developer
Technology Developer Interview Questions and Answers
Q1. Pretty JSON Formatting Problem
You're provided with a string 'STR' that represents a JSON object. Your task is to return an array of strings representing JSON objects, formatted with proper indentation based on...read more
The task is to format a JSON object string with proper indentation based on specific rules.
Iterate through the string character by character and keep track of the indentation level.
Use a stack to keep track of opening and closing braces to determine the indentation level.
Insert four spaces or a tab (' ') for each level of indentation.
Handle commas to represent new lines in the output array of strings.
Q2. Number Pattern Generator
To arrange a high-security meeting, tables are set up for delegates and security personnel. There are N
rows of tables. The first row has one table, the second row has two tables, and s...read more
Generate a pattern of guest and security personnel distributions across tables for a given number of rows.
Iterate through each row from 1 to N
For each row, print the pattern based on the number of guests and security personnel at each table
Tables on each end of a row are reserved for security personnel
Q3. Minimum Sum in Matrix Problem Statement
You are given a 2D matrix 'ARR' of size 'N x 3' with integers, where 'N' is the number of rows. Your task is to compute the smallest sum achievable by selecting one eleme...read more
Find the smallest sum achievable by selecting one element from each row of a matrix, following certain constraints.
Iterate through each row and find the minimum element that can be selected without violating the constraints
Keep track of the selected elements to avoid selecting elements directly below them in the next row
Sum up the selected elements to get the smallest possible sum
Q4. Peak Element Finder
For a given array of integers arr
, identify the peak element. A peak element is an element that is greater than its neighboring elements. Specifically, if arr[i]
is the peak, then both arr[i...read more
Find the peak element in an array of integers.
Iterate through the array and check if the current element is greater than its neighbors.
Handle edge cases for the first and last elements of the array.
Return the peak element found.
Q5. Buy and Sell Stock Problem Statement
Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more
The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.
Iterate through the stock prices to find the maximum profit that can be achieved by buying and selling stocks at different points.
Keep track of the maximum profit after the first transaction and the maximum profit overall after the second transaction.
Consider edge cases where no profit can be made or where only one transaction is po...read more
Technology Developer Jobs
Interview Questions of Similar Designations
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month