Digital Technology Intern
Digital Technology Intern Interview Questions and Answers
Popular Companies
Q1. Maximize Sum from Array
Given an integer array ARR
of size N
, your objective is to perform a series of operations to maximize the sum of selected elements from the array. During each operation, you should:
- Sel...read more
Maximize sum by selecting elements from array and removing adjacent elements.
Select element 'i' and remove 'i-1' and 'i+1' from array during each operation.
Continue until array is empty to maximize sum of selected elements.
Focus on maximizing sum rather than printing results.
Q2. Next Greater Number Problem Statement
Given a string S
which represents a number, determine the smallest number strictly greater than the original number composed of the same digits. Each digit's frequency from...read more
Given a number represented as a string, find the smallest number greater than the original with the same digits.
Iterate from right to left to find the first digit that can be swapped with a smaller digit on its right.
Swap this digit with the smallest digit on its right that is greater than it.
Sort the digits to the right of the swapped digit in ascending order to get the smallest number.
If no such number exists, return -1.
Example: For S = '56789', the output should be '56798'...read more
Digital Technology Intern Interview Questions and Answers for Freshers
Q3. Queue Using Stack Problem Statement
Implement a queue data structure that follows the FIFO (First In First Out) property, using only instances of the stack data structure.
Note:
- Complete predefined functions t...read more
Implement a queue using only stack data structure with predefined functions for FIFO operations.
Use two stacks to simulate a queue - one for enqueue and one for dequeue operations.
For enQueue operation, push elements onto the enqueue stack.
For deQueue operation, if the dequeue stack is empty, transfer elements from enqueue stack to dequeue stack.
For peek operation, return the top element of the dequeue stack.
For isEmpty operation, check if both stacks are empty.
Example: enQue...read more
Q4. Minimum Number of Platforms Problem
Your task is to determine the minimum number of platforms required at a railway station so that no train has to wait.
Explanation:
Given two arrays:
AT
- representing the ar...read more
Determine the minimum number of platforms needed at a railway station so that no train has to wait.
Sort the arrival and departure times arrays in ascending order.
Use two pointers to iterate through the arrays and keep track of the number of platforms needed.
Increment the number of platforms needed when a train arrives and decrement when a train departs.
Return the maximum number of platforms needed at any point.
Example: For AT = [900, 940, 950] and DT = [910, 1200, 1120], the ...read more
Q5. Boundary Traversal of a Binary Tree
Given a binary tree of integers, your task is to return the boundary nodes of the tree in Anti-Clockwise direction starting from the root node.
Input:
The first line contains...read more
Return the boundary nodes of a binary tree in Anti-Clockwise direction starting from the root node.
Traverse the left boundary nodes from root to leaf nodes in a top-down manner
Traverse the leaf nodes from left to right
Traverse the right boundary nodes from leaf nodes to root in a bottom-up manner
Include only unique values in the boundary nodes
Q6. Find the Second Largest Element
Given an array or list of integers 'ARR', identify the second largest element in 'ARR'.
If a second largest element does not exist, return -1.
Example:
Input:
ARR = [2, 4, 5, 6, ...read more
Find the second largest element in an array of integers. Return -1 if second largest does not exist.
Iterate through the array to find the largest and second largest elements.
Handle cases where all elements are identical by returning -1.
Consider edge cases like empty array or array with less than 2 elements.
Share interview questions and help millions of jobseekers 🌟
Interview Questions of Similar Designations
Interview experiences of popular companies
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