Question: Question 38/58 01 min 49 sec Which database technology is not known for analytical queries with support for parallelization and columnar formats? Select the correct







Question 38/58 01 min 49 sec Which database technology is not known for analytical queries with support for parallelization and columnar formats? Select the correct answer: Big Query Amazon RDS Redshift Presto I don't know Select your answer You're building a photo editing program. So far your program uses a single thread. You're considering making it multi-threaded. Which of the following statements about threads is accurate? Select the correct answer: Modern operating systems use a GIL (global interpreter lock). This can limit the efficacy of multi-threading. If your program is CPU-bound, adding threads may make it faster on multi-core processors. Adding multiple threads will allow your program to edit multiple photos at once. Go for it! Threads will slow down your application. An asynchronous design is better (but might be harder to write). I don't know Suppose you want to deploy a CPU-bound single-threaded app server to a machine with 16 logical CPU cores. Which design makes the most sense to maximize performance? Select the correct answer: You'll want your app server to fork() a new process on every request. This has better socket utilization and a lower memory footprint under load vs creating a fixed number of processes up-front. It's rarely helpful to run multiple copies of a CPU bound app server (the global interpreter lock means they just take turns). You'll want to make sure that TCP buffers are small, and that you're using fastCGI. You'll want a flexibly sized pool of server processes. This pool can grow if CPU utilization is low, and shrink if it's high. Then you can use round-robin DNS to balance load between them. You'll want 16 copies of your app server, with a reverse proxy (like NGINX) in front to balance load and provide persistent connections and security. I don't know Imagine you're building a massively multi-player Pac Man game. You want hundreds of players to be able to play Pac Man against each other at the same time. You're going to pay prize money to the best players, so it's important that you limit their ability to cheat. How might you best build this? Select the correct answer: Socket.O is the way to go. Each client can open a web socket connection to the server, and transmit an event whenever their player moves. These events will be emitted to every other player in the game. That way every client will know where all the other players are, and can detect when they should die and remove themselves from the board A server needs to run a canonical copy of the game, with all players. Each client can also run a copy of their region of the game, and use this to interpolate states between server updates. Clients would send their control inputs to the server (perhaps with a time stamp, although that raises cheating issues), and receive updates for all players near them. None of these designs make sense A peer-to-peer architecture makes the most sense (the latency of a client-server version would be a problem). Each player could have a list of peers near them in the game, and send those peers their location every frame. You could have a voting system (like a blockchain) where clients vote to resolve state conflicts and agree on the final version. Which of the following makes the most sense as part of scaling a SQL database to handle increased write load? Select the correct answer: Adding database replicas (in a master-slave configuration) to scale horizontally Adding database indices on the columns most often updated Writing to a materialized view, rather than to the main table Removing little-used indices from the database and batching writes (where possible) Say you're building a web forum application, where users can create accounts and post messages on forums about a variety of subjects. What might your relational DB schema look like? Select the correct answer: A good schema is to have a "messages" table that contains the text of every message, and a "forums" table for each forum. Because we need a many-to-many relationship between messages and forums, we'll also need an association table between the two (message-postings) associating messages to forums. The schema will likely have a "users" table with info on each registered user (name, password hash, etc), and a "forums" table with info on each forum (like forum name). A "messages" table can then have the text of each message, a foreign key to the users table, and a foreign key to the forums table. It's most flexible to use a stored procedure to pull together the data we need dynamically. The schema will probably feature a "posts" table with the text of every message posted, the name of the user who posted it, e.g. "John Smith", and the name of the forum to which it was posted. Suppose you're designing a distributed worker library, and would like it to be able to queue jobs using a number of different message queuing services (RabbitMQ, Amazon Simple Queue Service, ZeroMQ). What's a good way to handle making our code work with each of these services? Select the correct answer: We could design a base interface that defines how our library will interact with the queue service. We can create several implementations of this interface (one for RabbitMQ, one for ZeroMQ, etc). A method that runs when our library loads can look at config details, and instantiate the correct object. As long as all our functions are referentially transparent, this is not really a problem. Referential transparency means that the order in which our methods are evaluated is irrelevant, and we can just run the code for all of our queuing services. The ones that are not set up will not cause any problems. The best way is actually just to write 3 versions of the library (one for each of the queuing services). We'll end up with simpler (and faster) code in each case. We can use a global "queuing_service" variable. This will be initialized to a flag like "rabbit_ma", or "amazon_sqs". Anywhere in our code where we need to interact with the queuing service, then, we can use a switch statement on this variable to make sure that we do the right thing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
