Unthinkable Solutions Coding Questions
Coding Questions asked in Unthinkable Daffodil
Unthinkable Solutions Coding Questions is one of the most searched question at the time of placement drive. The company is also known as Unthinkable Daffodil. Therefore, this page will give you complete information about the placement drive conducted by Unthinkable Solutions or Unthinkable Daffodil.
Go through this page thoroughly to know more about Unthinkable Solutions for example eligibility, salary, online assessment etc.
About Unthinkable Daffodil
Unthinkable Solutions is seeking individuals who are enthusiastic about creating high-quality software products. At Unthinkable, they shorten the time between a concept and usable software in order to help our customers disrupt more quickly.
They are in a unique position to take this unconventional approach to software development because to the combination of our experience creating more than 100 software solutions and creating products employing decoupled software components to remove unnecessary code.
Unthinkable Daffodil Recruitment Process
Here is the detailed recruitment process of Unthinkable Daffodil.
- Online Assessment – 3 Coding Questions
- Technical Interview 1 -(Concepts related to fundamentals and OOPs Concept)
- Technical Interview 2 – (Puzzles and Coding)
- HR Interview
Skills Required
- Basic Programming Skills with good logical concepts.
- Any Language (Students need to be strong with their logical and problem solving skills)
Unthinkable Daffodil Important Facts
Unthinkable : Daffodils | Related Information |
---|---|
Batch | 2023 |
Course | B.Tech |
Education |
|
Service Agreement | Internship + 1yr of permanent employment |
Cost to Company (CTC) | 5 LPA |
Stipend during Internship | 20,000 /- or 24,000 /- |
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Unthinkable Solutions Coding Questions
Question 1 : Spiral Matrix
Problem Statement :
You will be given a 2d matrix. Write the code to traverse the matrix in a spiral format. Check the input and output for better understanding.
Sample Input :
Input :
5 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
Output :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <bits/stdc++.h> using namespace std; void Spiral(vector < vector < int >> a) { if (a.size() == 0) return; int m = a.size(), n = a[0].size(); int i, k = 0, l = 0; while (k < m && l < n) { for (i = l; i < n; ++i) cout << a[k][i] << " "; k++; for (i = k; i < m; ++i) cout << a[i][n - 1] << " "; n--; if (k < m) { for (i = n - 1; i >= l; --i) cout << a[m - 1][i] << " "; m--; } if (l < n) { for (i = m - 1; i >= k; --i) cout << a[i][l] << " "; l++; } } } int main() { int r, c; cin >> r >> c; vector < vector < int >> mat(r, vector < int > (c)); for (int i = 0; i < r; i++) for (int j = 0; j < c; j++) cin >> mat[i][j]; Spiral(mat); }
import java.util.*; public class Main { public static List < Integer > solve(int [][]matrix,int row,int col) { List < Integer > res=new ArrayList < Integer > (); boolean[][] temp=new boolean[row][col]; int []arr1={0,1,0,-1}; int []arr2={1,0,-1,0}; int di=0,r=0,c=0; for(int i=0;i < row*col; i++) { res.add(matrix[r][c]); temp[r][c]=true; int count1=r+arr1[di]; int count2=c+arr2[di]; if(count1 >= 0 && row > count1 && count2 >= 0 && col > count2 && !temp[count1][count2]){ r=count1; c=count2; } else { di=(di+1)%4; r+=arr1[di]; c+=arr2[di]; } } return res; } public static void main(String[] args) { Scanner sc=new Scanner(System.in); int m=sc.nextInt(); int n=sc.nextInt(); int matrix[][]=new int[m][n]; for(int i=0;i < m;i++) { for(int j=0;j < n;j++) matrix[i][j]=sc.nextInt(); } System.out.println(solve(matrix,m,n)); } }
def spiralOrder(arr): ans = [] while arr: ans += arr.pop(0) arr = (list(zip(*arr)))[::-1] return ans arr = [] n, m = map(int, input().split()) for i in range(n): arr.append(list(map(int, input().split()))) print(*spiralOrder(arr))
Question 2 : Celsius to Fahrenheit
Problem Statement :
There are two major scales for measuring temperature, celsius & Fahrenheit.Given a floating point input for temperature in celsius scale, Write a program to convert celsius to fahrenheit, up till 2 decimal points.
Input Output
56 132.8
Explanation:
56 degrees celsius means132.8 degrees of Fahrenheit to be exact.
#includeusing namespace std; int main() { float temperature; cin >> temperature; cout << (temperature * 9) / 5 + 32; return 0; }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); float n = sc.nextFloat(); float ans = ((n * 9.0 f / 5.0 f) + 32.0 f); System.out.println(ans); } }
def ctof(c): return (c * 9) / 5 + 32 temperature = float(input()) ans = ctof(temperature) print(round(ans, 2))
Question 3 : Devil Groups (R->Easy)
Problem Statement :
There are some groups of devils and they splitted into people to kill them. Devils make People to them left as their group and at last the group with maximum length will be killed. Two types of devils are there namely “@” and “$”
People is represented as a string “P”
Input Format:
First line with the string for input
Output Format:
Number of groups that can be formed.
Constraints:
2<=Length of string<=10^9
Input string
PPPPPP@PPP@PP$PP
Output
7
Explanation
4 groups can be formed
PPPPPP@
PPP@
PP$
PP
Most people in the group lie in group 1 with 7 members.
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int a=0,mx=0; for(int i=0;i < s.length();i++) { a++; if(s[i]=='@'||s[i]=='$') {mx=max(a,mx);a=0;} } cout<< mx; }
import java.util.*; class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String str=sc.next(); str=str.replace("@"," "); str=str.replace("$"," "); String arr[]=str.split(" "); int max=0; for(int i=0;i < arr.length;i++) max=Math.max(max,arr[i].length()); System.out.println(max+1); } }
s=input() s=s.replace("@"," ").replace("$"," ") s=s.split() ans=[] for i in s: ans.append(len(i)+1) ans[-1]-=1 print(max(ans))
Question 4 : Prime Number Sum
Problem Statement :
You will be given a left limit and a right limit. You need to Calculate the sum of all prime numbers between a given range x and y, both inclusive.
Sample Test Case :
Input : Output :
30 68
40
Explanation :
31 and 37 are the two prime numbers in the window.
#include <bits/stdc++.h> using namespace std; unordered_map < int, bool > prime; void SieveOfEratosthenes(int n) { for (int i = 0; i < n; i++) prime[i] = 1; for (int p = 2; p * p <= n; p++) if (prime[p] == true) for (int i = p * p; i <= n; i += p) prime[i] = false; } int main() { int n, m; int count = 0, sum = 0; cin >> n >> m; SieveOfEratosthenes(m + 1); for (int i = n; i <= m; i++) if (prime[i]) sum += i; cout << sum; }
import java.util.*; public class Main { public static boolean isPrime(int no) { if (no <= 1) return false; if (no <= 3) return true; if (no % 2 == 0 || no % 3 == 0) return false; for (int i = 5; i * i <= no; i = i + 6) { if (no % i == 0 || no % (i + 2) == 0) return false; } return true; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int sum = 0; for (int i = x; i <= y; i++) if (isPrime(i)) sum = sum + i; System.out.println(sum); } }
def isPrime(n): if n <= 1: return False for i in range(2, int(n**0.5) + 1): if n % i == 0: return False return True a = int(input()) b = int(input()) x = 0 if a > 2 else 2 step = 1 if (a % 2 == 0) else 0 for i in range(a + step, b + 1, 2): if isPrime(i): x = x + i print(x)
Question 5 : Array Subarray
Problem Statement :
You are given an array, You have to choose a contiguous subarray of length ‘k’, and find the minimum of that segment, return the maximum of those minimums.
Sample input :
1 → Length of segment x =1
5 → size of space n = 5
1 → space = [ 1,2,3,1,2]
2
3
1
2
Sample output :
3
Explanation :
The subarrays of size x = 1 are [1],[2],[3],[1], and [2],Because each subarray only contains 1 element, each value is minimal with respect to the subarray it is in. The maximum of these values is 3. Therefore, the answer is 3
#include <bits/stdc++.h> using namespace std; vector < int > arr; int prevmin=-1; int flag=0; int x,n,q; int sorting(int start,int end) { if(start+1==n) {start=0;end=end-n;} if(start==end) return arr[start]; return min(arr[start],sorting(start+1,end)); } int func(int start,int end) { if(flag==0) {flag++;return prevmin=sorting(start,end);} if(arr[start-1]==prevmin) return prevmin; return prevmin=(arr[end] <= prevmin)?prevmin:sorting(start,end); } int main() { cin >> x >> n; int ans=0; for(int i=0;i < n;i++) {cin >> q;arr.push_back(q);} for(int i=0;i < n;i++) { ans=max(ans,func(i,i+x-1)); } cout << ans; }
import java.util.*; public class DiskSpace { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int x=sc.nextInt(); int n=sc.nextInt(); int arr[]=new int[n]; for(int i=0;i < n;i++) arr[i]=sc.nextInt(); int min=Integer.MAX_VALUE; int max=Integer.MIN_VALUE; for(int i=0;i <= n-x;i++) { min=Integer.MAX_VALUE; for(int j=i;j < (i+x);j++) min=Math.min(min,arr[j]); max=Math.max(min,max); } System.out.println(max); } }
n=int(input()) arr=[] for i in range(n): arr.append(int(input())) s,a=0,0 for i in arr: s=s+i if(s < 1): a=a+(-1*s) s=0 print(a)
FAQs related to Unthinkable Coding Questions
Question 1: How many rounds are there in the Unthinkable Hiring Process?
There are in total four rounds in the Infra Market Hiring Process which includes:-
- Online Assessment
- Technical Interview 1
- Technical Interview 2
- HR Interview
Question 2: Is Coding questions asked in Unthinkable Recruitment Process?
Yes, Coding Questions are included in Online Assessment and Technical Interview of Unthinkable.
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