Given an array of n integers. Reorder the elements such that all odd numbers occur after even numbers.
Therap Software Engineer β
Interview Stages β
The selection process has 3 stages,
- Initial screening: This round is taken in written format
- 1st technical round The first round is taken by the BD team
- HR Round: This is the final stage before onboarding and typically deals with salary negotiation.
Software Engineering Questions β
Given an array of numbers indicating stock price of n consecutive days. If you buy stock at one day and sell at any later day what is the maximum profit that you can get?
Given an array of n integers. You need to take all zeroes in array to the end without changing the relative order of remaining element. eg: [2,0,0,3,1,0,5] => [2,3,1,5,0,0,0]
Given an array of strings. Print the sets of strings which are anagram. eg: ["cat","tab","act","bat","taco"] => [{"cat","act"},{"tab","bat"},{"taco"}]
Given an array of n integers. Find the kth largest element in the array.
Given two very large number in string format. Find the sum of the two number
Given two binary tree. Check if they are identical [not isomorphism]
Given two array of integers. Find the common elements between them.
Unique : π» Submit Code Repeats: π» Submit Code
Find pairs with given target sum in a doubly linked list.
Input:
1 <> 2 <> 4 <> 5 <> 6 <> 8 <> 9
target = 7
Output:
(1,6), (2,5)Solve the problem using Object Oriented Programming
int main(){
int square1width = 50;
int square2width = 80;
int rectangle1width = 30, rectangle1height = 40;
int rectangle2width = 20, rectangle2height = 40;
int square1area = square1width* square1width;
int square2area = square2width* square2width;
int rectangle1area = rectangle1height*rectangle1width;
int rectangle2area = rectangle2width* rectangle2height;
}Given an array of sides of triangles, return an array of strings. The strings would be either βyesβ or βnoβ, corresponding to whether the same indexed triangle is a right triangle or not.
Input: [[3,4,5], [5,9,12], [6,8,10]] Output: ["yes","no","yes"]
A dictionary of sorted words was like this: [a, above, bad, broke, cat,..., yes, yolk, zoo]. After a malfunction it became this: [..., yes, yolk, zoo, a, above, bad, broke, cat,....]. Write a program so that given a word, one can find the word in the dictionary, with the same time complexity as when the dictionary was sorted.
Given two strings s1, s2, return whether a substring of s1 is an anagram of s2
Input: s1 = "hello", s2 = "lol" Output: True
Input: s1 = "hello", s2 = "loa" Output: False
Given two large numbers as strings, num1 and num2 with num1 larger than num2, return their difference in string format, using no direct string to int conversion or libraries.
Given an array containing 0,1,2 sort it.
Input: [2,0,1,1,0,2] Output: [0,0,1,1,2,2]
Using no loops, print this pattern for a given number n:
n, n-5, n-10,....0,....,n-10,n-5,n. Example: 7, 2, -3, 2, 7
Design this legacy table for using in a relational database.
| ID | Name | Subject | Courses | |
|---|---|---|---|---|
| 1 | Rahim | rahim@gmail.com | CSE | CSE101, CSE102, EEE101, CIVIL104 |
| 2 | karim | karim@gmail.com | EEE | EEE101, EEE102, CSE102, CIVIL104 |
| 3 | Josim | josim@gmail.com | BME | EEE101, CSE101, BME101 |
| 4 | Belal | belal@gmail.com | CIVIL | CIVIL101, CIVIL102, MECHA101, EEE101 |
| 5 | Rakib | rakib@gmail.com | MECHA | CSE101, BME101, MECHA101, MECHA101 |