Coding Challenge: Implement a prototype service to analyze logs of requests to n servers
Price:€23.46
You can only make an offer when buying a single item.
Highlights
𝐃𝐞𝐚𝐫 𝐂𝐨𝐝𝐞𝐫,
𝐓𝐡𝐞 𝐩𝐮𝐫𝐩𝐨𝐬𝐞 𝐨𝐟 𝐜𝐨𝐝𝐢𝐧𝐠 𝐜𝐡𝐚𝐥𝐥𝐞𝐧𝐠𝐞𝐬 𝐢𝐬 𝐭𝐨 𝐭𝐞𝐬𝐭 𝐲𝐨𝐮𝐫 𝐨𝐰𝐧 𝐥𝐨𝐠𝐢𝐜 𝐚𝐧𝐝 𝐫𝐞𝐚𝐬𝐨𝐧𝐢𝐧𝐠 𝐭𝐡𝐚𝐭 𝐫𝐞𝐪𝐮𝐢𝐫𝐞𝐬 𝐜𝐫𝐢𝐭𝐢𝐜𝐚𝐥 𝐭𝐡𝐢𝐧𝐤𝐢𝐧𝐠. 𝐘𝐨𝐮 𝐰𝐢𝐥𝐥 𝐦𝐢𝐬𝐬 𝐨𝐮𝐭 𝐨𝐧 𝐭𝐞𝐬𝐭𝐢𝐧𝐠 𝐲𝐨𝐮𝐫 𝐨𝐰𝐧 𝐜𝐚𝐩𝐚𝐛𝐢𝐥𝐢𝐭𝐢𝐞𝐬 𝐚𝐧𝐝 𝐭𝐡𝐞 𝐟𝐮𝐧 𝐨𝐟 𝐬𝐨𝐥𝐯𝐢𝐧𝐠 𝐜𝐡𝐚𝐥𝐥𝐞𝐧𝐠𝐞𝐬 𝐢𝐟 𝐲𝐨𝐮 𝐫𝐞𝐬𝐨𝐫𝐭 𝐭𝐨 𝐚𝐧 𝐞𝐚𝐬𝐢𝐞𝐫 𝐦𝐞𝐚𝐧𝐬. 𝐘𝐨𝐮𝐫 𝐜𝐡𝐨𝐢𝐜𝐞. 𝐄𝐧𝐣𝐨𝐲!
A. Problem:
Implement a prototype service to analyze logs of requests to n servers.
The servers are indexed from 1 to n. The logs are given as a 2-dimensional array, log_data, of size m where log_data[i] = [server_id,time] denotes that a request was served by the server with id server_id at time.
Given log_data, an integer parameter x, and q queries, for each query[i], find the number of servers that did not receive a request in the time interval [query[i] -x, query[i]].
Example:
Suppose n = 3, x = 5, m = 3, q = 2, log_data[] = [[1,3], [2,6], [1,5]], and query[]= [10, 11].
Query | Interval | Servers that received a request | Servers that did not receive a request
10 | [5, 10] | 1,2 | 3
11 | [6, 11] | 2 | 1, 3
Hence the answer is [1, 2].
B. Function Description:
getStaleServerCount has the following parameters:
int n: the number of servers
int log_data[m][2]: the logs of the servers
int query[q]: the queries
x: an integer parameter for queries
C. Returns
int[q]: the answers to the queries
Complete the C# function getStaleServerCount below.
public static List<int> getStaleServerCount(int n, List<List<int>> log_data, List<int> query, int X)
{
}
++++++
𝐃𝐈𝐒𝐂𝐋𝐀𝐈𝐌𝐄𝐑 𝐎𝐅 𝐖𝐀𝐑𝐑𝐀𝐍𝐓𝐘
𝐓𝐇𝐄 𝐒𝐎𝐔𝐑𝐂𝐄 𝐂𝐎𝐃𝐄 𝐈𝐒 𝐏𝐑𝐎𝐕𝐈𝐃𝐄𝐃 𝐎𝐍 𝐀𝐍 "𝐀𝐒 𝐈𝐒" 𝐁𝐀𝐒𝐈𝐒, 𝐖𝐈𝐓𝐇𝐎𝐔𝐓 𝐖𝐀𝐑𝐑𝐀𝐍𝐓𝐘 𝐎𝐅 𝐀𝐍𝐘 𝐊𝐈𝐍𝐃.
𝐈 𝐃𝐎 𝐍𝐎𝐓 𝐌𝐀𝐊𝐄 𝐀𝐍𝐘 𝐖𝐀𝐑𝐑𝐀𝐍𝐓𝐈𝐄𝐒 𝐀𝐁𝐎𝐔𝐓 𝐓𝐇𝐄 𝐂𝐎𝐌𝐏𝐋𝐄𝐓𝐄𝐍𝐄𝐒𝐒, 𝐑𝐄𝐋𝐈𝐀𝐁𝐈𝐋𝐈𝐓𝐘 𝐀𝐍𝐃 𝐀𝐂𝐂𝐔𝐑𝐀𝐂𝐘 𝐎𝐅 𝐓𝐇𝐈𝐒 𝐈𝐍𝐅𝐎𝐑𝐌𝐀𝐓𝐈𝐎𝐍, 𝐄𝐗𝐏𝐑𝐄𝐒𝐒 𝐎𝐑 𝐈𝐌𝐏𝐋𝐈𝐄𝐃, 𝐎𝐑 𝐓𝐇𝐀𝐓 𝐓𝐇𝐄𝐘 𝐀𝐑𝐄 𝐅𝐑𝐄𝐄 𝐎𝐅 𝐀𝐍𝐘 𝐄𝐑𝐑𝐎𝐑, 𝐎𝐑 𝐀𝐑𝐄 𝐂𝐎𝐍𝐒𝐈𝐒𝐓𝐄𝐍𝐓 𝐖𝐈𝐓𝐇 𝐀𝐍𝐘 𝐏𝐀𝐑𝐓𝐈𝐂𝐔𝐋𝐀𝐑 𝐒𝐓𝐀𝐍𝐃𝐀𝐑𝐃 𝐎𝐅 𝐌𝐄𝐑𝐂𝐇𝐀𝐍𝐓𝐀𝐁𝐈𝐋𝐈𝐓𝐘, 𝐎𝐑 𝐓𝐇𝐀𝐓 𝐓𝐇𝐄𝐘 𝐖𝐈𝐋𝐋 𝐌𝐄𝐄𝐓 𝐘𝐎𝐔𝐑 𝐑𝐄𝐐𝐔𝐈𝐑𝐄𝐌𝐄𝐍𝐓𝐒 𝐅𝐎𝐑 𝐀𝐍𝐘 𝐏𝐀𝐑𝐓𝐈𝐂𝐔𝐋𝐀𝐑 𝐀𝐏𝐏𝐋𝐈𝐂𝐀𝐓𝐈𝐎𝐍.
𝐈𝐍 𝐍𝐎 𝐄𝐕𝐄𝐍𝐓 𝐒𝐇𝐀𝐋𝐋 𝐈 𝐁𝐄 𝐋𝐈𝐀𝐁𝐋𝐄 𝐅𝐎𝐑 𝐀𝐍𝐘 𝐃𝐈𝐑𝐄𝐂𝐓, 𝐈𝐍𝐃𝐈𝐑𝐄𝐂𝐓, 𝐈𝐍𝐂𝐈𝐃𝐄𝐍𝐓𝐀𝐋, 𝐏𝐔𝐍𝐈𝐓𝐈𝐕𝐄, 𝐎𝐑 𝐂𝐎𝐍𝐒𝐄𝐐𝐔𝐄𝐍𝐓𝐈𝐀𝐋 𝐃𝐀𝐌𝐀𝐆𝐄𝐒 𝐎𝐅 𝐀𝐍𝐘 𝐊𝐈𝐍𝐃 𝐖𝐇𝐀𝐓𝐒𝐎𝐄𝐕𝐄𝐑 𝐖𝐈𝐓𝐇 𝐑𝐄𝐒𝐏𝐄𝐂𝐓 𝐓𝐎 𝐓𝐇𝐄 𝐒𝐄𝐑𝐕𝐈𝐂𝐄, 𝐓𝐇𝐄 𝐌𝐀𝐓𝐄𝐑𝐈𝐀𝐋𝐒 𝐀𝐍𝐃 𝐓𝐇𝐄 𝐏𝐑𝐎𝐃𝐔𝐂𝐓𝐒.
𝐓𝐇𝐄 𝐄𝐍𝐓𝐈𝐑𝐄 𝐑𝐈𝐒𝐊 𝐀𝐒 𝐓𝐎 𝐓𝐇𝐄 𝐐𝐔𝐀𝐋𝐈𝐓𝐘 𝐀𝐍𝐃 𝐏𝐄𝐑𝐅𝐎𝐑𝐌𝐀𝐍𝐂𝐄 𝐎𝐅 𝐓𝐇𝐄 𝐏𝐑𝐎𝐆𝐑𝐀𝐌 𝐈𝐒 𝐖𝐈𝐓𝐇 𝐘𝐎𝐔. 𝐒𝐇𝐎𝐔𝐋𝐃 𝐓𝐇𝐄 𝐏𝐑𝐎𝐆𝐑𝐀𝐌 𝐏𝐑𝐎𝐕𝐄 𝐃𝐄𝐅𝐄𝐂𝐓𝐈𝐕𝐄, 𝐘𝐎𝐔 𝐀𝐒𝐒𝐔𝐌𝐄 𝐓𝐇𝐄 𝐂𝐎𝐒𝐓 𝐎𝐅 𝐀𝐋𝐋 𝐍𝐄𝐂𝐄𝐒𝐒𝐀𝐑𝐘 𝐂𝐎𝐑𝐑𝐄𝐂𝐓𝐈𝐎𝐍.
𝐘𝐎𝐔 𝐇𝐄𝐑𝐄𝐁𝐘 𝐀𝐂𝐊𝐍𝐎𝐖𝐋𝐄𝐃𝐆𝐄 𝐓𝐇𝐀𝐓 𝐀𝐍𝐘 𝐑𝐄𝐋𝐈𝐀𝐍𝐂𝐄 𝐔𝐏𝐎𝐍 𝐀𝐍𝐘 𝐌𝐀𝐓𝐄𝐑𝐈𝐀𝐋𝐒 𝐈𝐒 𝐒𝐓𝐑𝐈𝐂𝐓𝐋𝐘 𝐀𝐓 𝐘𝐎𝐔𝐑 𝐎𝐖𝐍 𝐑𝐈𝐒𝐊. 𝐈 𝐑𝐄𝐒𝐄𝐑𝐕𝐄 𝐓𝐇𝐄 𝐑𝐈𝐆𝐇𝐓, 𝐈𝐍 𝐌𝐘 𝐒𝐎𝐋𝐄 𝐃𝐈𝐒𝐂𝐑𝐄𝐓𝐈𝐎𝐍 𝐀𝐍𝐃 𝐖𝐈𝐓𝐇𝐎𝐔𝐓 𝐀𝐍𝐘 𝐎𝐁𝐋𝐈𝐆𝐀𝐓𝐈𝐎𝐍, 𝐓𝐎 𝐌𝐀𝐊𝐄 𝐈𝐌𝐏𝐑𝐎𝐕𝐄𝐌𝐄𝐍𝐓𝐒 𝐓𝐎, 𝐎𝐑 𝐂𝐎𝐑𝐑𝐄𝐂𝐓 𝐀𝐍𝐘 𝐄𝐑𝐑𝐎𝐑 𝐎𝐑 𝐎𝐌𝐈𝐒𝐒𝐈𝐎𝐍𝐒 𝐈𝐍 𝐀𝐍𝐘 𝐏𝐎𝐑𝐓𝐈𝐎𝐍 𝐎𝐅 𝐓𝐇𝐄 𝐒𝐄𝐑𝐕𝐈𝐂𝐄 𝐎𝐑 𝐓𝐇𝐄 𝐌𝐀𝐓𝐄𝐑𝐈𝐀𝐋𝐒.
Instant Download
Your files will be available to download once payment is confirmed. Here's how.
Instant download items don’t accept returns, exchanges or cancellations. Please contact the seller about any problems with your order.
Etsy Purchase Protection
Shop confidently on Etsy knowing if something goes wrong with an order, we've got your back for all eligible purchases —
see programme terms
Reviews for this item
It was great and helpful
Response from Mawie's
Thank you and enjoy 😉
More from this shop
Visit shop-
Digital download
Basic Research Paper Template APA 7 | MS Word Template | Academic Paper Template | Microsoft Word Template | Annotated Bibliography
€4.06
-
Digital download
Coding Challenge: University Turnstile
€23.46
-
Digital download
Coding Challenge: Median Analysis
€23.46
-
Digital download
Coding Challenge: Folder Organization
€23.46
-
MySQL Quick Reference Computer Programming Database Management System Cheat Sheet Poster
€20.61
-
Digital download
I-Ready Math Data Analyzer spreadsheet
€13.66
-
C Computer Programming language Handy Guide Quick Reference Educational Aid Cheat Sheet Poster
€20.61
-
C++ Computer Programming Language Quick Reference Educational Aid Cheat Sheet Poster
€21.80
-
Digital download
OSINT Study Guide | 56-Page Open Source Intelligence Training, Research Workflow and Source Evaluation
€17.80
-
Digital download
Custom Excel automation programs using VBA.
€41.56
-
Handy guide to the Basic Principles of Object Oriented Programming and Design Poster 12"x18"
€20.61
-
Digital download
G-Code Cheat Sheet (Fanuc / Haas) | Verified G/M Codes + CNC Machining Best Practices | Machinist Reference PDF
€11.88
-
Digital download
COMPLETE C++ GUIDE to Learn the Concepts of Coding Programming Computer Science
€23.74
-
Excel Visual Basic for Applications VBA Computer Programming language Quick Reference Sheet Cheat 20x30 Poster
€21.80
-
Digital download
Why Measurement Matters
€15.43
-
Digital download
List of 500+ AI Tools
€11.88
Shoppers with similar taste loved these
-
Digital download
Engineering Sarcasm Stickers Collection - Good with numbers, bad with people and Nailed it Instant Download Clipart
€3.57
-
I'm Not An Engineer Because My Ideas Make Sense Die Cut Vinyl Sticker, waterproof, hard hat sticker, construction, made by Artsy not Craftsy
€4.45
-
oooh this calls for a spreadsheet sticker, math laptop stickers, math water bottle decals, tumbler stickers math stickers, office sticker
Sale Price €3.54
Original Price €3.94
-
Hex Head Screw Fidget Pen: Engineer Gift
€12.76
-
This Is Fine Bear Programmer Humor Vinyl Sticker, Software Developer Gift, Cute Tech Coding Sticker, Computer Science, Gift for Engineer
€4.75
-
50 Random Tech Stickers for Programmers, Funny Vinyl Coding Stickers, Waterproof Engineer Laptop Stickers, Computer-Themed Gifts
Sale Price €6.54
Original Price €20.42
-
Tech Priest Sticker
€2.38
-
Holographic Circuit Heart Sticker: Tech Engineer Gift
Sale Price €5.04
Original Price €5.93
-
Math Duck Stickers: Funny STEM Science Vinyl Decals Math Stickers Science Stickers STEM stickers funny coworker sticker duck tech stickers
€4.45
-
Deploy on Friday Sticker: Funny DevOps Raccoon Dumpster Fire
€4.75
-
SQL Cheat Sheet Desk Mat | Database Query Commands Keyboard Pad | Data Analyst & Engineer Gift
Sale Price €37.91
Original Price €47.39
-
VSCode Cheat Sheet Desk Mat: Windows & Mac Keyboard Shortcuts
Sale Price €37.91
Original Price €47.39