CodeScript
347 subscribers
3 photos
2 files
127 links
Hi guys ,

Welcome to this channel.

The whole motive of this channel is to learn and grow together.

Please maintain the decorum of the group 😊

Email at : info.codescript@gmail.com (Promotion/Business purpose )
Download Telegram
CodeScript pinned «Hello»
Channel photo updated
List of questions which were asked during the online test
1. Optimizing Alexa Suggestions
Problem Statement:

Amazon’s Alexa team is working on optimizing the customer experience for scenarios where customers ask generic questions. One example of a generic question is “What are good vegetarian restaurants nearby?” In this example, Alexa would then search for a list of vegetarian restaurants in the city and select the nearest X vegetarian restaurants relative to the customer’s location. Given an array representing the locations of N vegetarian restaurants in the city, implement an algorithm to find nearest X vegetarian restaurants to the customer’s location.



Input:

The input to the function/method consists of two arguments:
allLocations, a list of elements where each element consists of a pair of integers representing the x and y coordinates of the vegetarian restaurant in the city;

numRestaurents, an integer representing the number of nearby vegetarian restaurants that would be returned to the customer(X)

Output:

Return a list of elements where each element of the list represent recommended vegetarian restaurant relative to customer’s location.

Constraints:
numRestaurents<=size(allLocations)

Notes:
The Customer begins at the location [0,0].
The returned output can be any order.

Example
Input:
allLocations=[[1,2][3,4][1,-1]]
numRestaurents=2
output:
[[1,-1][1,2]]


2. Order Delivery Route
Problem Statement:

Amazon Fresh is a grocery delivery service that offers consumers the option of purchasing their groceries online and having them delivered on schedule. The Amazon Fresh tram is planning a route for a delivery truck to deliver customer orders in the city of TechIandia. The planner will create a delivery area for each order to effectively plan the route. The area is abstracted as a grid. Not all location locations are accessible by road. The truck only needs to make a single delivery.

Write an s]algorithm to determine the minimum distance required for the truck to deliver the order.

Assumptions:

Some places in the delivery area cannot be accessed by the driver, as there are no roads in those locations.
The delivery area can be represented as a two-dimensional grid of integers, where each integer represents one cell.
The truck must start from the top-left corner of the area which is always accessible and move on cell up, down, left, or right at a time.
The truck must navigate around the areas without roads and cannot leave the area.
The accessible area is represented as 1, areas without roads are represented by o and the order destination is represented by 0 and the order destination is represented by 9.
Input:



The input to the function /method consists of one argument:
area, representing the two-dimensional grid of integers.

Output

Return an integer representing the total distance traversed to deliver the order else return-1

Constraints

1<= rows, columns<=103

Example

Input:
area=
[[1,0,0],
[1,0,0],
[1,9,1]]

Output:
3
Solution 1:

def kClosest(locations,k):
def sqr_dist(location):
return location[0]*location[0]+location[1]*location[1]
locations.sort(key=sqr_dist)
return locations[:k]
alllocations=[[1,2][3,4][1,-1]]
numRestaurents=2
print(kClosest(alllocations,numRestaurents))
Solution 2:
def minDistance(grid, cur, col):
if grid[cur]==9:
return 0

rInt=cur+1
dInt=cur+col

if rInt<len(grid) and dInt<len(grid) and grid[rInt]>0 and grid[dInt]>0:
return 1+min(minDistance(grid, rInt, col), minDistance(grid, dInt, col))

elif rInt<len(grid) and grid[rInt]>0:
return 1+minDistance(grid, rInt, col)

elif dInt<len(grid) and grid[dInt]>0:
return 1+minDistance(grid, dInt, col)

else:
return len(grid)

def findShortedtPath(grid):
liPath=[]
rows = len(grid)
columns = len(grid[0])
for i in grid:
liPath.extend(i)

val=minDistance(liPath, 0, columns)

if val<=len(liPath):
return val
else:
return -1

area = [[1,0,0],[1,0,0],[1,9,1]]
print(findShortedtPath(area))
TechMahindra Off-Campus Drive | BE MCA | 2020 & 2021 Batch

http://registration.techmahindra.com/Candidate/Instructions.aspx
Z Code hiring 2021 freshers
Position: Software Engineer Trainee
CTC: Rs. 6,60,000 Per Annum
Last Date: 27-08-2021
Eligibility: BE/B.Tech, MCA, ME/M.Tech, Any Graduate
YOP: 2021
Apply Here: https://nboard.in/s/J21018Y.html
Capgemini Recruitment Drive 2021 batch Engineering / MCA freshers

Registration link
:
https://www.capgemini.com/in-en/careers/pooled-campus-recruitment-drive-for-engineering-and-mca/

Last date to Register: Sep 1, 2021.
Assessments will get scheduled starting from the 2nd week of Sep 2021

Eligibility Criteria:
1) Should be graduating in 2021 / graduated in 2021
2) Should have 60% and above in Diploma, Graduation (aggregate of 7 semesters), and MCA (aggregate of 5 semesters)/ ME / MTech
3) No Percentage criteria for SSC and HSC scores
4) Qualification – MCA, BE / BTech (open for all branches for both BE and BTech)
5) ME / MTech students must be only from Information Technology, Information Science, and Computer Science
6) Must possess excellent English written/spoken communication skills
7) Must be open to relocate to any Capgemini location, work across technology, domain, role, and should be ready to work in shifts if required.
8) Should be open to signing a Service Level Agreement bond
9) Candidates should not have more than 1 year of gap between academic milestone stages; the academic milestone stages considered are 10th & 12th standard, and Post-Graduation.
- Candidates should not have any gap within an academic milestone; the milestone academic stages considered are Xth, XIIth, Diploma, Degree, and Post-Graduation e.g. taking 5 years Vs 4 years to complete BE/BTech
- Candidates who have taken Degree after Diploma should not have any gaps between Diploma and Degree
In case a candidate has appeared for XII more than once, the candidature will be considered provided both the mark sheets are available with an academic score of 50% or more in both attempts
10) Candidates should not have any backlog at the time of appearing for the process
11) Only shortlisted candidates will be invited for the test assessment/selection process
12) The entire selection process from test to interview will be done in virtual mode
13) Candidates will be responsible for arranging the required infrastructure for appearing for the selection process which will be conducted online.
Elite National Talent Hunt 2022 (NTH) is our fresher’s hiring program to attract the best of 2022 engineering graduates across the country. We’re enabling equal employment opportunities for India’s deserving engineering talent and are looking for you! Are you an enthusiastic engineering student? Don’t miss this opportunity to start your exciting journey with Wipro. Register today!
Registrations starts: 23rd August’21
Registration ends: 15th September’21
Online assessment: 25th September’21- 27th September’21.

https://careers.wipro.com/elite