Interview questions – Choose between 2 Fibonacci alternatives

  • Task:
    Returns the Fibonacci value at a given index.
    for example: input: 6, Return: 8.

Algorithm 1:

public static fibonacci(input: number): any {
    if (input <= 1) return input;
    return this.fibonacci(input - 1) + this.fibonacci(input - 2);

Complexity of time: $ O (n ^ 2) $,
Spatial Complexity: $ O (1) $

Algorithm 2:

public static fibonacci2(input: number): any {
    if (input <= 1) return input;

    let a = 0;
    let b = 1;
    let n = 0;
    for (let i=2; i<=input; i++) {
        n = a + b;
        a = b;
        b = n;
    return n;

Complexity of time: $ O (n) $,
Spatial Complexity: $ O (1) $

Which one would you consider responding to? I saw examples that choose recursive, but it makes no sense to me if you have a very light alternative.

Am I right about the complexities?

Pagination: What is a good method to show the user progression of a dynamic questionnaire with a variable number of questions?

What are the best practices to show the length and stage in a questionnaire, where the length of the questionnaire changes and branches dynamically based on the answers? I will create a questionnaire where the user sees one question at a time. I want the user to have an idea of ​​how much time they have and their place in the process, but without cheating them. I don't want them to think that a single questionnaire could have 50 questions to answer. But to give a tangible number, they might have to answer 7 questions or they could have 15 questions to answer based on their answers.

[ Politics ] Open question: Why do conservatives keep asking silly questions?

[Politics] Open question: Why do conservatives keep asking silly questions?

Questions about Jrpg NPC events (Unity C #)

So, I am trying to understand something. I have my basic search system running for my RPG style game.

Right now I'm taking a look at the NPC events and it triggers that, as I see it, they have two different styles

  1. The classic floor panel trigger that uses rpg maker or

  2. have a listening class for active search / active event

Therefore, my questions are: what is the best way to activate the event and what is a good way to define it? How to set movement patterns, etc., would it be feasible in json? Or should I use programmable objects?

malware: some questions about Red Hat Linux and a case study

As part of a course I am doing, a case study is presented. I'm a bit stuck and I'm not sure where to find more information. If someone could point me in the direction, I would appreciate it.

In this case study, a network that uses Red Hat Linux mail and file servers, a patented SIEM server and several Windows 2012 servers have suffered a possible attack.
It shows that:

  • VMProtectss and NetCat were installed
  • There was some transmission traffic to a URL with the final port 9091
  • Ports 9091 and 9092 were opened, and a single package was sent to a URL ending in 9092
  • Linux servers were not updated recently and had no endpoint injection
  • There was no data modification

From what I can deduce so far, VMProtectss is a Windows-based criptominer and NetCat could be a C2 element that establishes a connection through tcp / udp.
I think the single package for 9092 was a confirmation that NetCat was installed and opens the connection for a long intrusion.
I don't know what the transmission traffic to 9091 could be.

The questions they ask are:

  • What was possibly happening to Linux servers
  • What was the impact on the network and if there was a data breach?
  • what methods would be taken to eliminate malicious code

I don't expect anyone to answer these questions for me, more about where I can go to find more information.

Questions about dedicated servers for the file sharing website

hello I have a download and upload website like turbobit and … (file sharing)

I have 2 questions about data centers:

1 – There are also M … | Read the rest of

Questions and answers about IBM C1000-016 exam dumps – Dumpspass4sure – Everything else

If you are worried about your C1000-016 IBM Systems: Storage Systems → exam and you are not prepared for it, now you do not need to worry about it. Get the most up-to-date Dumpspass4sure C1000-016 dumps with 100% accurate answers. This website is considered one of the best sites where you can save extra money by getting free updates for three months after purchasing the IBM C1000-016 dump practice test. In these PDF dumps C1000-016, we have compiled real exam questions with your answers so you can prepare and pass the exam on your first attempt.

Basic questions about shellcode: exchange of information security stacks

Is the hexadecimal code at the top of this source file the same as the assembly at the bottom, since they do the same?

How can I convert the assembly to hexadecimal as in this source code file? I frequently see that it is used in payloads. I understand that it is done to preserve space, avoid IDS, among other reasons.

Shell storm website sample file

Test online with best practices of 80 questions

When using a long form, you must use several methods to make a good user experience. For really long forms with many questions, here are several things you can try:

1. Group your questions into sections

Order your questions into manageable pieces. When you have a long form, you are likely to ask questions about many different topics. Its objective is to identify what these topics are and classify your questions into easy to understand sections.
Once you have sections, this means that you can more clearly assign where a person is in the process of completing the form. Completing sections also allows small rewards in a long and probably not fun form filling process.

2. Make the location visible

A key difference between short forms and long forms is that they require a different user experience. Short forms are completed in a couple of minutes, long forms can take hours, and people are expected to take breaks between sessions. For long forms, you must include a "you are here" feature, which keeps the person oriented and at the same time gives you the ability to estimate how much time you have left.

To make the location visible, you want to show where the person completing the form is in the process. You can use a percentage to complete the icon, page numbers, bread crumbs, loading bars, step by step, etc. There is no standard reference design for this, you will need to find a system that works with your form. In your case, I think this 2-level tree indicator is fine. interaction

3. Set expectations before the start

To prepare the person to start the form, give as much context as possible. This will increase the completion rates for people who begin the process.
The questions that an introduction could answer are:

  • Why is the person completing this form?
  • How long should it take to complete the form?
  • What is the schedule for the next steps?
  • Do they need to prepare something in advance (for example, have a driver's license on hand or prepare documents)?
  • What about the information they provide?
  • Who has access to it, how will it be used, how does it meet the privacy standards?
  • Does completing the form cost money?
  • Don't surprise people in the end with the cost.

4. Save each question automatically

When the user fills out a long form, some problems may arise. Connection problems, session expiration, etc. Make sure that all user steps are saved and do not need to be completed again.

5. Don't ask out of focus questions

Just hide the out of focus questions surrounding the focused question for very short forms. This design is good for a simple form such as a survey but bad for long online forms with many questions.
When I complete a form like this, I can feel that my heart rate increases because I am trying to find out if I am being tricked into thinking that the form is shorter than it really is.

This style of reducing opacity for out of focus questions is not accessible. People will inevitably feel that they should read the text out of focus before it is focused. But, because the colors of the text on the screen do not meet contrast accessibility standards, readability is reduced causing any difficulty for the person trying to read the question out of focus if they can even see it in the first place.

hide other questions

visas – Simple questions about travel history

He seems to be confused about the intention of the question "Travel history".

This question is an objective statement of where you have traveled. There is no minimum requirement for the number of countries to which you have traveled, nor any specific requirement for those countries. If you have visited zero countries in addition to your home country, then that is the correct answer to the question. If you have visited another 10 countries, you must list those 10 countries.

In general, the number or even specific countries will not have an impact on your application, however, there may be exceptions if the consulate staff believes that there is some type of pattern on their trips that could prevent you from being eligible for a visa.