Posts

Showing posts from January, 2024

My Date and Time of Birth Dilemma

 Time There are 24 time zones in the world. These time zones are each 1 hour apart. I will in summary explain how the time difference comes across and what is used to determine the time in a region/country as a build up to the dilemma. From my Geography and Math classes, I remember there being questions like "what will be the time in country 'xyz' if the time in your country is  'this' and given that the country is on 'this' longitude while your country is on 'this'". The question required you to remember that the time difference between two consecutive longitudes is 4 minutes. (There are 360 longitudes and the globe does one full rotation in 24 hrs. The breakdown into minutes and longitude to longitude distance in time is 4 minutes). So, longitudes determine time. They are defined as imaginary lines that run from North to South, from pole to pole but measure distance from East to West (separates East from West). The most famous one is the prim...

What I remember from my Data Science skills interviews - Part 3

This is a continuation from my previous post (What I remember from my Data Science skills interviews - Part 2).  Note:  The example below is not an exact replica of any test I have done. #A PROGRAM THAT RETURNS THE SMALLEST SUBSET OF NUMBERS IN A SET(FROM SMALLEST TO LARGEST) WHOSE SUM IS GREATER THAN THAT OF THE REMAINING SUBSET (All the code is in R) values_check = function(k){   values<-max(k)   for (i in 2:length(k)) {     b<-sort(k, decreasing = TRUE)     if(sum(b[1:i-1])<sum(b[i:length(b)])){       values<-append(values,b[i])     }     if(sum(b[1:i-1])>sum(b[i:length(b)])){       break     }   }   sort(values) } Examples values_check(c(4,3,5,8,4,6)) Results: 5,6,8 a <- array(c(7,4,6,9,2)) values_check(a) Results: 7,9 Breakdown Before the check begins, arrange them from largest to smallest It is a given that the largest number will be in the answer su...

What I remember from my Data Science skills interviews - Part 2

Image
This is a continuation from my previous post (What I remember from my Data Science skills interviews - Part 1 ).  Note: The example below is not an exact replica of any test I have done.   #A FUNCTION THAT FINDS THE NUMBER OF FILES WITH SAY BYTE SIZE GREATER THAN 5000,  RETURNS THE NUMBER OF SUCH FILES  IN ONE ROW AND THE SUM TOTAL OF THE BYTES ON THE NEXT ROW. IT TAKES IN A FILE THAT MIGHT LOOK SOMETHING LIKE THIS AS THE INPUT. (All the code is in R) file<-c('good "2021-12-31T19:27:58.900z" 200 117',         'goodi "2021-12-31T19:08:31.760z" 200 4567',         'goodie "2021-12-31T16:56:14.124z" 200 5436',         'goods "2021-12-31T15:54:07.963z" 200 5453',         'goodle "2021-12-31T15:35:30.504z" 200 143') #The function library(dplyr) #for its verbs and the pipe operator filename = function(k){   #Split the strings at white spaces   st_split <- strsplit(k, split = " ")...

What I remember from my Data Science skills interviews - Part 1

As someone who wants to be more comfortable doing skills tests, I find myself applying to jobs sometimes for the sole purpose of having a feel of the test and challenging myself to complete it on time. On some occasions I really do well and on some I am left thinking "I wish there was no pressure to complete this test in the given time".  I would also note that the example below is not an exact replica of any test I have done.  #A FUNCTION THAT CHECKS IF A WORD(S) IS A PALINDROME (The Code is in R) palindrome_check = function(k){   k <- tolower(gsub(" ","",k))   newname <- c()   for (i in 1:nchar(k)) {     newname[i] <- (unlist(strsplit(k, split = "")))[nchar(k)-(i-1)]   }   k_new <- paste(newname, collapse  =  "")   ifelse(k_new == k, "This is a palindrome", "This is not a palindrome") } Examples palindrome_check("civic") Result: "This is a palindrome" palindrome_check("mother...

Feedback Scoring

Image
Intro A few days back I was pulled into a Data Center of Excellence (DCoE) meeting. The meeting got me thinking of a feedback scoring scenario and how I would go about handling it. Say you have different stakeholders in a company (like a hospital). They ask patients to fill out questionnaire/survey on their customer experience. The question I asked myself was, collectively, can all the surveys tell us how we are doing as a hospital on a particular issue. The assumption is that the  surveys have the same questions but the answer choices vary. One example question can be as below: How did you find your stay in the hospital? Very satisfying, Satisfying, Neutral, Dissatisfied, Very dissatisfying. Very satisfying, Satisfying, Average, Dissatisfying Satisfying, Average, Dissatisfying…. and so on Step by step process For all the surveys, breakdown the question and answer choices into a table (first two columns). If the tables exist in say an excel file, you could  continu...