Section mcq’s choice Choice Choice 1,2 Choice 1,3,5


Download 63.22 Kb.
bet4/8
Sana03.06.2024
Hajmi63.22 Kb.
#1840512
1   2   3   4   5   6   7   8
Bog'liq
CODER EXAM

Response 1 – 5,5,5,5,1,1
Response 2 – 2,5,4,2,1,1

  1. Write me a simple program explaining how classes work in C++

Response 1 – 2,3,4,4,1,1
Response 2 – 5,3,5,5,1,1


  1. Write a program in Java that concatenates a given string. Give me the code without comments or docstrings.

Response 1 – 3,2,4,4,1,1
Response 2 – 5,5,5,5,1,1


  1. What does the .find() in Js do?

Response 1 – 5,5,5,5,1,1
Response 2 – 5,4,2,4,1,1

  1. Write a function in python that prints a matrix in a spiral.

Response 1 – 5,5,5,5,1,1
Response 2 – 5,5,2,2,1,1

  1. Please answer the following question. Question title: indexing an element from a volatile struct doesn't work in C++

I have this code:


Response 1 – 2,5,2,2,1,1
Response 2 – 4,5,4,5,1,1

  1. How to improve "(a) => { return Math.pow(a) > 2 ? Math.pow(a) + 1 : false;} " , keeping in one-line function

Response 1 = 4434
Response 2 = 5455

  1. Given two arrays, username and website, along with an array timestamp, all of the same length, where the tuple [username[i], website[i], timestamp[i]] denotes that user username[i] visited websitewebsite[i] at time timestamp[i]. A pattern consists of three websites, and the score of a pattern represents the number of users who visited all the websites in the pattern in the same order. For instance, if the pattern is ["home", "about", "career"], the score is the count of users who visited "home," followed by "about," and then "career."

Write a JS function to find the pattern with the highest score, and if there are multiple patterns with the same highest score, return the lexicographically smallest one. - It is guaranteed that there is at least one user who visited at least three websites and - All the tuples [username[i], timestamp[i], website[i]] are unique.
Example: Input: username = ["joe","joe","joe","james","james","james","james","mary","mary","mary"], timestamp = [1,2,3,4,5,6,7,8,9,10], website = ["home","about","career","home","cart","maps","home","home","about","career"], then the tuples in this example are: ["joe","home",1],["joe","about",2],["joe","career",3],["james","home",4],["james","cart",5],["james","maps",6],["james","home",7],["mary","home",8],["mary","about",9], and ["mary","career",10].` Pattern includes:
("home", "about", "career") has score 2 (joe and mary). // The result should be this.
("home", "cart", "maps") has score 1 (james).
("home", "cart", "home") has score 1 (james).
("home", "maps", "home") has score 1 (james).
("cart", "maps", "home") has score 1 (james).
("home", "home", "home") has score 0 (no user visited home 3 times). Output: ["home", "about", "career"]


Download 63.22 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling