0% found this document useful (0 votes)
11 views3 pages

Python Test Submission Instructions

The document outlines a Python test for internship candidates, requiring submission of an ipynb notebook and a PDF file by August 27, 2023. It includes four questions focused on data manipulation, such as creating a student marks dashboard, filling missing values in a string, finding common words between sentences, and counting iterations to rearrange a list. Candidates must email their submissions with a specified subject line to a given address.

Uploaded by

Shilpa Wankhade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Python Test Submission Instructions

The document outlines a Python test for internship candidates, requiring submission of an ipynb notebook and a PDF file by August 27, 2023. It includes four questions focused on data manipulation, such as creating a student marks dashboard, filling missing values in a string, finding common words between sentences, and counting iterations to rearrange a list. Candidates must email their submissions with a specified subject line to a given address.

Uploaded by

Shilpa Wankhade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Test

Submission Date: 27th August, 2023 (E.O.D)


File Format: Attach two files – ipynb notebook & PDF of python file.
Email: Share both files to an email address - [Link]@[Link]
The subject of Email – “Python Test – Internship – Name of Candidate “

Q1: Students marks dashboard consider the marks list of class students given two lists

Students =
['student1','student2','student3','student4','student5','student6','student7','student8','student9
','student10']

Marks = [45, 78, 12, 14, 48, 43, 45, 98, 35, 80]

From the above two lists the Student [0] got Marks [0], Student [1] got Marks [1] and so on.

Your task is to print the name of students


a. Who got top 5 ranks, in the descending order of marks?
b. Who got least 5 ranks, in the increasing order of marks?
c. Who got marks between >25th percentile <75th percentile, in the increasing order of
marks?

Ex 1:
Students=['student1','student2','student3','student4','student5','student6','student7','student8'
,'student9','student10']
Marks = [45, 78, 12, 14, 48, 43, 47, 98, 35, 80]
a.
student8 98
student10 80
student2 78
student5 48
student7 47
b.
student3 12
student4 14
student9 35
student6 43
student1 45
c.
student9 35
student6 43
student1 45
student7 47
student5 48

Q2: Filling the missing values in the specified format you will be given a string with digits and
'\_'(missing value) symbols you have to replace the '\_' symbols as explained

Ex 1: _, _, _, 24 ==> 24/4, 24/4, 24/4, 24/4 i.e. we have distributed the 24 equally to all 4 places

Ex 2: 40, _, _, _, 60 ==>(60+40)/5,(60+40)/5,(60+40)/5,(60+40)/5,(60+40)/5 ==> 20, 20, 20, 20,


20 i.e. the sum of (60+40) is distributed equally to all 5 places

Ex 3: 80, _, _, _, _ ==> 80/5, 80/5,80/5,80/5,80/5 ==> 16, 16, 16, 16, 16 i.e. the 80 is distributed
equally to all 5 missing values that are right to it

Ex 4: _, _, 30, _, _, _, 50, _, _
We will fill the missing values from left to right
a. First we will distribute the 30 to left two missing values (10, 10, 10, _, _, _, 50, _, _)

b. now distribute the sum (10+50) missing values in between (10, 10, 12, 12, 12, 12, 12, _,
_)

c. now we will distribute 12 to right side missing values (10, 10, 12, 12, 12, 12, 4, 4, 4)

For a given string with comma separate values, which will have both missing values numbers
like ex: "_, _, x, _, _, _" you need fill the missing values

Q: your program reads a string like ex: "_, _, x, _, _, _" and returns the filled sequence
Ex:
Input1: "_,_,_,24"
Output1: 6,6,6,6

Input2: "40,_,_,_,60"
Output2: 20, 20, 20, 20, 20

Input3: "80,_,_,_,_"
Output3: 16, 16, 16, 16, 16

Input4: "_,_,30,_,_,_,50,_,_"
Output4: 10, 10, 12, 12, 12, 12, 4, 4, 4
Q3: Given two sentences S1, S2 you will be given two sentences S1, S2 your task is to find
a. Number of common words between S1, S2
b. Words in S1 but not in S2
c. Words in S2 but not in S1

Ex:
S1= "the first column F will contain only 5 unique values"
S2= "the second column S will contain only 3 unique values"

Output:
a. 7
b. ['first','F','5']
c. ['second','S','3']

Q4: Write a python program to print the total number of iteration required to place minimum
value at the utmost left and maximum value at the utmost right of a list.

Input: list = [3, 2, 4, 5, 5, 3, 1]


Output list = [1, 3, 2, 4, 5, 3, 5]
Output: Number of Total iteration = 7

Explanation:
1. In the above list min = 1 which we have to shift from last index to 0th index by swapping.
2. Once min value reach to 0th index, then shift max = 5 (index = 3, 4  since in the above
list we have two maximum values then in that case we are going to consider minimum
index value i.e. 3rd index value) to utmost right by swapping.
3. While swapping count the number of iteration required to shift minimum and maximum
values to their respective place.
Note:
1. This problem statement is not based out of sorting. [1, 2, 3, 3, 4, 5, 5]  is not a
desirable output.

Common questions

Powered by AI

Efficiency in filling missing values largely depends on the sequence length and the distribution logic. Complexity arises from calculating averages in gaps where boundary numbers vary, and the necessity to handle each gap in sequence affects the total processing time. Efficient computation may involve preprocessing steps to collate reference boundary values, thus reducing redundant calculations. Moreover, optimizing scan operations per gap to minimize repeated index access is crucial for larger datasets .

Average-based imputation is relevant for maintaining dataset central tendency, limiting distortion in total value assessments. However, challenges arise when numeric ranges vary widely; averages might inaccurately reflect local data variance, leading to imprecise imputation. This method is less effective when data distributions are skewed or have significant outliers, thus demanding complementary imputation strategies or preprocessing steps to more accurately capture data characteristics before averaging .

Identifying exclusive words in each sentence reveals core differences in content focus and intention, thereby providing insights into diverse themes or contexts each sentence addresses. This knowledge aids in contextual inference, such as identifying unique concepts or perspectives not shared between texts, enhancing comprehension of divergence in narrative or informative texts. These differences are valuable for nuanced understanding, especially in content comparison or contrast scenarios .

Percentile-based ranking offers a relative assessment mechanism, highlighting where students stand within a distribution, which can demystify complex score distributions. However, it may also impact student self-perception and motivation; high percentiles might enhance self-efficacy, whereas low rankings could discourage students. Educators must interpret percentiles sensitively, combining them with actionable feedback to constructively influence student engagement and address individual learning gaps effectively .

The program must first identify the minimum and maximum values and their indices. The minimum value is swapped iteratively to the start of the list, and once there, the maximum value is swapped to the end using the next smallest available index. The number of iterations is simply the total number of swap operations performed. It’s crucial to track changes in indices after each swap, especially when multiple identical maximum values exist, to avoid unnecessary swaps and count accurate iterations .

The distribution method for filling missing values depends on the structure of the input sequence. For instance, when values are missing symmetrically around a fixed number, equal division of that number can be used to impute values. In contrast, when missing values surround and follow known values, the sum of known values may be divided across all missing places. These variations ensure that the imputed values maintain the overall numeric relationship the inputs suggest, adapting the strategy to fit different patterns of available data .

This specific placement approach focuses on repositioning only the minimum and maximum values, rather than rearranging the entire list as in sorting. It results in fewer operations, saving computational resources when complete sorting is unnecessary. This specificity targets problems where only extreme values influence a process or decision, thus being more efficient and direct. Such a method also allows preserving relative order among non-extreme values, sometimes crucial for maintaining a preferred structure in the data .

To identify the top 5 students by their marks, you need to sort the 'Marks' list in descending order while maintaining the association with the 'Students' list. The challenge of handling ties arises when multiple students have the same scores, requiring additional criteria to rank them or consider them as having the same rank. Additionally, computational considerations such as sorting efficiency and maintaining index order between lists need careful handling to ensure accurate rankings .

Understanding percentile ranks is critical as it contextualizes a student's performance within the entire class distribution. It enables comparison not just on absolute scores, which can be misleading due to differing difficulty, but relative achievement within the group. Percentile ranks highlight those who perform significantly above or below the peer group average and are crucial for identifying students in the middle tiers who may need moderate interventions. This analysis can guide educators in tailoring support and evaluating overall class progress .

Common word analysis involves identifying shared vocabulary between sentences, aiding in understanding textual overlap and similarity. Such analysis can uncover thematic parallels and shared focuses, which are essential in comparative linguistic studies. Complexities include handling different word forms, stopwords, and ensuring semantic equivalents like synonyms are properly accounted for, which might require advanced natural language processing techniques beyond basic string comparison .

You might also like