Myntra Interview Question


Country: India
Interview Type: Written Test




Comment hidden because of low score. Click to expand.
0
of 0 vote

Can you give me an example of an output?

- 123ayanjit August 31, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Hi 123ayanjit,
for example string str = "hello" and n=3 then we have to print hello n^n times which means 27 times. but please also consider that n is very large so we can't store it.

- acharyashailendra1 September 01, 2019 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi 123ayanjit,
for example string str = "hello" and n=3 then we have to print hello n^n times which means 27 times. but please also consider that n is very large so we can't store it.

- acharyashailendra1 September 01, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

String(repeating: theString, count totalCount

- tbarcello September 02, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

print(str*(len(str)*len(str)))

- Anikesj September 04, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If using recursion is allowed then we can generate as

package com.practice.algo;

public class PrinNNString {

  private static void printNNString(String s, int n, int k) {
    if (k == 1) {
      for (int i = 0; i < n; i++) {
        System.out.print(s);
      }
    } else {
      for (int i = 0; i < n; i++) {
        printNNString(s, n, k - 1);
      }
    }
  }

  private static void printNNString(String s, int n) {
    printNNString(s, n, n);
    System.out.println("");
  }

  public static void main(String[] args) {
    printNNString("Hello", 3);
    printNNString("Hello", 2);
    printNNString("Hello", 1);
  }

}

- xyz September 16, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

is there any other way to solve this problem? is it possible using tree?

- acharyashailendra1 November 08, 2019 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More