Top 5 Coding questions for Devops Interview

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ย. 2024

ความคิดเห็น • 16

  • @yashagarwal8445
    @yashagarwal8445 10 หลายเดือนก่อน

    Very Informative, thank you so much!

  • @shaileshkumarshetty4401
    @shaileshkumarshetty4401 2 ปีที่แล้ว +1

    Tnks bhai

  • @ruhinaz7081
    @ruhinaz7081 2 ปีที่แล้ว +1

    👌

  • @kumaranil181
    @kumaranil181 2 ปีที่แล้ว +1

    bash script for Q1 : awk '{print $1, $7}' serverlog |sort |uniq -c |awk '{print $2,$3,$1}'

    • @devops_with_syed
      @devops_with_syed  2 ปีที่แล้ว

      This is interesting thank you for sharing

    • @arshadsiddieque7097
      @arshadsiddieque7097 2 หลายเดือนก่อน

      This command is a series of piped commands that processes a server log file using awk, sort, and uniq.
      awk '{print $1, $7}' serverlog:
      This part of the command uses awk to extract and print the first ($1) and seventh ($7) fields (columns) from each line of the file named serverlog.
      The first field often represents the IP address or some identifier, and the seventh field could be something like the request method or status code, depending on the log format.
      | sort:
      The output from the first awk command is then piped into sort, which sorts the lines alphabetically or numerically based on the content of the fields.
      | uniq -c:
      The sorted output is then piped into uniq -c, which counts the number of occurrences of each unique line.
      | awk '{print $2,$3,$1}':
      Finally, the output from uniq -c is piped into another awk command. This reorders the fields: it prints the second ($2), third ($3), and first ($1) fields in that order.
      Here, $1 is the count of occurrences, $2 is what was originally the first field from the serverlog, and $3 is what was originally the seventh field.

  • @syedzaneb5196
    @syedzaneb5196 2 ปีที่แล้ว +1

    👍

  • @kumaranil181
    @kumaranil181 2 ปีที่แล้ว +1

    for Q3: top -o %CPU command is good enough

    • @devops_with_syed
      @devops_with_syed  2 ปีที่แล้ว

      Correct for the top command this is good enough, but top is just an example I gave to explain and generate the data set. Actual question wasnt an output of the top command.

  • @nehamallige7492
    @nehamallige7492 6 หลายเดือนก่อน

    Would have been helpful if you actually showed the solutions

  • @shaileshkumarshetty4401
    @shaileshkumarshetty4401 ปีที่แล้ว

    pls make more videss

  • @smarlakunta
    @smarlakunta ปีที่แล้ว

    Regarding the 4th question. If i have understood the question correctly. Doesn't the following suffice ?
    ➜ dev tree .
    .
    ├── dir1
    │ └── file2
    ├── dir2
    │ └── dir3
    │ └── file3
    ├── dir4
    └── file1
    4 directories, 3 files
    ➜ dev grep -rnE '^#'
    ./dir2/dir3/file3:3:# this is a comment
    ./file1:3:# this is a comment
    ./dir1/file2:3:# this is a comment
    ➜ dev

    • @devops_with_syed
      @devops_with_syed  ปีที่แล้ว

      # this is a comment
      printf("# this is not a comment")

    • @smarlakunta
      @smarlakunta ปีที่แล้ว

      @@devops_with_syed In that case the command will be...
      grep -rnE '^printf\(\"#'

    • @devops_with_syed
      @devops_with_syed  ปีที่แล้ว

      @@smarlakunta
      variable=“some#value”