UiPath Coding Questions
Coding Questions in UiPath
Questions and answers on UiPath Coding Test are part of a computer-based online recruitment test called UiPath Test Coding Questions.
We would like to give you some information about how to attempt the test before you start the procedure. Please note that the material on this page only refers to the campus hiring procedure. Activities that take place on or off campus may vary from one region to another.
About UiPath Company
UiPath harness automation’s transformational power to unleash people’s limitless potential and fuel lucrative business growth.
With an unmatched time to value, the AI-powered UiPath Business Automation Platform combines outstanding robotic process automation (RPA) with a broad range of capabilities to comprehend, automate, and manage end-to-end processes.
UiPath is The Basis of InnovationTM for businesses looking to prosper and expand in constantly shifting environments.
UiPath Company Eligibility Criteria
UiPath is looking to hire Associate RPA Developer roles in Bangalore & Chennai location.
Intuit Company | Software Developer |
---|---|
Batch | 2023 |
Course | CS, IT & MCA |
Role | Associate RPA Developer |
Education |
|
CTC |
|
Location | Chennai/ Banglore |
Type of Employment | FTE |
UiPath Company Selection Criteria
- Round 1 – Online Coding Assessment
- Round 2 – Technical interview
- Round 3 – Managerial/Leadership Round
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
UiPath Coding Test Questions
Question 1 : Key Logger
Problem statement-: Elliot made a KeyLogger for his friend Romero, so that he can see the passwords of his friend. Keylogger is a software that can tell you the buttons pressed in the keyboard without the consent of the user, and hence unethical. Elliot made it to hack Romero’s passwords. The one problem is, Romero writes the passwords in lowercase characters only, and the keylogger only takes the values of the keys. Like, for a it takes 1, for b 2, and for z 26. For a given number Elliot produces all combinations of passwords in a dictionary and starts a dictionary based password attack. For a given number, print all the possible passwords in a lexicographic order.
Input Format:
- One line, denoting the value given by the keylogger
Output Format:
- All possible combinations of keyloggers in new lines are lexicographically ordered.
Constraints:
- 2<=Number of digit in input<=1000
Sample Input:
1234
Sample Output:
abcd
awd
lcd
Explanation:
For 12, you can take 1,2 that is ab, or you can take l.
#include<bits/stdc++.h> using namespace std; string ss; vector v; void fun(int i, string s) { //cout<ss.length()) return; if(ss[i]=='0') return; char c='a'+(ss[i]-'1'); fun(i+1,s+c); if(i!=s.length()-1) if( ss[i]<'3' && ss[i+1]<'7') { int a=(ss[i]-'1'+1),b=(ss[i+1]-'0'); c=('a'+(10*a+b-1)); //cout<>ss; fun(0,""); sort(v.begin(),v.end()); for(auto i:v) cout<< i<< endl; }
import java.util.*; class Solution { static String str; static ArrayList < String > list = new ArrayList < String > (); public static void func (int i, String res) { if (i == str.length ()) { list.add (res); return; } if (i > str.length ()) return; if(str.charAt (i) == '0') return; char ch = (char) ('a' + (str.charAt (i) - '1')); func (i + 1, res + ch); if (i != str.length () - 1) if (str.charAt (i) < '3' && str.charAt (i + 1) < '7') { int a = (str.charAt (i) - '1' + 1), b = (str.charAt (i + 1) - '0'); ch = (char) ('a' + (10 * a + b - 1)); func (i + 2, res + ch); } } public static void main (String[]args) { Scanner sc = new Scanner (System.in); str = sc.next (); String res = ""; func (0, res); Collections.sort (list); for (int i = 0; i < list.size (); i++) System.out.println (list.get (i)); } }
Question 2: Max Value
Problem Statement- Ramesh went to a bookshop to buy books. There is a list of books with their value and price. Now Ramesh has limited money but he wants maximum value possible. Now there are 2 kinds of books, one is denoted with 1, that is independent, another one is denoted as 2, which you have to buy in double, that means you can not buy a single or odd number of those books.
Print the maximum value Ramesh can extract from the books.
Input Format:
- First line contains two integers, n (Number of books) and T, total money he has.
- Then n lines, 4 variables in each line,
- The serial number of the book
- The value of the book
- The price of the book
- The marking (1 or 2)
Output Format:
- Maximum value possible to be bought.
Constraints:
- Number of books: <=100
- Maximum Money with Ramesh <=1000
- Max price of a book<=1000
Sample Input:
5 20
1 3 7 0
3 9 10 1
2 4 3 1
7 3 2 0
22 7 7 0
Sample Output:
20
Explanation:
It will be the 1st book,2nd and the third book
#include<bits/stdc++.h> using namespace std; int n,w; int *a,*b,*c; int fun(int i,int cb,int t,int ww) { if(i==n){ if(cb&1) return 0; else return t; } if(ww+b[i]<=w) return max(fun(i+1,cb+c[i],t+a[i],ww+b[i]),fun(i+1,cb,t,ww)); return fun(i+1,cb,t,ww); } int main() { cin>>n>>w; int tt; a=new int(n); b=new int(n); c=new int(n); for(int i=0;i>tt>>a[i]>>b[i]>>c[i]; cout<< fun(0,0,0,0); }
import java.util.*; class Solution { static int n, w; static int a[]; static int b[]; static int c[]; public static int func (int i, int cb, int t, int ww) { if (i == n) { if ((cb & 1) != 0) return 0; else return t; } if (ww + b[i] <= w) return Math.max (func (i + 1, cb + c[i], t + a[i], ww + b[i]),func (i + 1, cb, t, ww)); return func (i + 1, cb, t, ww); } public static void main (String[]args) { Scanner sc = new Scanner (System.in); n = sc.nextInt (); w = sc.nextInt (); int t; a = new int[n]; b = new int[n]; c = new int[n]; for (int i = 0; i < n; i++){ t = sc.nextInt (); a[i] = sc.nextInt (); b[i] = sc.nextInt (); c[i] = sc.nextInt (); } System.out.println (func (0, 0, 0, 0)); } }
Question 3 : Maximize Earnings
Problem Statement- A taxi can take multiple passengers to the railway station at the same time.On the way back to the starting point,the taxi driver may pick up additional passengers for his next trip to the airport.A map of passenger location has been created,represented as a square matrix.
The Matrix is filled with cells,and each cell will have an initial value as follows:
- A value greater than or equal to zero represents a path.
- A value equal to 1 represents a passenger.
- A value equal to -1 represents an obstruction.
The rules of motion of taxi are as follows:
- The Taxi driver starts at (0,0) and the railway station is at (n-1,n-1).Movement towards the railway station is right or down,through valid path cells.
- After reaching (n-1,n-1) the taxi driver travels back to (0,0) by travelling left or up through valid path cells.
- When passing through a path cell containing a passenger,the passenger is picked up.once the rider is picked up the cell becomes an empty path cell.
- If there is no valid path between (0,0) and (n-1,n-1),then no passenger can be picked.
- The goal is to collect as many passengers as possible so that the driver can maximize his earnings.
Sample Input 0
4
4
0 0 0 1
1 0 0 0
0 0 0 0
0 0 0 0
Sample Output 0
2
Explanation 0
The driver can contain a maximum of 2 passengers by taking the following path (0,0) → (0,1) → (0,2) → (0,3) → (1,3) → (2,3) → (3,3) → (3,2) → (3,1) → (3,0) → (2,0) → (1,0) → (0,0)
Sample Input 1
3
3
0 1 -1
1 0 -1
1 1 1
Sample Output 1
5
Explanation 1
The driver can contain a maximum of 5 passengers by taking the following path (0,0) → (0,1) → (1,1) → (2,1) → (2,2) → (2,1) → (2,0) → (1,0) → (0,0)
#include<bits/stdc++.h> using namespace std; int n, m; int mat[105][105]; map>, int> dp; bool isValid(int i, int j) { if (mat[i][j] == -1) return false; if (i < 0 || i >= n) return false; if (j < 0 || j >= m) return false; return true; } int solve(int i, int j, int x, int y) { if (!isValid(i, j)) { return INT_MIN; } if (!isValid(x, y)) { return INT_MIN; } if (i == n - 1 && x == n - 1 && j == m - 1 && y == m - 1) { if (mat[i][j] == 1) { return 1; } else { return 0; } } if (dp.find({i, {j, x}}) != dp.end()) return dp[{i, {j, x}}]; int cur = 0; if (i == x && j == y) { if (mat[i][j] == 1) cur = 1; } else { if (mat[i][j] == 1) cur++; if (mat[x][y] == 1) cur++; } int op1 = solve(i + 1, j, x + 1, y); int op2 = solve(i, j + 1, x, y + 1); int op3 = solve(i + 1, j, x, y + 1); int op4 = solve(i, j + 1, x + 1, y); int ans = cur + max(op1, max(op2, max(op3, op4))); return dp[{i, {j, x}}] = ans; } int main() { cin >> n >> m; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> mat[i][j]; int ans = solve(0, 0, 0, 0); if (ans >= 0) cout << solve(0, 0, 0, 0) << endl; else cout << -1 << endl; return 0; }
import java.util.*; class Solution { public static int cost (int grid[][], int row1, int col1, int row2, int col2) { if (row1 == row2 && col1 == col2) { if (grid[row1][col1] == 1) return 1; return 0; } int ans = 0; if (grid[row1][col1] == 1) ans++; if (grid[row2][col2] == 1) ans++; return ans; } public static int solve (int n, int m, int grid[][], int dp[][][], int row1,int col1, int row2) { int col2 = (row1 + col1) - (row2); if (row1 == n - 1 && col1 == m - 1 && row2 == n - 1 && col2 == m - 1) return 0; if (row1 >= n || col1 >= m || row2 >= n || col2 >= m) return -1 * Integer.MAX_VALUE; if (dp[row1][col1][row2] != -1) return dp[row1][col1][row2]; int ch1 = -1 * Integer.MAX_VALUE, ch2 = -1 * Integer.MAX_VALUE; int ch3 = -1 * Integer.MAX_VALUE, ch4 = -1 * Integer.MAX_VALUE; if (grid[row1][col1 + 1] != -1 && grid[row2 + 1][col2] != -1) ch1 = cost (grid, row1, col1 + 1, row2 + 1, col2) + solve (n, m, grid, dp,row1, col1 + 1,row2 + 1); if (grid[row1][col1 + 1] != -1 && grid[row2][col2 + 1] != -1) ch2 = cost (grid, row1, col1 + 1, row2, col2 + 1) + solve (n, m, grid, dp, row1, col1 + 1, row2); if (grid[row1 + 1][col1] != -1 && grid[row2][col2 + 1] != -1) ch3 = cost (grid, row1 + 1, col1, row2, col2 + 1) + solve (n, m, grid, dp, row1 + 1, col1, row2); if (grid[row1 + 1][col1] != -1 && grid[row2 + 1][col2] != -1) ch4 = cost (grid, row1 + 1, col1, row2 + 1, col2) + solve (n, m, grid, dp, row1 + 1, col1, row2 + 1); return dp[row1][col1][row2] = Math.max (ch1, Math.max (ch2, Math.max (ch3, ch4))); } public static void initializeDp (int dp[][][], int item) { for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) for (int k = 0; k < 5; k++) dp[i][j][k] = item; } } public static int collectMax (int n, int m, int grid[][]) { int ans = 0; int dp[][][] = new int[6][6][6]; initializeDp (dp, -1); if (grid[n - 1][m - 1] == -1 || grid[0][0] == -1) ans = -1 * Integer.MAX_VALUE; if (grid[0][0] == 1) ans++; grid[0][0] = 0; if (grid[n - 1][m - 1] == 1) ans++; grid[n - 1][m - 1] = 0; ans += solve (n, m, grid, dp, 0, 0, 0); return Math.max (ans, 0); } public static void main (String[]args) { Scanner sc = new Scanner (System.in); int n = sc.nextInt (); int m = sc.nextInt (); int arr[][] = new int[n + 1][m + 1]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) arr[i][j] = sc.nextInt (); System.out.println (collectMax (n, m, arr)); } }
Question 4 : Stocks
Problem Statement – Ratan is a crazy rich person. And he is blessed with luck, so he always made the best profit possible with the shares he bought. That means he bought a share at a low price and sold it at a high price to maximize his profit. Now you are an income tax officer and you need to calculate the profit he made with the given values of stock prices each day. You have to calculate only the maximum profit Ratan earned.
Note that:
- Ratan never goes into loss.
Example 1
- Price=[1,6,2]
- Ratan buys it on the first day and sells it on the second.
Example 2
- Price=[9,8,6]
The Price always went down, Ratan never bought it.
Input Format:
- First line with an integer n, denoting the number days with the value of the stack
- Next n days, telling the price of the stock on that very day.
Output Format:
- Maximum profit done by Ratan in a single line.
Constraints:
- Number of days <=10^8
Sample Input for Custom Testing
STDIN
———–
7
1
9
2
11
1
9
2
Sample Output
10
Explanation
The maximum profit possible is when Ratan buys it in 1 rupees and sells it in 11.
#include<bits/stdc++.h> using namespace std; int solve (vector < int >v) { int n = v.size (); if (n == 0) return 0; int mx = v[0]; for (int i = 1; i < n; i++) mx = max (mx, v[i]); if (mx <= 0) return 0; int mxSum = 0; int cSum = 0; for (int i = 0; i < n; i++) { cSum += v[i]; if (cSum < 0) cSum = 0; mxSum = max (mxSum, cSum); } return mxSum; } int main () { int n; cin >> n; int price[n]; for (int i = 0; i < n; i++) cin >> price[i]; vector < int >diff; for (int i = n - 2; i >= 0; i--) diff.push_back (price[i + 1] - price[i]); int ans = solve (diff); if (ans < 0) cout << 0 << endl; else cout << ans << endl; }
import java.util.*; public class PrepInsta { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int price[] = new int[n]; for (int i = 0; i < n; i++) { price[i] = sc.nextInt(); } Vector < Integer > diff = new Vector < > (); for (int i = n - 2; i >= 0; i--) { diff.add(price[i + 1] - price[i]); } int ans = solve(diff); if (ans < 0) { System.out.println(0); } else { System.out.println(ans); } } private static int solve(Vector < Integer > v) { int n = v.size(); if (n == 0) { return 0; } int mx = v.get(0); for (int i = 1; i < n; i++) { mx = Math.max(mx, v.get(i)); } if (mx <= 0) { return 0; } int mxSum = 0, csum = 0; for (int i = 0; i < n; i++) { csum += v.get(i); if (csum < 0) csum = 0; mxSum = Math.max(csum, mxSum); } return mxSum; } }
def func(diff): n=len(diff) if n==0: return 0 mx=max(diff) if mx<=0: return 0 mxS=0 cS=0 for i in diff: cS+=i if cS<=0: cS=0 mxS=max(cS,mxS) return mxS n=int(input()) arr=[] diff=[] ans=[0] for i in range(n): arr.append(int(input())) for i in range(n-1): diff.append(arr[i+1]-arr[i]) ans=func(diff) if ans<0: print("0") else: print(ans)
Question 5 : powerful Character
Problem Statement – Codu is given a string and he thinks the letters that are repeated do have more power. He gathers only the repeating characters and keeps them as the most powerful to least powerful manner. Now it is your turn to write a code that will help Codu to do that.
Note that: only lowercase alphabets are accepted in input.
Input Format:
- A string in a single line
Output Format:
- A string made of only the repeated characters as sorted their frequency reducin, if the same the lower ascii value comes before.
Constraints:
- Length of string<=10^5
Sample Input:
abcdefghaabca
Sample Output:
abc
#include<bits/stdc++.h> using namespace std; map< char, int >m; string ss; bool cmp (pair < char, int >&a, pair < char, int >&b) { return a.second > b.second; } void sort (map < char, int >&M) { vector < pair < char, int >>A; for (auto & it:M) A.push_back (it); sort (A.begin (), A.end (), cmp); for (auto & it:A) ss += it.first; } int main () { string s; getline (cin, s); for (auto i:s) m[i]++; sort (m); for (auto i:ss) if (m[i] > 1) cout << i; }
import java.util.*; public class StringReduction { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); TreeSet < Character > list = new TreeSet < Character > (); for (int i = 0; i + 1 < str.length(); i++) { String prefix = str.substring(0, i); String suffix = str.substring(i + 1, str.length()); char ch = str.charAt(i); if (prefix.indexOf(ch) != -1 || suffix.indexOf(ch) != -1) list.add(ch); } if (str.substring(0, str.length() - 1).indexOf(str.charAt(str.length() - 1)) != -1) list.add(str.charAt(str.length() - 1)); Iterator itr = list.iterator(); while (itr.hasNext()) { System.out.print((Character) itr.next()); } } }
FAQs on UiPath Coding Test
Question 1: Does the UiPath recruitment process includes coding test?
Yes, in Online Assessments and Technical Assessments coding questions are asked in UiPath Recruitment Process.
Question 2: What is the recruitment process of UiPath ?
UiPath includes Coding Assessments, Technical Interviews and Managerial/Leadership Round for testing the capability of the applicants.
Question 3: How long does the recruitment process take at UiPath?
The duration of the recruitment process at UiPath can vary depending on the role, the number of applicants, and other factors. Typically, it may take anywhere from a few days to several weeks.
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment