text
stringlengths
27
323k
source
stringclasses
14 values
__index_level_0__
int64
0
212k
Question: A false negative in sampling can only occur for itemsets with support smaller than , Answer: None of the above
preferences m1
200
Question: Why is XML a document model?, Answer: It has a serialized representation
preferences m1
201
Question: A retrieval model attempts to capture, Answer: the importance a user gives to a piece of information for a query
preferences m1
202
Question: You are given the following accident and weather data. Each line corresponds to one event: 1. car_accident rain lightning wind clouds fire 2. fire clouds rain lightning wind 3. car_accident fire wind 4. clouds rain wind 5. lightning fire rain clouds 6. clouds wind car_accident 7. rain lightning clouds fire 8...
preferences m1
203
Question: When computing HITS, the initial values, Answer: Are set all to 1/sqrt(n)
preferences m1
204
Question: Implement a function that computes the confidence for a given set of rules and their respective support. You can use the following formula: $$\mathrm{conf}(X \Rightarrow Y) = \mathrm{supp}(X \cup Y) / \mathrm{supp}(X)$$, Answer: " Compute confidence for a given set of rules and their respective support fr...
preferences m1
205
Question: When indexing a document collection using an inverted file, the main space requirement is implied by, Answer: The postings file
preferences m1
206
Question: For a user that has not done any ratings, which method can make a prediction?, Answer: none of the above
preferences m1
207
Question: In an FP tree, the leaf nodes are the ones with:, Answer: ['Lowest support', 'None of the other options.']
preferences m1
208
Question: Which statement is correct?, Answer: The Viterbi algorithm works because it is applied to an HMM model that makes an independence assumption on the word dependencies in sentences
preferences m1
209
Question: Which of the following is WRONG about inverted files? (Slide 24,28 Week 3), Answer: Variable length compression is used to reduce the size of the index file
preferences m1
210
Question: In User-Based Collaborative Filtering, which of the following is TRUE?, Answer: Pearson Correlation Coefficient and Cosine Similarity have different value ranges and can return different similarity rankings for the users
preferences m1
211
Question: Assume you are working on a school project with your friend. Your friend claims that using very detailed names are good in code because they describe exactly what is going on. Do you agree? Explain in max 2 sentences., Answer: If the names are too detailed, it makes the code hard to read.
preferences m1
212
Question: Assume you are working on a mobile application. Users complain that your app's image gallery uses too much of their mobile data. In one sentence, explain the first step towards improving this:, Answer: The app could stream images rather than batch them, to only download images the user actually sees
preferences m1
213
Question: Assume you are working on a mobile application. In the daily standup, you mention you are having issues with JavaFX. Before you can give more details, your team's JavaFX expert tells you to leave it at that and instead pass by her office afterwards. The Scrum Master disagrees and asks you to give more details...
preferences m1
214
Question: Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] [Bug] The l...
preferences m1
215
Question: You are working on an app which is a search engine for cat photos. The app works by making requests to a server which stores the photos. Users search for cat photos and see a batch of results at a time; they can tap on a photo to see it full screen. You are getting two main complaints from users about the app...
preferences m1
216
Question: Assume you are part of a team developing a mobile app using Scrum. One of your colleagues, who was tasked with adding a "dark mode" to the app, has found an unrelated bug during testing: a race condition occasionally causes stale data to be displayed. Your colleague wants to immediately fix it, though the sou...
preferences m1
217
Question: Assume that your team is discussing the following java code: public final class DataStructure { public void add(int val) { /*...*/ } private boolean isFull() { /*...*/ } } One of your colleagues suggests that "add" should be changed to return a boolean indicating whether the passed value was added ...
preferences m1
218
Question: Your team is discussing the following code: /** Uploads images to the cloud. */ public final class ImageUploader { public void upload(Image image) { /* … */ } private boolean canUpload(Image image) { /* … */ } } One of your colleagues thinks that "canUpload" should be made public. Explain in 1 sente...
preferences m1
219
Question: Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] [Bug] When ...
preferences m1
220
Question: Assume that your team's project manager decides that the team should stop working on new features for the next two weeks and instead focus on improving the performance and stability of the product to provide a better user experience. Your colleague thinks that he has an idea that might drastically improve the...
preferences m1
221
Question: Assume you are working on SuperQuiz, a trendy app that lets everyone design quizzes and share them with friends! Your first assignment is to add a new feature that is requested by users. You are given the following transcript of an interview with a customer of your product: > Hi! > So you're the developer of ...
preferences m1
222
Question: Assume that your team is discussing the following java code: public final class DataStructure { public void add(int val) { /*...*/ } private boolean isFull() { /*...*/ } } One of your colleagues thinks that "isFull" should be made public. Explain whether this breaks backward compatibility and why o...
preferences m1
223
Question: Assume you are working on a mobile application. You get complaints from Android users: when rotating the phone, the text they had typed disappears. In one sentence, explain what the likely root cause is., Answer: Android destroys and re-creates activities when the phone rotates.
preferences m1
224
Question: Assume you are writing server-side code for an online shop. The code will be invoked over HTTP from a mobile app. Your current code is as follows: public class ShoppingCart { public void buy(Product product, int quantity) { if (product == null) { throw new IllegalArgumentException("product cannot ...
preferences m1
225
Question: You are discussing coding habits with a colleague, who says: "When I edit a part of a function, if I see unclean code in another part of it, I also clean that other part up." In one sentence, explain if this is a good habit and why:, Answer: Yes, it is a good way to incrementally makes the code cleaner
preferences m1
226
Question: Assume you are working in a company on the back-end of a mobile application. Your code crashes with a `MaxSpotFleetRequestCountExceeded` error. Who is your web service provider?, Answer: Amazon Web Services (as can be found by looking up the error name)
preferences m1
227
Question: Assume your colleague wants to wait until the next minor release to include a major bugfix instead of making a bugfix release. Explain why this is not a good idea., Answer: Including a major bugfix in a minor release instead of a bugfix release will cause an incoherent changelog and an inconvenience for users...
preferences m1
228
Question: One of your colleagues has recently taken over responsibility for a legacy codebase, a library currently used by some of your customers. Before making functional changes, your colleague found a bug caused by incorrect use of the following method in the codebase: public class User { /** Indicates whether ...
preferences m1
229
Question: Assume you are working on a mobile application. Your team's graphic designer tells you: "I wanted the logo to be exactly 250 pixels wide, but on my new phone it's not. This is a bug that needs fixing!" In one sentence, explain whether you agree with the designer's assessment and why., Answer: No, different de...
preferences m1
230
Question: Assume that your team is discussing the following java code: public final class DataStructure { public void add(int val) { /*...*/ } private boolean isFull() { /*...*/ } } Your colleagues were changing the parameter type of "add" to an "Integer". Explain whether this breaks backward compatibility a...
preferences m1
231
Question: Assume you are writing server-side code for an online shop. The code will be invoked over HTTP from a mobile app. Your current code is as follows: public class ShoppingCart { public void buy(Product product, int quantity) { if (product == null) { throw new IllegalArgumentException("product cannot ...
preferences m1
232
Question: Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] As a regist...
preferences m1
233
Question: The company in which you work has just hired a new CTO, freshly graduated from a theoretical university. The CTO decides that in order to minimize bugs in the product, all new code must now be covered at least 80% in terms of paths in the code. Is this a good idea, and why? Can you suggest something better, g...
preferences m1
234
Question: Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function: "public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError" ...
preferences m1
235
Question: Assume the company you're working in recently hired a new CEO, who wants to improve development using modern methods. However, this CEO does not have an engineering background, so his suggestions are well-intentioned but not always feasible. The CEO comes to you with a new suggestion: > Continuous integration...
preferences m1
236
Question: Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function: "public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError" ...
preferences m1
237
Question: You are discussing coding habits with a colleague, who says: "When I code, if a function I write has more than 10 lines, I always refactor to make it call another function, so that all my functions have less than 10 lines." In one sentence, explain if this is a good habit and why:, Answer: No, because the lim...
preferences m1
238
Question: One of your colleagues has recently taken over responsibility for a legacy codebase, a library currently used by some of your customers. Before making functional changes, your colleague found a bug caused by incorrect use of the following method in the codebase: public class User { /** Indicates whether ...
preferences m1
239
Question: Assume that you are part of a team developing a mobile app using Scrum. When using the app, you identified multiple bugs and features which you think should be implemented, and took some notes. You want to share these with the Product Owner. Your backlog of tasks includes the following task: - [ ] Login Is th...
preferences m1
240
Question: Assume your team is considering adding support for the SwengPhotos cloud service, which provides upload and download of photos on private cloud storage. Each photo is associated with a unique name. SwengPhotos's documentation for the "upload new photo" interface describes the following error responses: 1. I/O...
preferences m1
241
Question: You've been hired to modernize a codebase from a 50-year-old company: version control, automated builds, and continuous integration. One of your colleagues, who is not completely up-to-date with modern practices, asks you the following question: "Does adding "continuous integration" mean we no longer need to ...
preferences m1
242
Question: Assume you are working in a company on the back-end of a mobile application. One colleague explains that the team had originally configured the repo so that only code with >80% path coverage could be merged, but have now dropped this requirement. In one sentence, give one possible reason behind this removal.,...
preferences m1
243
Question: You are discussing coding habits with a colleague, who says: "When I code, I only write some tests in order to get the minimum coverage my team wants." In one sentence, explain if this is a good habit and why:, Answer: No, the goal of tests is to increase confidence in the code's correctness, coverage is only...
preferences m1
244
Question: Assume you are writing server-side code for an online shop. The code will be invoked over HTTP from a mobile app. Your current code is as follows: public class ShoppingCart { public void buy(Product product, int quantity) { if (product == null) { throw new IllegalArgumentException("product cannot ...
preferences m1
245
Question: Assume you are working on a mobile application. You meet a client while out for coffee, who tells you: "I noticed it's not possible to customize the profile picture. I know you have a lot of stuff to do this sprint, but my boss is threatening to switch to another app, could you get this fixed during this spri...
preferences m1
246
Question: You want to create an application that allows users to manage their e-books. These books will be stored in a local database, with attributes like name, file, etc. In addition, your application will allow to add notes on books, which will be stored separately in the database, and to send a book with its notes ...
preferences m1
247
Question: Assume you work in a team that is developing a weather application that brings together data from several sources. One of your colleagues is responsible for creating a client for a weather service that returns data in JSON format. Your colleague suggests creating a weather client interface that returns the we...
preferences m1
248
Question: You've been hired to modernize a codebase from a 50-year-old company: version control, automated builds, and continuous integration. One of your colleagues, who is not completely up-to-date with modern practices, asks you the following question: "Do I have to do one "commit" each day with my day's work?" What...
preferences m1
249
Question: Assume you're working for a startup that develops a university management app. You just received a description of what the app should do: > This app will be the administrative backbone of the university. > Almost all staff will use it. > Human Resources will register each student, including their personal de...
preferences m1
250
Question: Assume that some of your colleagues work on an AI-based image generation service, where a user enters a topic, and the AI generates a synthetic photo on that topic. They tell you the following about this service: "Currently, the user types in the topic they want to see images for, and the client app sends a r...
preferences m1
251
Question: Assume that some of your colleagues work on an AI-based image generation service, where a user enters a topic, and the AI generates a synthetic photo on that topic. They tell you the following about this service: "Currently, the user types in the topic they want to see images for, and the client app sends a r...
preferences m1
252
Question: Assume Your project depends on the latest available minor release version of a package instead of a hardcoded exact version, what are the pros and cons of this?, Answer: The benefit of depending on the latest available minor version means that we will always be up-to-date with the latest bugfixes and security...
preferences m1
253
Question: Imagine you're working at at JaaS, the Jokes-as-a-Service platform. With JaaS, everyone can be funny any time by having new jokes at their fingertips via a public API. Your first task is to convert user feedback into user stories. Here is one such piece of feedback: "Hi, I have been using your app for a long ...
preferences m1
254
Question: Imagine you're working at JaaS, the Jokes-as-a-Service platform. With JaaS, everyone can be funny any time by having new jokes at their fingertips via a public API. During the orientation at JaaS, the VP of engineering explains to you their workflow: 1. Branching: Developers must use a separate branch for eac...
preferences m1
255
Question: Imagine you're working at JaaS, the Jokes-as-a-Service platform. With JaaS, everyone can be funny any time by having new jokes at their fingertips via a public API. During the orientation at JaaS, the VP of engineering explains to you their workflow: 1. Branching: Developers must use a separate branch for eac...
preferences m1
256
Question: Your team is discussing the following code: /** Uploads images to the cloud. */ public final class ImageUploader { public void upload(Image image) { /* … */ } private boolean canUpload(Image image) { /* … */ } } One of your colleagues points out that "upload" currently has some unexpected behavior r...
preferences m1
257
Question: Assume you are working on a school project with your friend. Your friend uses "print" to debug his code. Is this a good idea and, regardless of whether it is bad or not, is there a better way to do it? Explain why or why not in max 2 sentences., Answer: No, it's not, you have to potentially write a lot of sta...
preferences m1
258
Question: Assume that while working on a new feature for your team's product, your colleague is required to write a function that takes a list of events and sorts them by their timestamp. Using their algorithm course knowledge, they remind you that merge sort's complexity is $O(n log n)$, which is better than the $O(n^...
preferences m1
259
Question: Assume you decide to contribute to an open source project, by adding a feature to an existing class of the project. The class uses an underscore at the beginning of names then "camelCase" for private properties such as "_likeThis", but you find this odd because you're used to the "snake case" "like_this". Whi...
preferences m1
260
Question: Assume you are working on SuperQuiz, a trendy app that lets everyone design quizzes and share them with friends! SuperQuiz recently hired a new CEO, who wants to improve the development practices using modern methods. However, this CEO has no engineering background, so the suggested improvements are well inte...
preferences m1
261
Question: Your colleague wants your opinion on a module design question. They are developing a service that recommends hikes near users based on the weather, and they think the module should take as input a weather service, a service that lists hikes, a function that sorts hikes by length, and outputs an array of hikes...
preferences m1
262
Question: Imagine you're working at JaaS, the Jokes-as-a-Service platform. With JaaS, everyone can be funny any time by having new jokes at their fingertips via a public API. During the orientation at JaaS, the VP of engineering explains to you their workflow: 1. Branching: Developers must use a separate branch for eac...
preferences m1
263
Question: Assume your team is considering adding support for the SwengPhotos cloud service, which provides upload and download of photos on private cloud storage. Each photo is associated with a unique name. SwengPhotos's documentation for the "upload new photo" interface describes the following error responses: 1. I/O...
preferences m1
264
Question: Your colleague wants to improve the performance of a web application by caching common results in an in-memory LRU cache, where the least recently used results are evicted when the cache is full, and wants your opinion on the best way to implement it. He has already implemented the "Cache" interface, which he...
preferences m1
265
Question: Assume you are working on a text editor written in Java. Your colleague is interested in optimizing a wrapper around "String.substring()" used to let users copy and paste parts of the text and decides to write some benchmarks to measure the current performance of the feature. How would you suggest that he pro...
preferences m1
266
Question: You just started an internship in an IT services company. Your first task is about maintaining an old version of a product still used by a large customer. A bug just got fixed in the latest version of the product, and you must fix it in the old version. You ask where the source code is, and a developer shows ...
preferences m1
267
Question: Assume you're working for a startup that develops a university management app. You just received a description of what the app should do: > This app will be the administrative backbone of the university. > Almost all staff will use it. > Human Resources will register each student, including their personal de...
preferences m1
268
Question: Assume In the process of reworking the architecture of the project, you need to remove a method because it's too easy to use incorrectly and there's now an easier-to-use replacement. What changes should you make for upcoming releases?, Answer: Removing a method could be done in a minor release if it's backwar...
preferences m1
269
Question: Your team is developing a library that is mostly intended to be used by your company's own applications, but the library is nevertheless distributed via a public repo on GitHub. It contains the following java function: "public InputStream convertToPdf(Document document) throws GoogleServerNotRespondingError" ...
preferences m1
270
Question: Assume that you are part of a team developing a mobile app using Scrum. One of your colleagues suggests that your team should organize daily Scrum meetings to discuss the progress of the tasks and how to implement complex features. He especially wants to discuss the implementation of a feature that will allow...
preferences m1
271
Question: Assume you are working on SuperQuiz, a trendy app that lets everyone design quizzes and share them with friends! SuperQuiz recently hired a new CEO, who wants to improve the development practices using modern methods. However, this CEO has no engineering background, so the suggested improvements are well inte...
preferences m1
272
Question: Assume that some of your colleagues work on an AI-based image generation service, where a user enters a topic, and the AI generates a synthetic photo on that topic. They tell you the following about this service: "Currently, the user types in the topic they want to see images for, and the client app sends a r...
preferences m1
273
Question: One of your colleagues has recently taken over responsibility for a legacy codebase, a library currently used by some of your customers. Before making functional changes, your colleague found a bug caused by incorrect use of the following method in the codebase: public class User { /** Indicates whether ...
preferences m1
274
Question: Assume you are working on a mobile application. Users report that your app freezes when they access its image gallery, which shows images in a scrollable grid. This is the (java) function run to display the gallery: void startImageGallery() { // Download all the user's images from the application server ...
preferences m1
275
Question: Assume you are working on a trendy app that allows everyone to create and share quizzes! Your first task is to add a new feature. Here is a transcript from part of a conversation with a user: > Hey! So you're the developer of this quiz app? > The one where I can write questions and answers for my friends? > ...
preferences m1
276
Question: A service is an application component that performs long-running operations, usually in the background. A service doesn't provide a UI. While reviewing the pull request of a friend you notice that he periodically fetches data from the cloud in his activity? What potential problem this could lead to, and how c...
preferences m1
277
Question: You are writing an implementation for the following function: /** Find the N-th percentile of the array of values provided, e.g., 50% = median, 100% = maximum */ int findPercentile(int[] values, int n) To facilitate debugging, you decided to add a post-condition: the returned value must be in the array "valu...
preferences m1
278
Question: Assume you have been working with a friend on a LinkedIn-like app, where a user can lookup the shortest path to another user on the platform. You currently have two issues, the operation of finding a path sometimes takes a considerable amount of time, and it freezes the app in the process. Your friend suggest...
preferences m1
279
Question: Assume you are working in a company on the back-end of a mobile application. You are tasked with improving the integration of the authentication via Google in your app, but your manager tells you: "Don't run any tests today, we only have a few API calls left for today's rate limit, we need to preserve those f...
preferences m1
280
Question: Assume you are part of a team developing a mobile app using Scrum. At the last sprint planning, you were assigned the task of adding a new authentication method. However, a customer representative just sent you an email: "the representative believes authentication is less important than support for right-to-l...
preferences m1
281
Question: Given the following code snippet, you are tasked to produce a modulo scheduled version of the loop achieving the best possible performance. You can assume that any operation has a latency of one cycle and that the processor has 2 ALUs, one memory uni...
preferences m1
282
Question: Why a data prefetcher could hinder a Prime+Probe cache attack? How can the attacker overcome this problem? , Answer: 1. On the victim side, the prefetcher might also evict data not corresponding to actual victim accesses, adding noise to ...
preferences m1
283
Question: Describe the techniques that typical dynamically scheduled processors use to achieve the same purpose of the following features of Intel Itanium: (a) Predicated execution; (b) advanced loads---that is, loads moved before a store and explicit check for RAW hazard...
preferences m1
284
Question: Consider the following code transformation: egin{verbatim} r3 = r3 << 4 r4 = r4 << 4 st [r3] = r2 ld r1 = [r4] r5 = r3 + 4 r...
preferences m1
285
Question: What are the differences between statically scheduled HLS and dynamically scheduled HLS? , Answer: The schedule of statically scheduled HLS is known at compile time, while with dynamically scheduled HLS, dependences are encoded in the dataflow graph...
preferences m1
286
Question: How would a data prefetcher influence the results of a \emph{prime + probe} attack?, Answer: 1. If one were to probe sequentially the primed area, the prefetcher would detect that and would try to reduce the attacker misses by bringing earlier in memory some parts of the primed area....
preferences m1
287
Question: Can one easily adapt the Spectre attack to Itanium? If so, give some hints on how different it will be from the classic attack and how potential victims could protect sensitive parts of their code. If not, explain why it is not possible. ...
preferences m1
288
Question: What is modulo scheduling and what are its benefits? What does it apply to? What is its goal? In which respect is it superior to simpler techniques with the same goal?, Answer: 1. Modulo scheduling is a loop pipelining technique. It transforms a loop kernel ...
preferences m1
289
Question: What is the function of processors in a reorder buffer?, Answer: Keep track of all instructions being executed or waiting to be executed and commit their results in order to the registers or memory once it is sure that nothing would have prevented their execution (exceptions in previo...
preferences m1
290
Question: Show a code snippet which represents the kernel of a Spectre attack (use any convenient programming language or assembly). , Answer: It can be simply a test followed by a load at an arbitrary address (an array access protected by the test) and an indirect access based on the result of that a...
preferences m1
291
Question: Consider the following snippet used to produce a high-performance circuit using a statically scheduled HLS tool, such as Xilinx Vivado HLS. Assume that a erb+double+ multiplication takes several cycles (latency) to compute. egi...
preferences m1
292
Question: With respect to reorder buffers, Would you expect to find the memory address where a particular instruction was fetched (i.e., the value of the PC at the time of fetching) inside the reorder buffer? If so, why would it be there? If not, elaborate on why it would it be unneeded., Answer: Yes, it is needed t...
preferences m1
293
Question: The MIPS R10000 fetches four instructions at once and, therefore, there are four such circuits working in parallel inside the processor. Describe very briefly the function of the ``FP map'', of the ``Floating-point queue'', and of the ``Active list''. If applicable, feel free to describe them using other ...
preferences m1
294
Question: In Itanium's procedure call and return mechanism, Still ignoring potential problems during the execution of erb+alloc+, what hardware changes are needed to the processor (compared to a more traditional and straightforward VLIW processor) to implement this funct...
preferences m1
295
Question: Consider a classic pipeline with Fetch, Decode, Execute, Memory, and Writeback stages such as MIPS's. Give an example snippet made of 2-3 instructions (use any credible assembly language) which would benefit from a forwarding path between the Memory and Execute stage (assume that no other forwarding p...
preferences m1
296
Question: What does it mean that a processor implements precise exceptions?, Answer: When the processor enters the exception handler, all instructions before the one pointed to by the exception PC have been already executed and the ones after it are not. The situation of the one pointed to by t...
preferences m1
297
Question: Consider the following code transformation: egin{verbatim} r3 = r3 << 4 r4 = r4 << 4 st [r3] = r2 ld r1 = [r4] r5 = r3 + 4 r...
preferences m1
298
Question: What is predication and why is it (almost) universal in VLIW processors? Could it make sense also in a RISC processor? Why?, Answer: 1. Predicates are 1-bit registers associated with instruction. If the predicate is true, the instruction commits the result to the register file; if it is fals...
preferences m1
299