
UST


20+ UST Software Engineer Interview Questions and Answers
Q1. String Compression Task
Develop an algorithm that compresses a string by replacing consecutive duplicate characters with the character followed by the count of its repetitions, if that count exceeds 1.
Example:...read more
Develop an algorithm to compress a string by replacing consecutive duplicate characters with the character followed by the count of its repetitions.
Iterate through the input string while keeping track of consecutive character counts.
Replace consecutive duplicate characters with the character followed by the count if count exceeds 1.
Ensure the count does not exceed 9 for each character.
Return the compressed string as output.
Q2. Binary Tree K-Sum Paths Problem
Given a binary tree where each node contains an integer value, and a number 'K', your task is to find and output all paths in the tree where the sum of the node values equals 'K'...read more
Find all paths in a binary tree where the sum of node values equals a given number 'K'.
Traverse the binary tree in a depth-first manner while keeping track of the current path and sum of node values.
When reaching a leaf node, check if the current path sum equals 'K'. If so, add the path to the result.
Continue traversal to explore all possible paths in the tree.
Return the list of paths that satisfy the condition.
Example: For input tree 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1 and...read more
Q3. Next Permutation Task
Design a function to generate the lexicographically next greater permutation of a given sequence of integers that form a permutation.
A permutation contains all integers from 1 to N exactl...read more
Design a function to generate the lexicographically next greater permutation of a given sequence of integers that form a permutation.
Understand the concept of lexicographically next permutation using algorithms like 'next_permutation' in C++ or 'permutations' in Python.
Implement a function that generates the next lexicographically greater permutation of a given sequence of integers.
Handle cases where no greater permutation exists by returning the lexicographically smallest pe...read more
Q4. Convert Sentence Problem Statement
Convert a given string 'S' into its equivalent representation based on a mobile numeric keypad sequence. Using the keypad layout shown in the reference, output the sequence of...read more
The task is to convert a given string into its equivalent representation based on a mobile numeric keypad sequence.
Iterate through each character in the input string and find its corresponding numeric representation on the keypad
Use a mapping of characters to numbers based on the keypad layout provided in the reference
Output the sequence of numbers that corresponds to typing the input string on the keypad
Q5. Two Sum Pair Finding Task
Given an array of integers ARR
of length N
and an integer Target
, your objective is to find and return all pairs of distinct elements in the array that sum up to the Target
.
Input:
int...read more
Given an array of integers and a target integer, find and return all pairs of distinct elements that sum up to the target.
Iterate through the array and for each element, check if the difference between the target and the element exists in a hash set.
If it does, add the pair to the result set. If not, add the current element to the hash set.
Ensure not to use an element at an index more than once to avoid duplicate pairs.
Q6. Trapping Rainwater Problem Statement
You are provided with an array/list named 'ARR' of size 'N'. This array represents an elevation map where 'ARR[i]' indicates the elevation of the 'ith' bar. Calculate and ou...read more
Calculate total amount of rainwater that can be trapped between bars in an elevation map.
Iterate through the array to find the maximum height on the left and right of each bar.
Calculate the amount of water that can be trapped above each bar by taking the minimum of the maximum heights on the left and right.
Sum up the trapped water above each bar to get the total trapped water for the entire elevation map.
Q7. Longest Increasing Subsequence Problem Statement
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This subse...read more
Find the length of the longest strictly increasing subsequence in an array of integers.
Use dynamic programming to solve this problem efficiently.
Initialize an array to store the length of the longest increasing subsequence ending at each index.
Iterate through the array and update the length of the longest increasing subsequence for each element.
Return the maximum value in the array as the length of the longest increasing subsequence.
Use multiple threads to print numbers from 1 to 100 in an optimized manner.
Divide the range of numbers (1-100) among the threads to avoid overlap.
Use synchronization mechanisms like mutex or semaphore to ensure orderly printing.
Consider using a thread pool to manage and reuse threads efficiently.
A process is an independent entity that contains its own memory space, while a thread is a subset of a process and shares the same memory space.
A process has its own memory space and resources, while threads share the same memory space and resources within a process.
Processes are independent of each other, while threads within the same process can communicate with each other more easily.
Processes are heavier in terms of resource consumption compared to threads.
An example of a...read more
FCFS (First-Come, First-Served) is a scheduling algorithm where tasks are executed in the order they arrive.
Tasks are processed based on their arrival time, with the first task arriving being the first to be executed.
It is a non-preemptive scheduling algorithm, meaning once a task starts, it runs to completion without interruption.
FCFS is simple to implement but may lead to longer waiting times for tasks that arrive later.
Example: A printer queue where print jobs are processe...read more
Indexing in databases is a technique used to improve the speed of data retrieval by creating a data structure that allows for quick lookups.
Indexes are created on columns in a database table to speed up the retrieval of data.
They work similar to an index in a book, allowing the database to quickly locate the rows that match a certain criteria.
Examples of indexes include primary keys, unique keys, and composite keys.
Without indexes, the database would have to scan the entire t...read more
Q12. in which tool you are using?
I am currently using Visual Studio Code as my primary tool for software development.
Visual Studio Code is a lightweight and versatile code editor.
It has a wide range of extensions and plugins available for customization.
It supports multiple programming languages and has built-in Git integration.
Other tools I have experience with include Eclipse, IntelliJ IDEA, and Sublime Text.
Q13. How to create custom serializable interface
To create a custom serializable interface, you need to define an interface with the Serializable marker interface and implement the necessary methods.
Define an interface with the Serializable marker interface
Implement the necessary methods for serialization and deserialization
Ensure all fields in the class implementing the interface are serializable
Q14. Write a program to reverse a string
Program to reverse a string using array of characters
Create an array of characters to store the input string
Iterate through the input string and store each character in the array
Iterate through the array in reverse order to construct the reversed string
Q15. what is event loop in js
Event loop in JavaScript is a mechanism that allows asynchronous non-blocking behavior by handling events and callbacks.
Event loop is responsible for handling asynchronous operations in JavaScript.
It allows JavaScript to perform non-blocking operations by queuing tasks in a loop.
Event loop continuously checks the call stack and the task queue, moving tasks from the queue to the stack when the stack is empty.
Example: setTimeout() function in JavaScript uses the event loop to e...read more
Q16. Whatis criteria in hibernate
Criteria in Hibernate is used to create and execute dynamic queries.
Criteria is an interface in Hibernate that allows the creation of dynamic queries without using HQL or SQL.
Criteria queries are type-safe and can be easily modified at runtime.
Criteria queries can be used to fetch entities based on certain conditions or restrictions.
Example: Criteria criteria = session.createCriteria(Employee.class);
Q17. Why use Hibernate?
Hibernate simplifies the process of managing database operations in Java applications.
Provides object-relational mapping (ORM) capabilities
Reduces boilerplate code for database operations
Supports various database vendors and SQL dialects
Enables transparent persistence
Facilitates easy querying and caching of data
Q18. Whats is jvm and jdk
JVM is a virtual machine that executes Java bytecode. JDK is a software development kit that includes the JVM and other tools.
JVM stands for Java Virtual Machine
JVM is responsible for executing Java bytecode
JDK stands for Java Development Kit
JDK includes the JVM, compiler, debugger, and other tools
JDK is used for developing Java applications
Q19. what is node.js
Node.js is a runtime environment that allows you to run JavaScript on the server side.
Node.js is built on Chrome's V8 JavaScript engine.
It uses an event-driven, non-blocking I/O model.
Node.js is commonly used for building scalable network applications.
Q20. Program to write palindrome
Program to check if a given string is a palindrome
Create a function that takes a string as input
Remove all non-alphanumeric characters and convert to lowercase
Compare the string with its reverse to check if it is a palindrome
Q21. Explain oops and wpf concepts
OOPs stands for Object-Oriented Programming and WPF stands for Windows Presentation Foundation.
OOPs is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
WPF is a framework for building Windows client applications with rich user interfaces.
In OOPs, concepts like inheritance, encapsulation, polymorphism, and abstraction are used to design and implement software.
WPF allows developers to create ...read more
More about working at UST




Top HR Questions asked in UST Software Engineer
Interview Process at UST Software Engineer

Top Software Engineer Interview Questions from Similar Companies







Reviews
Interviews
Salaries
Users/Month

