Prova da Camara -Analista de TI - Comentada I

PROVA 1 − OBJETIVA − 2a PARTE
CONHECIMENTOS ESPECÍFICOS





46. A hierarquia de sistemas de armazenamento, de acordo
com a velocidade e custo decrescentes, pode ser
organizada pela seqüência dos dispositivos
(A) registradores, memória principal, cache, disco ótico
e disco magnético.
(B) cache, disco ótico, disco magnético, memória
principal e registradores.
(C) memória principal, registradores, cache, disco
magnético e disco ótico.
(D) memória principal, cache, registradores, disco ótico
e disco magnético.
(E) registradores, cache, memória principal, disco
magnético e disco ótico.





Resposta: E


Justificativa







_________________________________________________________
47. Dois bytes que podem conter valores máximos 99, em
decimal, e FFFF, em hexadecimal, poderão conter, em
binário, o equivalente valor máximo
(A) 256256.
(B) 255255.
(C) 127127.
(D) 65536.
(E) 32768.


Resposta: D



Justificativa> 2 bytes = 16 bits => 2^16=65536

_________________________________________________________
48. Os registradores de base e de limite são utilizados pelos
sistemas operacionais como recursos de proteção da
(A) operação no modo supervisor.
(B) E/S.
(C) CPU.
(D) memória.
(E) fatia de tempo (time slice).


Resposta: D



Justificativa>

"Multiprogramming introduces two essential problems that must be solved relocation and protection.....An alternative solution to both the relocation and protection problems is to equip the machine with two special hardware registers, called the base and limit registers. When a process is scheduled, the base register is loaded with the address of the start of its partition, and the limit register is loaded with the length of the partition. Every memory address generated automatically has the base register contents added to it before being sent to memory. Thus if the base register contains the value 100K, a CALL 100 instruction is effectively turned into a CALL 100K + 100 instruction, without the instruction itself being modified. Addresses are also checked against the limit register to make sure that they do not attempt to address memory outside the current partition. The hardware protects the base and limit registers to prevent user programs from modifying them."



Pagina 377

Operating Systems Design and Implementation, Third Edition

Andrew S. Tanenbaum

_________________________________________________________
49. Para um sistema operacional anexar ou desconectar
dispositivos remotos, uma chamada de sistema pertence à
categoria de
(A) controle de processos.
(B) comunicações.
(C) gerenciamento de arquivos.
(D) gerenciamento de dispositivos.
(E) manutenção de informações.



Resposta: B



Justificativa>
_________________________________________________________
50. Em programação, para armazenar um nome de uma
pessoa deve-se criar uma variável do tipo
(A) Float.
(B) Caractere.
(C) Inteiro.
(D) Lógico.
(E) Real.

Resposta: B

Justificativa>

"... By the way, SQL in particular does have a built-in type called INTEGER, as I'm sure you know. It also has a built-in type called CHAR, but
(a) that type denotes fixed-length strings, not arbitrary-length ones, and
(b) the length in question, n say, usually has to be specified along with the CHAR specification, like this: CHAR(n).
[*] (CHAR without such a length specification is shorthand for CHAR(1)—not a very useful default, it might be thought.) SQL also allows users to define their own types.
[*] SQL does have a varying-length character-string type, called VARCHAR, but even there a maximum length has to be specified.
In the interests of historical accuracy, I should now say that when Codd first defined the relational model, he said relations were defined over domains, not types. In fact, however, domains and types are exactly the same thing.

Database in Depth, pagina 2
C.J. Date
_________________________________________________________

51. Na programação orientada a objetos, quando uma classe
pessoa física, além do seu atributo CPF, recebe os
atributos da classe pessoa, diz-se que foi aplicada a
técnica de
(A) Método de acesso.
(B) Repetição.
(C) Herança.
(D) Polimorfismo.
(E) Estrutura de algoritmo.

Resposta: C

Justificativa> Classe Pessoa Física(subclasse) estende a Classe Pessoa(superclasse), recebendo os atributos da superclasse. Conceitos de generalização e Especificação estão diretamente relacionados a Herança.
_________________________________________________________
52. NÃO é um método de ordenação das linguagens de
programação, que coloca na seqüência os elementos de
dados em uma ordem predefinida:
(A) Bubble sort.
(B) Quick sort.
(C) Merge sort.
(D) Radix sort.
(E) Cookie sort.

resposta: E

Bubble sort
Bubble sort is a straightforward and simplistic method of sorting data that is used in computer science education. The algorithm starts at the beginning of the data set. It compares the first two elements, and if the first is greater than the second, it swaps them. It continues doing this for each pair of adjacent elements to the end of the data set. It then starts again with the first two elements, repeating until no swaps have occurred on the last pass. Although simple, this algorithm is highly inefficient and is rarely used except in education. A slightly better variant, cocktail sort, works by inverting the ordering criteria and the pass direction on alternating passes. Its average case and worst case is same O(n2).

Selection sort
Selection sort is a simple sorting algorithm that improves on the performance of bubble sort. It works by first finding the smallest element using a linear scan and swapping it into the first position in the list, then finding the second smallest element by scanning the remaining elements, and so on. Selection sort is unique compared to almost any other algorithm in that its running time is not affected by the prior ordering of the list: it performs the same number of operations because of its simple structure. Selection sort also requires only n swaps, and hence just Θ(n) memory writes, which is optimal for any sorting algorithm. Thus it can be very attractive if writes are the most expensive operation, but otherwise selection sort will usually be outperformed by insertion sort or the more complicated algorithms.

Insertion sort
Insertion sort is a simple sorting algorithm that is relatively efficient for small lists and mostly-sorted lists, and often is used as part of more sophisticated algorithms. It works by taking elements from the list one by one and inserting them in their correct position into a new sorted list. In arrays, the new list and the remaining elements can share the array's space, but insertion is expensive, requiring shifting all following elements over by one. The insertion sort works just like its name suggests - it inserts each item into its proper place in the final list. The simplest implementation of this requires two list structures - the source list and the list into which sorted items are inserted. To save memory, most implementations use an in-place sort that works by moving the current item past the already sorted items and repeatedly swapping it with the preceding item until it is in place. Shell sort (see below) is a variant of insertion sort that is more efficient for larger lists. This method is much more efficient than the bubble sort, though it has more constraints.
Shell sort
Shell sort was invented by Donald Shell in 1959. It improves upon bubble sort and insertion sort by moving out of order elements more than one position at a time. One implementation can be described as arranging the data sequence in a two-dimensional array and then sorting the columns of the array using insertion sort. Although this method is inefficient for large data sets, it is one of the fastest algorithms for sorting small numbers of elements (sets with less than 1000 or so elements). Another advantage of this algorithm is that it requires relatively small amounts of memory.
Merge sort
Merge sort takes advantage of the ease of merging already sorted lists into a new sorted list. It starts by comparing every two elements (i.e. 1 with 2, then 3 with 4...) and swapping them if the first should come after the second. It then merges each of the resulting lists of two into lists of four, then merges those lists of four, and so on; until at last two lists are merged into the final sorted list. Of the algorithms described here, this is the first that scales well to very large lists.
Heapsort
Heapsort is a much more efficient version of selection sort. It also works by determining the largest (or smallest) element of the list, placing that at the end (or beginning) of the list, then continuing with the rest of the list, but accomplishes this task efficiently by using a data structure called a heap, a special type of binary tree. Once the data list has been made into a heap, the root node is guaranteed to be the largest element. It is removed and placed at the end of the list, then the heap is rearranged so the largest element remaining moves to the root . Using the heap, finding the next largest element takes O(log n) time, instead of O(n) for a linear scan as in simple selection sort. This allows Heapsort to run in O(n log n) time.
Quicksort
Quicksort is a divide and conquer algorithm which relies on a partition operation: to partition an array, we choose an element, called a pivot, move all smaller elements before the pivot, and move all greater elements after it. This can be done efficiently in linear time and in-place. We then recursively sort the lesser and greater sublists. Efficient implementations of quicksort (with in-place partitioning) are typically unstable sorts and somewhat complex, but are among the fastest sorting algorithms in practice. Together with its modest O(log n) space usage, this makes quicksort one of the most popular sorting algorithms, available in many standard libraries. The most complex issue in quicksort is choosing a good pivot element; consistently poor choices of pivots can result in drastically slower (O(n2)) performance, but if at each step we choose the median as the pivot then it works in O(n log n).
Bucket sort
Bucket sort is a sorting algorithm that works by partitioning an array into a finite number of buckets. Each bucket is then sorted individually, either using a different sorting algorithm, or by recursively applying the bucket sorting algorithm.
Radix sort
Radix sort is an algorithm that sorts a list of fixed-size numbers of length k in O(n · k) time by treating them as bit strings. We first sort the list by the least significant bit while preserving their relative order using a stable sort. Then we sort them by the next bit, and so on from right to left, and the list will end up sorted. Most often, the counting sort algorithm is used to accomplish the bitwise sorting, since the number of values a bit can have is small.
_________________________________________________________
53. Um mecanismo de extensão da UML 2.0, que permite a
criação de novos elementos para atender necessidades
específicas de um modelo, é denominado
(A) colaboração.
(B) estereótipo.
(C) artefato.
(D) restrição.
(E) interface.

Resposta: B

Justificativa>
Metatipo ou tipo que descreve um tipo. Serve para definir novos tipos de elementos.
O seu nome deve ser representado entre os caracteres "<<" e ">>".
Para um estereótipo pode ser definido:Propriedades; Semântica; Notação (Icones próprios);
Classe base do metamodelo extendido.

________________________________________________________
54. Na modelagem de um sistema com a UML 2.0, uma
ligação de Associação é um relacionamento entre
(A) as áreas conceituais dentro de uma mesma camada.
(B) dois elementos de modelagem, que indica que a
mudança em um elemento afetará a outro.
(C) um elemento mais genérico e outro mais específico.
(D) dois ou mais classificadores que envolvem conexões
entre suas instâncias.
(E) uma especificação e sua implementação.

Resposta: D

Justificativa>

A definição de associação "é um relacioamento estrutural que especifica objetos de um item conectados a objetos de outro item. A partir de uma associação conectando duas classes, você é capaz de navegar do objeto de uma classe até o objeto de outra e vice-versa". Referência: BOOCH, Grady, RUMBAUGH, James e JACOBSON, Ivar. UML - Guia do Usuário. Editora Campus.

Associação - Relacionamento estrutural entre instâncias, especifica que objetos de uma classe estão ligados a objetos de outras classes.
_________________________________________________________
55. Características de um sistema que não mudam com o
tempo podem ser representadas, na UML 2.0, por meio de
um diagrama de
(A) implantação.
(B) máquina de estados.
(C) casos de uso.
(D) atividades.
(E) seqüência.

Resposta: A

Justificativa>
Na UML 2.0 existem alguns tipos de diagramas:

Diagramas Estruturais (estáticos)

  • Diagrama de objetos
  • Diagrama de classes
  • Diagrama de componentes
  • Diagrama de instalação
  • Diagrama de pacotes
  • Diagrama de estrutura

Diagramas Comportamentais

  • Diagrama de Caso de Uso
  • Diagrama de Máquina de Estados
  • Diagrama de atividade

Diagramas de Interação (são também comportamentais)

  • Diagrama de sequência
  • Diagrama de Interatividade
  • Diagrama de comunicação
  • Diagrama de tempo
Postar um comentário

Postagens mais visitadas deste blog

MANUAL DE REDAÇÃO DA PRESIDÊNCIA DA REPÚBLICA

Plural de substantivos compostos

Atualidades - 15 de agosto de 2016