<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Coursera计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(4)
OOD(0)
Algorithm(0)
System Design(1)
高频题(0)
Math(0)
全部(4)
OOD(0)
Algorithm(0)
System Design(1)
高频题(0)
Math(0)
1.Text Formatting According to Specific Rules
2.Design a Scalable System for Collecting and Aggregating Statistics
3.Implement a Variant of the Fibonacci Sequence
4.Implement Odd-Even Parity Check in Python
1. Text Formatting According to Specific Rules
Given a paragraph of text, format it according to the following rules: 1. each line should have exactly L characters (be fully left and right justified), except where specified by rules 2 and 5 2. if only one word can fit on the line, it should be left justified with no trailing spaces 3. extra spaces between words should be distributed as evenly as possible 4. the number of spaces between words should be non-increasing from left to right 5. the last line should be left justified with no extra spaces between words or trailing spaces Example demonstrating rules 3 + 4: Input (not last line): "a b c", L = 8 (to show spacing) "12345678" Correct output: "a bc" Incorrect output: "a b c" (violates rule 3) Incorrect output: "ab c" (violates rule 4) Full example: Input with L = 30 (given as a single line of text): Coursera provides universal access to the world's best education, partnering with top universities and organizations to offer courses online. Output (expand the sidebar if this wraps excessively): Coursera providesuniversal accesstotheworld'sbest education, partnering with top universities and organizations to offer courses online.
2. Design a Scalable System for Collecting and Aggregating Statistics
We have a big deployment with hundreds of machines each of which is exposing thousands of statistics. We want to be able to collect and aggregate those stats/events in a scalable manner. The main consumers for this system are: A graphing system - For a certain metric-name, plot a set of sources from time t1 to t2 e.g. Memory usage of host-1, host-2, host-3 for the past week. An alerting system- Issue an alert (email, etc) when a certain metric-name goes above/below a certain threshold e.g. Memory usage goes above 70%.
3. Implement a Variant of the Fibonacci Sequence
Write a Python function to implement a variant of the Fibonacci sequence using a recursive approach with caching. Discuss the time complexity of your solution.
4. Implement Odd-Even Parity Check in Python
Write a Python function to perform an odd-even parity check.